Index: trunk/phase3/includes/specials/SpecialFileDuplicateSearch.php |
— | — | @@ -62,19 +62,16 @@ |
63 | 63 | * @param $dupes Array of File objects |
64 | 64 | */ |
65 | 65 | function showList( $dupes ) { |
66 | | - global $wgOut; |
67 | | - $skin = $this->getSkin(); |
68 | | - |
69 | 66 | $html = array(); |
70 | 67 | $html[] = $this->openList( 0 ); |
71 | 68 | |
72 | 69 | foreach ( $dupes as $dupe ) { |
73 | | - $line = $this->formatResult( $skin, $dupe ); |
| 70 | + $line = $this->formatResult( null, $dupe ); |
74 | 71 | $html[] = "<li>" . $line . "</li>"; |
75 | 72 | } |
76 | 73 | $html[] = $this->closeList(); |
77 | 74 | |
78 | | - $wgOut->addHtml( implode( "\n", $html ) ); |
| 75 | + $this->getOutput()->addHtml( implode( "\n", $html ) ); |
79 | 76 | } |
80 | 77 | |
81 | 78 | function getQueryInfo() { |
— | — | @@ -91,12 +88,12 @@ |
92 | 89 | } |
93 | 90 | |
94 | 91 | function execute( $par ) { |
95 | | - global $wgRequest, $wgOut, $wgLang, $wgScript; |
| 92 | + global $wgScript; |
96 | 93 | |
97 | 94 | $this->setHeaders(); |
98 | 95 | $this->outputHeader(); |
99 | 96 | |
100 | | - $this->filename = isset( $par ) ? $par : $wgRequest->getText( 'filename' ); |
| 97 | + $this->filename = isset( $par ) ? $par : $this->getRequest()->getText( 'filename' ); |
101 | 98 | $this->file = null; |
102 | 99 | $this->hash = ''; |
103 | 100 | $title = Title::newFromText( $this->filename, NS_FILE ); |
— | — | @@ -104,8 +101,10 @@ |
105 | 102 | $this->file = wfFindFile( $title ); |
106 | 103 | } |
107 | 104 | |
| 105 | + $out = $this->getOutput(); |
| 106 | + |
108 | 107 | # Create the input form |
109 | | - $wgOut->addHTML( |
| 108 | + $out->addHTML( |
110 | 109 | Xml::openElement( 'form', array( 'id' => 'fileduplicatesearch', 'method' => 'get', 'action' => $wgScript ) ) . |
111 | 110 | Html::hidden( 'title', $this->getTitle()->getPrefixedDbKey() ) . |
112 | 111 | Xml::openElement( 'fieldset' ) . |
— | — | @@ -119,7 +118,7 @@ |
120 | 119 | if( $this->file ) { |
121 | 120 | $this->hash = $this->file->getSha1(); |
122 | 121 | } elseif( $this->filename !== '' ) { |
123 | | - $wgOut->wrapWikiMsg( |
| 122 | + $out->wrapWikiMsg( |
124 | 123 | "<p class='mw-fileduplicatesearch-noresults'>\n$1\n</p>", |
125 | 124 | array( 'fileduplicatesearch-noresults', wfEscapeWikiText( $this->filename ) ) |
126 | 125 | ); |
— | — | @@ -131,12 +130,12 @@ |
132 | 131 | if ( $img ) { |
133 | 132 | $thumb = $img->transform( array( 'width' => 120, 'height' => 120 ) ); |
134 | 133 | if( $thumb ) { |
135 | | - $wgOut->addHTML( '<div class="mw-float-end" id="mw-fileduplicatesearch-icon">' . |
| 134 | + $out->addHTML( '<div class="mw-float-end" id="mw-fileduplicatesearch-icon">' . |
136 | 135 | $thumb->toHtml( array( 'desc-link' => false ) ) . '<br />' . |
137 | 136 | wfMsgExt( 'fileduplicatesearch-info', array( 'parse' ), |
138 | | - $wgLang->formatNum( $img->getWidth() ), |
139 | | - $wgLang->formatNum( $img->getHeight() ), |
140 | | - $wgLang->formatSize( $img->getSize() ), |
| 137 | + $this->getLang()->formatNum( $img->getWidth() ), |
| 138 | + $this->getLang()->formatNum( $img->getHeight() ), |
| 139 | + $this->getLang()->formatSize( $img->getSize() ), |
141 | 140 | $img->getMimeType() |
142 | 141 | ) . |
143 | 142 | '</div>' ); |
— | — | @@ -148,15 +147,15 @@ |
149 | 148 | |
150 | 149 | # Show a short summary |
151 | 150 | if( $numRows == 1 ) { |
152 | | - $wgOut->wrapWikiMsg( |
| 151 | + $out->wrapWikiMsg( |
153 | 152 | "<p class='mw-fileduplicatesearch-result-1'>\n$1\n</p>", |
154 | 153 | array( 'fileduplicatesearch-result-1', wfEscapeWikiText( $this->filename ) ) |
155 | 154 | ); |
156 | 155 | } elseif ( $numRows ) { |
157 | | - $wgOut->wrapWikiMsg( |
| 156 | + $out->wrapWikiMsg( |
158 | 157 | "<p class='mw-fileduplicatesearch-result-n'>\n$1\n</p>", |
159 | 158 | array( 'fileduplicatesearch-result-n', wfEscapeWikiText( $this->filename ), |
160 | | - $wgLang->formatNum( $numRows - 1 ) ) |
| 159 | + $this->getLang()->formatNum( $numRows - 1 ) ) |
161 | 160 | ); |
162 | 161 | } |
163 | 162 | |
— | — | @@ -171,18 +170,18 @@ |
172 | 171 | * @return string |
173 | 172 | */ |
174 | 173 | function formatResult( $skin, $result ) { |
175 | | - global $wgContLang, $wgLang; |
| 174 | + global $wgContLang; |
176 | 175 | |
177 | 176 | $nt = $result->getTitle(); |
178 | 177 | $text = $wgContLang->convert( $nt->getText() ); |
179 | | - $plink = $skin->link( |
| 178 | + $plink = Linker::link( |
180 | 179 | Title::newFromText( $nt->getPrefixedText() ), |
181 | 180 | $text |
182 | 181 | ); |
183 | 182 | |
184 | 183 | $userText = $result->getUser( 'text' ); |
185 | | - $user = $skin->link( Title::makeTitle( NS_USER, $userText ), $userText ); |
186 | | - $time = $wgLang->timeanddate( $result->getTimestamp() ); |
| 184 | + $user = Linker::link( Title::makeTitle( NS_USER, $userText ), $userText ); |
| 185 | + $time = $this->getLang()->timeanddate( $result->getTimestamp() ); |
187 | 186 | |
188 | 187 | return "$plink . . $user . . $time"; |
189 | 188 | } |