Ani1727 has uploaded a new change for review.
https://gerrit.wikimedia.org/r/276973
Change subject: Changed Special:Categories to use OOui forms
......................................................................
Changed Special:Categories to use OOui forms
Bug: T117728
Change-Id: I92e9bfa9c0ffdfe7862f39eb275509fe986f701f
---
M includes/specials/SpecialCategories.php
1 file changed, 22 insertions(+), 24 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/73/276973/1
diff --git a/includes/specials/SpecialCategories.php
b/includes/specials/SpecialCategories.php
index 5314f63..ed366b5 100644
--- a/includes/specials/SpecialCategories.php
+++ b/includes/specials/SpecialCategories.php
@@ -69,6 +69,23 @@
$this->initServices();
$this->setHeaders();
+ $formDescriptor = array(
+ 'from' => array(
+ 'label' => $this->msg( 'categoriesfrom'
)->text(),
+ 'class' => 'HTMLTextField'
+ )
+ );
+ $hiddenFields = [
+ 'title' => $this->getTitle()->getPrefixedText(),
+ ];
+
+ $form = HTMLForm::factory( 'ooui', $formDescriptor,
$this->getContext() );
+ $form->addHiddenFields( $hiddenFields );
+ $form->setSubmitTextMsg( 'categories-submit' );
+ $form->setAction( wfScript() );
+ $form->setMethod( 'get' );
+ $form->prepareForm()->displayForm( false );
+
$this->outputHeader();
$this->getOutput()->allowClickjacking();
@@ -79,12 +96,11 @@
$this->getOutput()->addHTML(
Html::openElement( 'div', [ 'class' => 'mw-spcontent' ]
) .
- $this->msg( 'categoriespagetext',
$cap->getNumRows() )->parseAsBlock() .
- $cap->getStartForm( $from ) .
- $cap->getNavigationBar() .
- '<ul>' . $cap->getBody() . '</ul>' .
- $cap->getNavigationBar() .
- Html::closeElement( 'div' )
+ $this->msg( 'categoriespagetext', $cap->getNumRows()
)->parseAsBlock() .
+ $cap->getNavigationBar() .
+ '<ul>' . $cap->getBody() . '</ul>' .
+ $cap->getNavigationBar() .
+ Html::closeElement( 'div' )
);
}
@@ -179,22 +195,4 @@
return Html::rawElement( 'li', null,
$this->getLanguage()->specialList( $link, $count ) ) . "\n";
}
- public function getStartForm( $from ) {
- return Xml::tags(
- 'form',
- [ 'method' => 'get', 'action' => wfScript() ],
- Html::hidden( 'title',
$this->getTitle()->getPrefixedText() ) .
- Xml::fieldset(
- $this->msg( 'categories' )->text(),
- Xml::inputLabel(
- $this->msg( 'categoriesfrom'
)->text(),
- 'from', 'from', 20, $from, [
'class' => 'mw-ui-input-inline' ] ) .
- ' ' .
- Html::submitButton(
- $this->msg(
'categories-submit' )->text(),
- [], [
'mw-ui-progressive' ]
- )
- )
- );
- }
}
--
To view, visit https://gerrit.wikimedia.org/r/276973
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I92e9bfa9c0ffdfe7862f39eb275509fe986f701f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ani1727 <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits