diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-12-20 09:00:55 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-12-20 09:00:55 +0100 |
commit | a2190ac74dd4d7080b12bab90e552d7aa81209ef (patch) | |
tree | 8b31f38de9882d18df54cf8d9e0de74167a094eb /includes/specials/SpecialLinkSearch.php | |
parent | 15e69f7b20b6596b9148030acce5b59993b95a45 (diff) | |
parent | 257401d8b2cf661adf36c84b0e3fd1cf85e33c22 (diff) |
Merge branch 'mw-1.26'
Diffstat (limited to 'includes/specials/SpecialLinkSearch.php')
-rw-r--r-- | includes/specials/SpecialLinkSearch.php | 68 |
1 files changed, 33 insertions, 35 deletions
diff --git a/includes/specials/SpecialLinkSearch.php b/includes/specials/SpecialLinkSearch.php index 75ff8f30..f4748674 100644 --- a/includes/specials/SpecialLinkSearch.php +++ b/includes/specials/SpecialLinkSearch.php @@ -80,7 +80,7 @@ class LinkSearchPage extends QueryPage { return false; } - function execute( $par ) { + public function execute( $par ) { $this->initServices(); $this->setHeaders(); @@ -91,7 +91,7 @@ class LinkSearchPage extends QueryPage { $request = $this->getRequest(); $target = $request->getVal( 'target', $par ); - $namespace = $request->getIntOrNull( 'namespace', null ); + $namespace = $request->getIntOrNull( 'namespace' ); $protocols_list = array(); foreach ( $this->getConfig()->get( 'UrlProtocols' ) as $prot ) { @@ -121,43 +121,41 @@ class LinkSearchPage extends QueryPage { '<nowiki>' . $this->getLanguage()->commaList( $protocols_list ) . '</nowiki>', count( $protocols_list ) ); - $s = Html::openElement( - 'form', - array( 'id' => 'mw-linksearch-form', 'method' => 'get', 'action' => wfScript() ) - ) . "\n" . - Html::hidden( 'title', $this->getPageTitle()->getPrefixedDBkey() ) . "\n" . - Html::openElement( 'fieldset' ) . "\n" . - Html::element( 'legend', array(), $this->msg( 'linksearch' )->text() ) . "\n" . - Xml::inputLabel( - $this->msg( 'linksearch-pat' )->text(), - 'target', - 'target', - 50, - $target, - array( - // URLs are always ltr - 'dir' => 'ltr', - ) - ) . "\n"; - + $fields = array( + 'target' => array( + 'type' => 'text', + 'name' => 'target', + 'id' => 'target', + 'size' => 50, + 'label-message' => 'linksearch-pat', + 'default' => $target, + 'dir' => 'ltr', + ) + ); if ( !$this->getConfig()->get( 'MiserMode' ) ) { - $s .= Html::namespaceSelector( - array( - 'selected' => $namespace, - 'all' => '', - 'label' => $this->msg( 'linksearch-ns' )->text() - ), array( + $fields += array( + 'namespace' => array( + 'type' => 'namespaceselect', 'name' => 'namespace', + 'label-message' => 'linksearch-ns', + 'default' => $namespace, 'id' => 'namespace', - 'class' => 'namespaceselector', - ) + 'all' => '', + 'cssclass' => 'namespaceselector', + ), ); } - - $s .= Xml::submitButton( $this->msg( 'linksearch-ok' )->text() ) . "\n" . - Html::closeElement( 'fieldset' ) . "\n" . - Html::closeElement( 'form' ) . "\n"; - $out->addHTML( $s ); + $hiddenFields = array( + 'title' => $this->getPageTitle()->getPrefixedDBkey(), + ); + $htmlForm = HTMLForm::factory( 'ooui', $fields, $this->getContext() ); + $htmlForm->addHiddenFields( $hiddenFields ); + $htmlForm->setSubmitTextMsg( 'linksearch-ok' ); + $htmlForm->setWrapperLegendMsg( 'linksearch' ); + $htmlForm->setAction( wfScript() ); + $htmlForm->setMethod( 'get' ); + $htmlForm->prepareForm()->displayForm( false ); + $this->addHelpLink( 'Help:Linksearch' ); if ( $target != '' ) { $this->setParams( array( @@ -220,7 +218,7 @@ class LinkSearchPage extends QueryPage { return $params; } - function getQueryInfo() { + public function getQueryInfo() { $dbr = wfGetDB( DB_SLAVE ); // strip everything past first wildcard, so that // index-based-only lookup would be done |