Change p_sig_bbcode

This commit is contained in:
Visman 2021-12-19 14:15:17 +07:00
parent 05c53d66cd
commit 73c1c4dcf1
4 changed files with 9 additions and 7 deletions

View file

@ -35,7 +35,7 @@ class Parser extends Parserus
{
if (
1 == $this->c->config->b_message_bbcode
|| '1' == $this->c->config->p_sig_bbcode
|| 1 == $this->c->config->b_sig_bbcode
) {
$this->setBBCodes($this->c->bbcode->list);
}
@ -71,7 +71,7 @@ class Parser extends Parserus
public function prepare(string $text, bool $isSignature = false): string
{
if ($isSignature) {
$whiteList = '1' == $this->c->config->p_sig_bbcode
$whiteList = 1 == $this->c->config->b_sig_bbcode
? (empty($this->c->config->a_bb_white_sig) && empty($this->c->config->a_bb_black_sig)
? null
: $this->c->config->a_bb_white_sig
@ -134,7 +134,7 @@ class Parser extends Parserus
{
// при null предполагается брать данные после prepare()
if (null !== $text) {
$whiteList = '1' == $this->c->config->p_sig_bbcode ? null : [];
$whiteList = 1 == $this->c->config->b_sig_bbcode ? null : [];
$blackList = $this->c->config->a_bb_black_sig;
$this->setAttr('isSign', true)

View file

@ -1258,7 +1258,7 @@ class Install extends Admin
'b_message_all_caps' => 0,
'b_subject_all_caps' => 0,
'b_sig_all_caps' => 0,
'p_sig_bbcode' => 1,
'b_sig_bbcode' => 1,
'p_force_guest_email' => 1,
'b_pm' => 0,
'b_poll_enabled' => 0,

View file

@ -31,7 +31,7 @@ class Edit extends Parser
])->addRules([
'token' => 'token:AdminParser',
'b_message_bbcode' => 'required|integer|in:0,1',
'p_sig_bbcode' => 'required|integer|in:0,1',
'b_sig_bbcode' => 'required|integer|in:0,1',
'b_smilies' => 'required|integer|in:0,1',
'b_smilies_sig' => 'required|integer|in:0,1',
'b_make_links' => 'required|integer|in:0,1',
@ -97,9 +97,9 @@ class Edit extends Parser
'caption' => 'BBCode label',
'help' => 'BBCode help',
],
'p_sig_bbcode' => [
'b_sig_bbcode' => [
'type' => 'radio',
'value' => $config->p_sig_bbcode,
'value' => $config->b_sig_bbcode,
'values' => $yn,
'caption' => 'BBCode sigs label',
'help' => 'BBCode sigs help',

View file

@ -527,7 +527,9 @@ class Update extends Admin
$config->b_message_all_caps = '1' == $config->p_message_all_caps ? 1 : 0;
$config->b_subject_all_caps = '1' == $config->p_subject_all_caps ? 1 : 0;
$config->b_sig_all_caps = '1' == $config->p_sig_all_caps ? 1 : 0;
$config->b_sig_bbcode = '1' == $config->p_sig_bbcode ? 1 : 0;
unset($config->p_sig_bbcode);
unset($config->p_sig_all_caps);
unset($config->p_subject_all_caps);
unset($config->p_message_all_caps);