diff options
author | MusikAnimal <musikanimal@gmail.com> | 2024-08-29 00:17:28 -0400 |
---|---|---|
committer | MusikAnimal <musikanimal@gmail.com> | 2024-08-29 04:21:48 +0000 |
commit | 24de971e00703e3c0a305b04f62ab964e03d9a10 (patch) | |
tree | 9c77cc8ff004bb7eaf513c95070682b58ff90fb3 /includes/specials/SpecialBlock.php | |
parent | cd5fe6c658831b61bcc8b1f6dab0b691c85239dc (diff) | |
download | mediawikicore-24de971e00703e3c0a305b04f62ab964e03d9a10.tar.gz mediawikicore-24de971e00703e3c0a305b04f62ab964e03d9a10.zip |
SpecialBlock: refactor to use $useCodex class property
Resources: alphabetize i18n key list
Change-Id: I4bed4f1bb2cba46b7330c6a4ee9a1b323dc6adc2
Diffstat (limited to 'includes/specials/SpecialBlock.php')
-rw-r--r-- | includes/specials/SpecialBlock.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/includes/specials/SpecialBlock.php b/includes/specials/SpecialBlock.php index bf6e1265e88c..486f8962de7c 100644 --- a/includes/specials/SpecialBlock.php +++ b/includes/specials/SpecialBlock.php @@ -101,6 +101,9 @@ class SpecialBlock extends FormSpecialPage { */ protected $preErrors = []; + /** @var bool */ + protected bool $useCodex = false; + /** * @var array <mixed,mixed> An associative array used to pass vars to Codex form */ @@ -141,12 +144,13 @@ class SpecialBlock extends FormSpecialPage { $this->blockActionInfo = $blockActionInfo; $this->titleFormatter = $titleFormatter; $this->namespaceInfo = $namespaceInfo; + $this->useCodex = $this->getConfig()->get( MainConfigNames::UseCodexSpecialBlock ); } public function execute( $par ) { parent::execute( $par ); - if ( $this->getConfig()->get( MainConfigNames::UseCodexSpecialBlock ) ) { + if ( $this->useCodex ) { $this->getOutput()->addModules( 'mediawiki.special.block.codex' ); $this->getOutput()->addJsConfigVars( $this->codexFormData ); } @@ -234,7 +238,7 @@ class SpecialBlock extends FormSpecialPage { } protected function getDisplayFormat() { - return $this->getConfig()->get( MainConfigNames::UseCodexSpecialBlock ) ? 'codex' : 'ooui'; + return $this->useCodex ? 'codex' : 'ooui'; } /** @@ -273,7 +277,7 @@ class SpecialBlock extends FormSpecialPage { 'section' => 'target', ]; - $editingRestrictionOptions = $this->getConfig()->get( MainConfigNames::UseCodexSpecialBlock ) ? + $editingRestrictionOptions = $this->useCodex ? // If we're using Codex, use the option-descriptions feature, which is only supported by Codex [ 'options-messages' => [ |