X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialProtectedpages.php;h=d693b990075102d79a67ac7504175688a5c8f8fe;hb=d7af41c98ec6627009f53306c17ada2a37d2e0c2;hp=987bcdda798dda8218651b44f5917df85f178429;hpb=a4997d99ed86a7f5d95cc794fa29e9d3cd0cc843;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialProtectedpages.php b/includes/specials/SpecialProtectedpages.php index 987bcdda79..d693b99007 100644 --- a/includes/specials/SpecialProtectedpages.php +++ b/includes/specials/SpecialProtectedpages.php @@ -96,15 +96,38 @@ class SpecialProtectedpages extends SpecialPage { $size, $indefOnly, $cascadeOnly, $noRedirect ) { $formDescriptor = [ - 'namespace' => $this->getNamespaceMenu( $namespace ), + 'namespace' => [ + 'class' => HTMLSelectNamespace::class, + 'name' => 'namespace', + 'id' => 'namespace', + 'cssclass' => 'namespaceselector', + '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', + ], + 'cascadecheck' => [ + 'type' => 'check', + 'label' => $this->msg( 'protectedpages-cascade' )->text(), + 'name' => 'cascadeonly', + 'id' => 'cascadeonly', + ], + 'redirectcheck' => [ + 'type' => 'check', + 'label' => $this->msg( 'protectedpages-noredirect' )->text(), + 'name' => 'noredirect', + 'id' => 'noredirect', + ], + 'sizelimit' => [ + 'class' => HTMLSizeFilterField::class, + 'name' => 'size', + ] ]; $htmlForm = new HTMLForm( $formDescriptor, $this->getContext() ); $htmlForm @@ -115,81 +138,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 @@ -214,7 +162,6 @@ class SpecialProtectedpages extends SpecialPage { return [ 'type' => 'select', 'options' => $options, - 'value' => $pr_type, 'label' => $this->msg( 'restriction-type' )->text(), 'name' => $this->IdType, 'id' => $this->IdType, @@ -248,7 +195,6 @@ class SpecialProtectedpages extends SpecialPage { return [ 'type' => 'select', 'options' => $options, - 'value' => $pr_level, 'label' => $this->msg( 'restriction-level' )->text(), 'name' => $this->IdLevel, 'id' => $this->IdLevel