summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialRandomInCategory.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/specials/SpecialRandomInCategory.php')
-rw-r--r--includes/specials/SpecialRandomInCategory.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/includes/specials/SpecialRandomInCategory.php b/includes/specials/SpecialRandomInCategory.php
index b5c9e19a..7cf6b0a1 100644
--- a/includes/specials/SpecialRandomInCategory.php
+++ b/includes/specials/SpecialRandomInCategory.php
@@ -70,15 +70,15 @@ class SpecialRandomInCategory extends FormSpecialPage {
protected function getFormFields() {
$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 ) );