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() {
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 ) );