X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialRandomInCategory.php;h=7cf6b0a1b8999ae6c67e34b35fd9a3cd21ffa3b4;hb=121d68243b36fdec06e70c73c4f6f5c04e9f6f23;hp=b6f19ec065bc880d6e35433417dfc415e65f7617;hpb=39508404aa6e7d9e8ce55eeeab523bf31e8affb6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialRandomInCategory.php b/includes/specials/SpecialRandomInCategory.php index b6f19ec065..7cf6b0a1b8 100644 --- a/includes/specials/SpecialRandomInCategory.php +++ b/includes/specials/SpecialRandomInCategory.php @@ -68,17 +68,17 @@ class SpecialRandomInCategory extends FormSpecialPage { } protected function getFormFields() { - $this->getOutput()->addHelpLink( 'Help:RandomInCategory' ); + $this->addHelpLink( 'Help:RandomInCategory' ); - $form = array( + return array( 'category' => array( - 'type' => 'text', + 'type' => 'title', + 'namespace' => NS_CATEGORY, + 'relative' => true, 'label-message' => 'randomincategory-category', 'required' => true, ) ); - - return $form; } public function requiresWrite() { @@ -89,6 +89,14 @@ class SpecialRandomInCategory extends FormSpecialPage { return false; } + protected function getDisplayFormat() { + return 'ooui'; + } + + protected function alterForm( HTMLForm $form ) { + $form->setSubmitTextMsg( 'randomincategory-submit' ); + } + protected function setParameter( $par ) { // if subpage present, fake form submission $this->onSubmit( array( 'category' => $par ) );