X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fspecials%2FSpecialProtectedpages.php;h=2ef9eafffb82625a3883708cb73c746560461c81;hp=987bcdda798dda8218651b44f5917df85f178429;hb=dbad540cd37617879aff6f28ce9c016dd8049d4e;hpb=4a6fb0dea3c4a00ab06156f0c0a93205dcbf2c46 diff --git a/includes/specials/SpecialProtectedpages.php b/includes/specials/SpecialProtectedpages.php index 987bcdda79..2ef9eafffb 100644 --- a/includes/specials/SpecialProtectedpages.php +++ b/includes/specials/SpecialProtectedpages.php @@ -96,15 +96,42 @@ class SpecialProtectedpages extends SpecialPage { $size, $indefOnly, $cascadeOnly, $noRedirect ) { $formDescriptor = [ - 'namespace' => $this->getNamespaceMenu( $namespace ), + 'namespace' => [ + 'class' => 'HTMLSelectNamespace', + 'name' => 'namespace', + 'id' => 'namespace', + 'cssclass' => 'namespaceselector', + 'selected' => $namespace, + 'all' => '', + 'label' => $this->msg( 'namespace' )->text(), + ], 'typemenu' => $this->getTypeMenu( $type ), 'levelmenu' => $this->getLevelMenu( $level ), - - 'expirycheck' => $this->getExpiryCheck( $indefOnly ), - 'cascadecheck' => $this->getCascadeCheck( $cascadeOnly ), - 'redirectcheck' => $this->getRedirectCheck( $noRedirect ), - - 'sizelimit' => $this->getSizeLimit( $sizetype, $size ), + 'expirycheck' => [ + 'type' => 'check', + 'label' => $this->msg( 'protectedpages-indef' )->text(), + 'name' => 'indefonly', + 'id' => 'indefonly', + 'value' => $indefOnly + ], + 'cascadecheck' => [ + 'type' => 'check', + 'label' => $this->msg( 'protectedpages-cascade' )->text(), + 'name' => 'cascadeonly', + 'id' => 'cascadeonly', + 'value' => $cascadeOnly + ], + 'redirectcheck' => [ + 'type' => 'check', + 'label' => $this->msg( 'protectedpages-noredirect' )->text(), + 'name' => 'noredirect', + 'id' => 'noredirect', + 'value' => $noRedirect, + ], + 'sizelimit' => [ + 'class' => 'HTMLSizeFilterField', + 'name' => 'size', + ] ]; $htmlForm = new HTMLForm( $formDescriptor, $this->getContext() ); $htmlForm @@ -115,81 +142,6 @@ class SpecialProtectedpages extends SpecialPage { return $htmlForm->prepareForm()->getHTML( false ); } - /** - * Prepare the namespace filter drop-down; standard namespace - * selector, sans the MediaWiki namespace - * - * @param string|null $namespace Pre-select namespace - * @return array - */ - protected function getNamespaceMenu( $namespace = null ) { - return [ - 'class' => 'HTMLSelectNamespace', - 'name' => 'namespace', - 'id' => 'namespace', - 'cssclass' => 'namespaceselector', - 'selected' => $namespace, - 'all' => '', - 'label' => $this->msg( 'namespace' )->text(), - ]; - } - - /** - * @param bool $indefOnly - * @return array - */ - protected function getExpiryCheck( $indefOnly ) { - return [ - 'type' => 'check', - 'label' => $this->msg( 'protectedpages-indef' )->text(), - 'name' => 'indefonly', - 'id' => 'indefonly', - 'value' => $indefOnly - ]; - } - - /** - * @param bool $cascadeOnly - * @return array - */ - protected function getCascadeCheck( $cascadeOnly ) { - return [ - 'type' => 'check', - 'label' => $this->msg( 'protectedpages-cascade' )->text(), - 'name' => 'cascadeonly', - 'id' => 'cascadeonly', - 'value' => $cascadeOnly - ]; - } - - /** - * @param bool $noRedirect - * @return array - */ - protected function getRedirectCheck( $noRedirect ) { - return [ - 'type' => 'check', - 'label' => $this->msg( 'protectedpages-noredirect' )->text(), - 'name' => 'noredirect', - 'id' => 'noredirect', - 'value' => $noRedirect, - ]; - } - - /** - * @param string $sizetype "min" or "max" - * @param mixed $size - * @return array - */ - protected function getSizeLimit( $sizetype, $size ) { - $max = $sizetype === 'max'; - - return [ - 'class' => 'HTMLSizeFilterField', - 'name' => 'size', - ]; - } - /** * Creates the input label of the restriction type * @param string $pr_type Protection type