summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialLinkSearch.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2012-01-12 13:42:29 +0100
committerPierre Schmitz <pierre@archlinux.de>2012-01-12 13:42:29 +0100
commitba0fc4fa20067528effd4802e53ceeb959640825 (patch)
tree4f62217349d3afa39dbba3f7e19dac0aecb344f6 /includes/specials/SpecialLinkSearch.php
parentca32f08966f1b51fcb19460f0996bb0c4048e6fe (diff)
Update to MediaWiki 1.18.1
Diffstat (limited to 'includes/specials/SpecialLinkSearch.php')
-rw-r--r--includes/specials/SpecialLinkSearch.php32
1 files changed, 19 insertions, 13 deletions
diff --git a/includes/specials/SpecialLinkSearch.php b/includes/specials/SpecialLinkSearch.php
index bef859a2..53db6f87 100644
--- a/includes/specials/SpecialLinkSearch.php
+++ b/includes/specials/SpecialLinkSearch.php
@@ -43,14 +43,20 @@ class LinkSearchPage extends QueryPage {
}
function execute( $par ) {
- global $wgOut, $wgRequest, $wgUrlProtocols, $wgMiserMode, $wgLang;
+ global $wgUrlProtocols, $wgMiserMode;
+
$this->setHeaders();
- $wgOut->allowClickjacking();
+ $this->outputHeader();
+
+ $out = $this->getOutput();
+ $out->allowClickjacking();
- $target = $wgRequest->getVal( 'target', $par );
- $namespace = $wgRequest->getIntorNull( 'namespace', null );
+ $request = $this->getRequest();
+ $target = $request->getVal( 'target', $par );
+ $namespace = $request->getIntorNull( 'namespace', null );
$protocols_list = array();
+
foreach( $wgUrlProtocols as $prot ) {
if ( $prot !== '//' ) {
$protocols_list[] = $prot;
@@ -79,9 +85,10 @@ class LinkSearchPage extends QueryPage {
$protocol = '';
}
- $out->addWikiMsg( 'linksearch-text', '<nowiki>' . $this->getLanguage()->commaList( $protocols_list ) . '</nowiki>' );
+ $out->addWikiMsg( 'linksearch-text', '<nowiki>' . $this->getLang()->commaList( $wgUrlProtocols ) . '</nowiki>' );
+
$s = Xml::openElement( 'form', array( 'id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $GLOBALS['wgScript'] ) ) .
- Html::hidden( 'title', $self->getPrefixedDbKey() ) .
+ Html::hidden( 'title', $this->getTitle()->getPrefixedDbKey() ) .
'<fieldset>' .
Xml::element( 'legend', array(), wfMsg( 'linksearch' ) ) .
Xml::inputLabel( wfMsg( 'linksearch-pat' ), 'target', 'target', 50, $target ) . ' ';
@@ -92,7 +99,7 @@ class LinkSearchPage extends QueryPage {
$s .= Xml::submitButton( wfMsg( 'linksearch-ok' ) ) .
'</fieldset>' .
Xml::closeElement( 'form' );
- $wgOut->addHTML( $s );
+ $out->addHTML( $s );
if( $target != '' ) {
$this->setParams( array(
@@ -101,7 +108,7 @@ class LinkSearchPage extends QueryPage {
'protocol' => $protocol ) );
parent::execute( $par );
if( $this->mMungedQuery === false )
- $wgOut->addWikiMsg( 'linksearch-error' );
+ $out->addWikiMsg( 'linksearch-error' );
}
}
@@ -172,8 +179,8 @@ class LinkSearchPage extends QueryPage {
function formatResult( $skin, $result ) {
$title = Title::makeTitle( $result->namespace, $result->title );
$url = $result->url;
- $pageLink = $skin->linkKnown( $title );
- $urlLink = $skin->makeExternalLink( $url, $url );
+ $pageLink = Linker::linkKnown( $title );
+ $urlLink = Linker::makeExternalLink( $url, $url );
return wfMsgHtml( 'linksearch-line', $urlLink, $pageLink );
}
@@ -182,14 +189,13 @@ class LinkSearchPage extends QueryPage {
* Override to check query validity.
*/
function doQuery( $offset = false, $limit = false ) {
- global $wgOut;
list( $this->mMungedQuery, ) = LinkSearchPage::mungeQuery( $this->mQuery, $this->mProt );
if( $this->mMungedQuery === false ) {
- $wgOut->addWikiMsg( 'linksearch-error' );
+ $this->getOutput()->addWikiMsg( 'linksearch-error' );
} else {
// For debugging
// Generates invalid xhtml with patterns that contain --
- //$wgOut->addHTML( "\n<!-- " . htmlspecialchars( $this->mMungedQuery ) . " -->\n" );
+ //$this->getOutput()->addHTML( "\n<!-- " . htmlspecialchars( $this->mMungedQuery ) . " -->\n" );
parent::doQuery( $offset, $limit );
}
}