Change o_smilies and o_make_links

This commit is contained in:
Visman 2021-12-19 12:36:51 +07:00
parent d89ba87a2b
commit 8b6acc5d7f
8 changed files with 19 additions and 15 deletions

View file

@ -44,7 +44,7 @@ class Parser extends Parserus
'1' == $this->c->user->show_smilies
&& (
1 == $this->c->config->b_smilies_sig
|| '1' == $this->c->config->o_smilies
|| 1 == $this->c->config->b_smilies
)
) {
$smilies = [];
@ -94,7 +94,7 @@ class Parser extends Parserus
->parse($text, ['strict' => true])
->stripEmptyTags(" \n\t\r\v", true);
if ('1' == $this->c->config->o_make_links) {
if (1 == $this->c->config->b_make_links) {
$this->detectUrls();
}
@ -119,7 +119,7 @@ class Parser extends Parserus
if (
! $hideSmilies
&& '1' == $this->c->config->o_smilies
&& 1 == $this->c->config->b_smilies
) {
$this->detectSmilies();
}

View file

@ -1209,9 +1209,9 @@ class Install extends Admin
'i_redirect_delay' => 1,
'b_show_user_info' => 1,
'b_show_post_count' => 1,
'o_smilies' => 1,
'b_smilies' => 1,
'b_smilies_sig' => 1,
'o_make_links' => 1,
'b_make_links' => 1,
'o_default_lang' => $v->defaultlang,
'o_default_style' => $v->defaultstyle,
'i_default_user_group' => FORK_GROUP_NEW_MEMBER,

View file

@ -32,9 +32,9 @@ class Edit extends Parser
'token' => 'token:AdminParser',
'p_message_bbcode' => 'required|integer|in:0,1',
'p_sig_bbcode' => 'required|integer|in:0,1',
'o_smilies' => 'required|integer|in:0,1',
'b_smilies' => 'required|integer|in:0,1',
'b_smilies_sig' => 'required|integer|in:0,1',
'o_make_links' => 'required|integer|in:0,1',
'b_make_links' => 'required|integer|in:0,1',
])->addAliases([
])->addArguments([
])->addMessages([
@ -104,9 +104,9 @@ class Edit extends Parser
'caption' => 'BBCode sigs label',
'help' => 'BBCode sigs help',
],
'o_make_links' => [
'b_make_links' => [
'type' => 'radio',
'value' => $config->o_make_links,
'value' => $config->b_make_links,
'values' => $yn,
'caption' => 'Clickable links label',
'help' => 'Clickable links help',
@ -124,9 +124,9 @@ class Edit extends Parser
$form['sets']['smilies'] = [
'legend' => 'Smilies subhead',
'fields' => [
'o_smilies' => [
'b_smilies' => [
'type' => 'radio',
'value' => $config->o_smilies,
'value' => $config->b_smilies,
'values' => $yn,
'caption' => 'Smilies mess label',
'help' => 'Smilies mess help',

View file

@ -504,6 +504,8 @@ class Update extends Admin
$this->c->config->b_show_user_info = '1' == $this->c->config->o_show_user_info ? 1 : 0;
$this->c->config->b_show_post_count = '1' == $this->c->config->o_show_post_count ? 1 : 0;
$this->c->config->b_smilies_sig = '1' == $this->c->config->o_smilies_sig ? 1 : 0;
$this->c->config->b_smilies = '1' == $this->c->config->o_smilies ? 1 : 0;
$this->c->config->b_make_links = '1' == $this->c->config->o_make_links ? 1 : 0;
unset($this->c->config->o_timeout_visit);
unset($this->c->config->o_timeout_online);
@ -511,6 +513,8 @@ class Update extends Admin
unset($this->c->config->o_show_user_info);
unset($this->c->config->o_show_post_count);
unset($this->c->config->o_smilies_sig);
unset($this->c->config->o_smilies);
unset($this->c->config->o_make_links)ж
$this->c->config->save();

View file

@ -162,7 +162,7 @@ class Edit extends Page
}
// показ смайлов
if (
'1' == $this->c->config->o_smilies
1 == $this->c->config->b_smilies
&& (bool) $post->hide_smilies !== (bool) $v->hide_smilies
) {
$post->hide_smilies = $v->hide_smilies ? 1 : 0;

View file

@ -140,7 +140,7 @@ class PMEdit extends AbstractPM
}
// показ смайлов
if (
'1' == $this->c->config->o_smilies
1 == $this->c->config->b_smilies
&& (bool) $post->hide_smilies !== (bool) $v->hide_smilies
) {
$post->hide_smilies = $v->hide_smilies ? 1 : 0;

View file

@ -161,7 +161,7 @@ trait PostFormTrait
if (
! $quick
&& '1' == $this->c->config->o_smilies
&& 1 == $this->c->config->b_smilies
) {
$fieldset['hide_smilies'] = [
'type' => 'checkbox',

View file

@ -170,7 +170,7 @@ trait PostValidatorTrait
$ruleSubscribe = 'absent';
}
if ('1' == $this->c->config->o_smilies) {
if (1 == $this->c->config->b_smilies) {
$ruleHideSmilies = 'checkbox';
} else {
$ruleHideSmilies = 'absent';