Change p_message_bbcode

This commit is contained in:
Visman 2021-12-19 13:55:25 +07:00
parent 32349ef56f
commit 37fd83fda1
4 changed files with 9 additions and 7 deletions

View file

@ -34,7 +34,7 @@ class Parser extends Parserus
protected function init(): void
{
if (
'1' == $this->c->config->p_message_bbcode
1 == $this->c->config->b_message_bbcode
|| '1' == $this->c->config->p_sig_bbcode
) {
$this->setBBCodes($this->c->bbcode->list);
@ -79,7 +79,7 @@ class Parser extends Parserus
: [];
$blackList = null;
} else {
$whiteList = '1' == $this->c->config->p_message_bbcode
$whiteList = 1 == $this->c->config->b_message_bbcode
? (empty($this->c->config->a_bb_white_mes) && empty($this->c->config->a_bb_black_mes)
? null
: $this->c->config->a_bb_white_mes
@ -108,7 +108,7 @@ class Parser extends Parserus
{
// при null предполагается брать данные после prepare()
if (null !== $text) {
$whiteList = '1' == $this->c->config->p_message_bbcode ? null : [];
$whiteList = 1 == $this->c->config->b_message_bbcode ? null : [];
$blackList = $this->c->config->a_bb_black_mes;
$this->setAttr('isSign', false)

View file

@ -1254,7 +1254,7 @@ class Install extends Admin
'b_default_dst' => 0,
'i_feed_type' => 2,
'i_feed_ttl' => 0,
'p_message_bbcode' => 1,
'b_message_bbcode' => 1,
'p_message_all_caps' => 1,
'p_subject_all_caps' => 1,
'p_sig_all_caps' => 1,

View file

@ -30,7 +30,7 @@ class Edit extends Parser
->addValidators([
])->addRules([
'token' => 'token:AdminParser',
'p_message_bbcode' => 'required|integer|in:0,1',
'b_message_bbcode' => 'required|integer|in:0,1',
'p_sig_bbcode' => 'required|integer|in:0,1',
'b_smilies' => 'required|integer|in:0,1',
'b_smilies_sig' => 'required|integer|in:0,1',
@ -90,9 +90,9 @@ class Edit extends Parser
$form['sets']['bbcode'] = [
'legend' => 'BBCode subhead',
'fields' => [
'p_message_bbcode' => [
'b_message_bbcode' => [
'type' => 'radio',
'value' => $config->p_message_bbcode,
'value' => $config->b_message_bbcode,
'values' => $yn,
'caption' => 'BBCode label',
'help' => 'BBCode help',

View file

@ -523,7 +523,9 @@ class Update extends Admin
$config->b_rules = '1' == $config->o_rules ? 1 : 0;
$config->b_maintenance = '1' == $config->o_maintenance ? 1 : 0;
$config->b_default_dst = '1' == $config->o_default_dst ? 1 : 0;
$config->b_message_bbcode = '1' == $config->p_message_bbcode ? 1 : 0;
unset($config->p_message_bbcode);
unset($config->o_default_dst);
unset($config->o_maintenance);
unset($config->o_rules);