Index: trunk/phase3/includes/specials/SpecialLinkSearch.php |
— | — | @@ -43,13 +43,18 @@ |
44 | 44 | } |
45 | 45 | |
46 | 46 | function execute( $par ) { |
47 | | - global $wgOut, $wgRequest, $wgUrlProtocols, $wgMiserMode, $wgLang; |
| 47 | + global $wgUrlProtocols, $wgMiserMode; |
| 48 | + |
48 | 49 | $this->setHeaders(); |
49 | | - $wgOut->allowClickjacking(); |
| 50 | + $this->outputHeader(); |
50 | 51 | |
51 | | - $target = $wgRequest->getVal( 'target', $par ); |
52 | | - $namespace = $wgRequest->getIntorNull( 'namespace', null ); |
| 52 | + $out = $this->getOutput(); |
| 53 | + $out->allowClickjacking(); |
53 | 54 | |
| 55 | + $request = $this->getRequest(); |
| 56 | + $target = $request->getVal( 'target', $par ); |
| 57 | + $namespace = $request->getIntorNull( 'namespace', null ); |
| 58 | + |
54 | 59 | $protocols_list[] = ''; |
55 | 60 | foreach( $wgUrlProtocols as $prot ) { |
56 | 61 | $protocols_list[] = $prot; |
— | — | @@ -77,11 +82,9 @@ |
78 | 83 | $protocol = ''; |
79 | 84 | } |
80 | 85 | |
81 | | - $self = $this->getTitle(); |
82 | | - |
83 | | - $wgOut->addWikiMsg( 'linksearch-text', '<nowiki>' . $wgLang->commaList( $wgUrlProtocols ) . '</nowiki>' ); |
| 86 | + $out->addWikiMsg( 'linksearch-text', '<nowiki>' . $this->getLang()->commaList( $wgUrlProtocols ) . '</nowiki>' ); |
84 | 87 | $s = Xml::openElement( 'form', array( 'id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $GLOBALS['wgScript'] ) ) . |
85 | | - Html::hidden( 'title', $self->getPrefixedDbKey() ) . |
| 88 | + Html::hidden( 'title', $this->getTitle()->getPrefixedDbKey() ) . |
86 | 89 | '<fieldset>' . |
87 | 90 | Xml::element( 'legend', array(), wfMsg( 'linksearch' ) ) . |
88 | 91 | Xml::inputLabel( wfMsg( 'linksearch-pat' ), 'target', 'target', 50, $target ) . ' '; |
— | — | @@ -92,7 +95,7 @@ |
93 | 96 | $s .= Xml::submitButton( wfMsg( 'linksearch-ok' ) ) . |
94 | 97 | '</fieldset>' . |
95 | 98 | Xml::closeElement( 'form' ); |
96 | | - $wgOut->addHTML( $s ); |
| 99 | + $out->addHTML( $s ); |
97 | 100 | |
98 | 101 | if( $target != '' ) { |
99 | 102 | $this->setParams( array( |
— | — | @@ -101,7 +104,7 @@ |
102 | 105 | 'protocol' => $protocol ) ); |
103 | 106 | parent::execute( $par ); |
104 | 107 | if( $this->mMungedQuery === false ) |
105 | | - $wgOut->addWikiMsg( 'linksearch-error' ); |
| 108 | + $out->addWikiMsg( 'linksearch-error' ); |
106 | 109 | } |
107 | 110 | } |
108 | 111 | |
— | — | @@ -172,8 +175,8 @@ |
173 | 176 | function formatResult( $skin, $result ) { |
174 | 177 | $title = Title::makeTitle( $result->namespace, $result->title ); |
175 | 178 | $url = $result->url; |
176 | | - $pageLink = $skin->linkKnown( $title ); |
177 | | - $urlLink = $skin->makeExternalLink( $url, $url ); |
| 179 | + $pageLink = Linker::linkKnown( $title ); |
| 180 | + $urlLink = Linker::makeExternalLink( $url, $url ); |
178 | 181 | |
179 | 182 | return wfMsgHtml( 'linksearch-line', $urlLink, $pageLink ); |
180 | 183 | } |
— | — | @@ -182,14 +185,13 @@ |
183 | 186 | * Override to check query validity. |
184 | 187 | */ |
185 | 188 | function doQuery( $offset = false, $limit = false ) { |
186 | | - global $wgOut; |
187 | 189 | list( $this->mMungedQuery, ) = LinkSearchPage::mungeQuery( $this->mQuery, $this->mProt ); |
188 | 190 | if( $this->mMungedQuery === false ) { |
189 | | - $wgOut->addWikiMsg( 'linksearch-error' ); |
| 191 | + $this->getOutput()->addWikiMsg( 'linksearch-error' ); |
190 | 192 | } else { |
191 | 193 | // For debugging |
192 | 194 | // Generates invalid xhtml with patterns that contain -- |
193 | | - //$wgOut->addHTML( "\n<!-- " . htmlspecialchars( $this->mMungedQuery ) . " -->\n" ); |
| 195 | + //$this->getOutput()->addHTML( "\n<!-- " . htmlspecialchars( $this->mMungedQuery ) . " -->\n" ); |
194 | 196 | parent::doQuery( $offset, $limit ); |
195 | 197 | } |
196 | 198 | } |