Index: trunk/phase3/includes/AutoLoader.php |
— | — | @@ -465,6 +465,7 @@ |
466 | 466 | 'MostrevisionsPage' => 'includes/specials/SpecialMostrevisions.php', |
467 | 467 | 'MovePageForm' => 'includes/specials/SpecialMovepage.php', |
468 | 468 | 'SpecialNewpages' => 'includes/specials/SpecialNewpages.php', |
| 469 | + 'SpecialContributions' => 'includes/specials/SpecialContributions.php', |
469 | 470 | 'NewPagesPager' => 'includes/specials/SpecialNewpages.php', |
470 | 471 | 'PageArchive' => 'includes/specials/SpecialUndelete.php', |
471 | 472 | 'PasswordResetForm' => 'includes/specials/SpecialResetpass.php', |
Index: trunk/phase3/includes/specials/SpecialContributions.php |
— | — | @@ -4,7 +4,264 @@ |
5 | 5 | * @file |
6 | 6 | * @ingroup SpecialPage |
7 | 7 | */ |
| 8 | + |
| 9 | +class SpecialContributions extends SpecialPage { |
8 | 10 | |
| 11 | + public function __construct() { |
| 12 | + parent::__construct( 'Contributions' ); |
| 13 | + } |
| 14 | + |
| 15 | + function execute( $par ) { |
| 16 | + global $wgUser, $wgOut, $wgLang, $wgRequest; |
| 17 | + |
| 18 | + $this->setHeaders(); |
| 19 | + $this->outputHeader(); |
| 20 | + |
| 21 | + $options = array(); |
| 22 | + |
| 23 | + if ( isset( $par ) && $par == 'newbies' ) { |
| 24 | + $target = 'newbies'; |
| 25 | + $options['contribs'] = 'newbie'; |
| 26 | + } elseif ( isset( $par ) ) { |
| 27 | + $target = $par; |
| 28 | + } else { |
| 29 | + $target = $wgRequest->getVal( 'target' ); |
| 30 | + } |
| 31 | + |
| 32 | + // check for radiobox |
| 33 | + if ( $wgRequest->getVal( 'contribs' ) == 'newbie' ) { |
| 34 | + $target = 'newbies'; |
| 35 | + $options['contribs'] = 'newbie'; |
| 36 | + } |
| 37 | + |
| 38 | + if ( !strlen( $target ) ) { |
| 39 | + $wgOut->addHTML( $this->getForm( '' ) ); |
| 40 | + return; |
| 41 | + } |
| 42 | + |
| 43 | + $options['limit'] = $wgRequest->getInt( 'limit', 50 ); |
| 44 | + $options['target'] = $target; |
| 45 | + |
| 46 | + $nt = Title::makeTitleSafe( NS_USER, $target ); |
| 47 | + if ( !$nt ) { |
| 48 | + $wgOut->addHTML( $this->getForm( '' ) ); |
| 49 | + return; |
| 50 | + } |
| 51 | + $id = User::idFromName( $nt->getText() ); |
| 52 | + |
| 53 | + if ( $target != 'newbies' ) { |
| 54 | + $target = $nt->getText(); |
| 55 | + $wgOut->setSubtitle( $this->contributionsSub( $nt, $id ) ); |
| 56 | + $wgOut->setHTMLTitle( wfMsg( 'pagetitle', wfMsg( 'contributions-title', $target ) ) ); |
| 57 | + } else { |
| 58 | + $wgOut->setSubtitle( wfMsgHtml( 'sp-contributions-newbies-sub') ); |
| 59 | + $wgOut->setHTMLTitle( wfMsg( 'pagetitle', wfMsg( 'sp-contributions-newbies-title' ) ) ); |
| 60 | + } |
| 61 | + |
| 62 | + if ( ( $ns = $wgRequest->getVal( 'namespace', null ) ) !== null && $ns !== '' ) { |
| 63 | + $options['namespace'] = intval( $ns ); |
| 64 | + } else { |
| 65 | + $options['namespace'] = ''; |
| 66 | + } |
| 67 | + |
| 68 | + // Allows reverts to have the bot flag in recent changes. It is just here to |
| 69 | + // be passed in the form at the top of the page |
| 70 | + if ( $wgUser->isAllowed( 'markbotedits' ) && $wgRequest->getBool( 'bot' ) ) { |
| 71 | + $options['bot'] = '1'; |
| 72 | + } |
| 73 | + |
| 74 | + $skip = $wgRequest->getText( 'offset' ) || $wgRequest->getText( 'dir' ) == 'prev'; |
| 75 | + # Offset overrides year/month selection |
| 76 | + if ( ( $month = $wgRequest->getIntOrNull( 'month' ) ) !== null && $month !== -1 ) { |
| 77 | + $options['month'] = intval( $month ); |
| 78 | + } else { |
| 79 | + $options['month'] = ''; |
| 80 | + } |
| 81 | + if ( ( $year = $wgRequest->getIntOrNull( 'year' ) ) !== null ) { |
| 82 | + $options['year'] = intval( $year ); |
| 83 | + } else if( $options['month'] ) { |
| 84 | + $thisMonth = intval( gmdate( 'n' ) ); |
| 85 | + $thisYear = intval( gmdate( 'Y' ) ); |
| 86 | + if( intval( $options['month'] ) > $thisMonth ) { |
| 87 | + $thisYear--; |
| 88 | + } |
| 89 | + $options['year'] = $thisYear; |
| 90 | + } else { |
| 91 | + $options['year'] = ''; |
| 92 | + } |
| 93 | + |
| 94 | + wfRunHooks( 'SpecialContributionsBeforeMainOutput', $id ); |
| 95 | + |
| 96 | + if( $skip ) { |
| 97 | + $options['year'] = ''; |
| 98 | + $options['month'] = ''; |
| 99 | + } |
| 100 | + |
| 101 | + $wgOut->addHTML( $this->getForm( $options ) ); |
| 102 | + |
| 103 | + $pager = new ContribsPager( $target, $options['namespace'], $options['year'], $options['month'] ); |
| 104 | + if ( !$pager->getNumRows() ) { |
| 105 | + $wgOut->addWikiMsg( 'nocontribs' ); |
| 106 | + return; |
| 107 | + } |
| 108 | + |
| 109 | + # Show a message about slave lag, if applicable |
| 110 | + if( ( $lag = $pager->getDatabase()->getLag() ) > 0 ) |
| 111 | + $wgOut->showLagWarning( $lag ); |
| 112 | + |
| 113 | + $wgOut->addHTML( |
| 114 | + '<p>' . $pager->getNavigationBar() . '</p>' . |
| 115 | + $pager->getBody() . |
| 116 | + '<p>' . $pager->getNavigationBar() . '</p>' ); |
| 117 | + |
| 118 | + # If there were contributions, and it was a valid user or IP, show |
| 119 | + # the appropriate "footer" message - WHOIS tools, etc. |
| 120 | + if( $target != 'newbies' ) { |
| 121 | + $message = IP::isIPAddress( $target ) |
| 122 | + ? 'sp-contributions-footer-anon' |
| 123 | + : 'sp-contributions-footer'; |
| 124 | + |
| 125 | + $text = wfMsgNoTrans( $message, $target ); |
| 126 | + if( !wfEmptyMsg( $message, $text ) && $text != '-' ) { |
| 127 | + $wgOut->addHtml( '<div class="mw-contributions-footer">' ); |
| 128 | + $wgOut->addWikiText( $text ); |
| 129 | + $wgOut->addHtml( '</div>' ); |
| 130 | + } |
| 131 | + } |
| 132 | + } |
| 133 | + |
| 134 | + /** |
| 135 | + * Generates the subheading with links |
| 136 | + * @param Title $nt Title object for the target |
| 137 | + * @param integer $id User ID for the target |
| 138 | + * @return String: appropriately-escaped HTML to be output literally |
| 139 | + */ |
| 140 | + protected function contributionsSub( $nt, $id ) { |
| 141 | + global $wgSysopUserBans, $wgLang, $wgUser; |
| 142 | + |
| 143 | + $sk = $wgUser->getSkin(); |
| 144 | + |
| 145 | + if ( 0 == $id ) { |
| 146 | + $user = $nt->getText(); |
| 147 | + } else { |
| 148 | + $user = $sk->makeLinkObj( $nt, htmlspecialchars( $nt->getText() ) ); |
| 149 | + } |
| 150 | + $talk = $nt->getTalkPage(); |
| 151 | + if( $talk ) { |
| 152 | + # Talk page link |
| 153 | + $tools[] = $sk->makeLinkObj( $talk, wfMsgHtml( 'talkpagelinktext' ) ); |
| 154 | + if( ( $id != 0 && $wgSysopUserBans ) || ( $id == 0 && IP::isIPAddress( $nt->getText() ) ) ) { |
| 155 | + # Block link |
| 156 | + if( $wgUser->isAllowed( 'block' ) ) |
| 157 | + $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Blockip', |
| 158 | + $nt->getDBkey() ), wfMsgHtml( 'blocklink' ) ); |
| 159 | + # Block log link |
| 160 | + $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), |
| 161 | + wfMsgHtml( 'sp-contributions-blocklog' ), 'type=block&page=' . $nt->getPrefixedUrl() ); |
| 162 | + } |
| 163 | + # Other logs link |
| 164 | + $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), wfMsgHtml( 'log' ), |
| 165 | + 'user=' . $nt->getPartialUrl() ); |
| 166 | + |
| 167 | + # Add link to deleted user contributions for priviledged users |
| 168 | + if( $wgUser->isAllowed( 'deletedhistory' ) ) { |
| 169 | + $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'DeletedContributions', |
| 170 | + $nt->getDBkey() ), wfMsgHtml( 'deletedcontributions' ) ); |
| 171 | + } |
| 172 | + |
| 173 | + wfRunHooks( 'ContributionsToolLinks', array( $id, $nt, &$tools ) ); |
| 174 | + |
| 175 | + $links = implode( ' | ', $tools ); |
| 176 | + } |
| 177 | + |
| 178 | + // Old message 'contribsub' had one parameter, but that doesn't work for |
| 179 | + // languages that want to put the "for" bit right after $user but before |
| 180 | + // $links. If 'contribsub' is around, use it for reverse compatibility, |
| 181 | + // otherwise use 'contribsub2'. |
| 182 | + if( wfEmptyMsg( 'contribsub', wfMsg( 'contribsub' ) ) ) { |
| 183 | + return wfMsgHtml( 'contribsub2', $user, $links ); |
| 184 | + } else { |
| 185 | + return wfMsgHtml( 'contribsub', "$user ($links)" ); |
| 186 | + } |
| 187 | + } |
| 188 | + |
| 189 | + /** |
| 190 | + * Generates the namespace selector form with hidden attributes. |
| 191 | + * @param $options Array: the options to be included. |
| 192 | + */ |
| 193 | + protected function getForm( $options ) { |
| 194 | + global $wgScript, $wgTitle, $wgRequest; |
| 195 | + |
| 196 | + $options['title'] = $wgTitle->getPrefixedText(); |
| 197 | + if ( !isset( $options['target'] ) ) { |
| 198 | + $options['target'] = ''; |
| 199 | + } else { |
| 200 | + $options['target'] = str_replace( '_' , ' ' , $options['target'] ); |
| 201 | + } |
| 202 | + |
| 203 | + if ( !isset( $options['namespace'] ) ) { |
| 204 | + $options['namespace'] = ''; |
| 205 | + } |
| 206 | + |
| 207 | + if ( !isset( $options['contribs'] ) ) { |
| 208 | + $options['contribs'] = 'user'; |
| 209 | + } |
| 210 | + |
| 211 | + if ( !isset( $options['year'] ) ) { |
| 212 | + $options['year'] = ''; |
| 213 | + } |
| 214 | + |
| 215 | + if ( !isset( $options['month'] ) ) { |
| 216 | + $options['month'] = ''; |
| 217 | + } |
| 218 | + |
| 219 | + if ( $options['contribs'] == 'newbie' ) { |
| 220 | + $options['target'] = ''; |
| 221 | + } |
| 222 | + |
| 223 | + $f = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); |
| 224 | + |
| 225 | + foreach ( $options as $name => $value ) { |
| 226 | + if ( in_array( $name, array( 'namespace', 'target', 'contribs', 'year', 'month' ) ) ) { |
| 227 | + continue; |
| 228 | + } |
| 229 | + $f .= "\t" . Xml::hidden( $name, $value ) . "\n"; |
| 230 | + } |
| 231 | + |
| 232 | + $f .= '<fieldset>' . |
| 233 | + Xml::element( 'legend', array(), wfMsg( 'sp-contributions-search' ) ) . |
| 234 | + Xml::radioLabel( wfMsgExt( 'sp-contributions-newbies', array( 'parseinline' ) ), |
| 235 | + 'contribs', 'newbie' , 'newbie', $options['contribs'] == 'newbie' ? true : false ) . '<br />' . |
| 236 | + Xml::radioLabel( wfMsgExt( 'sp-contributions-username', array( 'parseinline' ) ), |
| 237 | + 'contribs' , 'user', 'user', $options['contribs'] == 'user' ? true : false ) . ' ' . |
| 238 | + Xml::input( 'target', 20, $options['target']) . ' '. |
| 239 | + '<span style="white-space: nowrap">' . |
| 240 | + Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' ' . |
| 241 | + Xml::namespaceSelector( $options['namespace'], '' ) . |
| 242 | + '</span>' . |
| 243 | + Xml::openElement( 'p' ) . |
| 244 | + '<span style="white-space: nowrap">' . |
| 245 | + Xml::label( wfMsg( 'year' ), 'year' ) . ' '. |
| 246 | + Xml::input( 'year', 4, $options['year'], array('id' => 'year', 'maxlength' => 4) ) . |
| 247 | + '</span>' . |
| 248 | + ' '. |
| 249 | + '<span style="white-space: nowrap">' . |
| 250 | + Xml::label( wfMsg( 'month' ), 'month' ) . ' '. |
| 251 | + Xml::monthSelector( $options['month'], -1 ) . ' '. |
| 252 | + '</span>' . |
| 253 | + Xml::submitButton( wfMsg( 'sp-contributions-submit' ) ) . |
| 254 | + Xml::closeElement( 'p' ); |
| 255 | + |
| 256 | + $explain = wfMsgExt( 'sp-contributions-explain', 'parseinline' ); |
| 257 | + if( !wfEmptyMsg( 'sp-contributions-explain', $explain ) ) |
| 258 | + $f .= "<p>{$explain}</p>"; |
| 259 | + |
| 260 | + $f .= '</fieldset>' . |
| 261 | + Xml::closeElement( 'form' ); |
| 262 | + return $f; |
| 263 | + } |
| 264 | +} |
| 265 | + |
9 | 266 | /** |
10 | 267 | * Pager for Special:Contributions |
11 | 268 | * @ingroup SpecialPage Pager |
— | — | @@ -181,253 +438,3 @@ |
182 | 439 | } |
183 | 440 | |
184 | 441 | } |
185 | | - |
186 | | -/** |
187 | | - * Special page "user contributions". |
188 | | - * Shows a list of the contributions of a user. |
189 | | - * |
190 | | - * @return none |
191 | | - * @param $par String: (optional) user name of the user for which to show the contributions |
192 | | - */ |
193 | | -function wfSpecialContributions( $par = null ) { |
194 | | - global $wgUser, $wgOut, $wgLang, $wgRequest; |
195 | | - |
196 | | - $options = array(); |
197 | | - |
198 | | - if ( isset( $par ) && $par == 'newbies' ) { |
199 | | - $target = 'newbies'; |
200 | | - $options['contribs'] = 'newbie'; |
201 | | - } elseif ( isset( $par ) ) { |
202 | | - $target = $par; |
203 | | - } else { |
204 | | - $target = $wgRequest->getVal( 'target' ); |
205 | | - } |
206 | | - |
207 | | - // check for radiobox |
208 | | - if ( $wgRequest->getVal( 'contribs' ) == 'newbie' ) { |
209 | | - $target = 'newbies'; |
210 | | - $options['contribs'] = 'newbie'; |
211 | | - } |
212 | | - |
213 | | - if ( !strlen( $target ) ) { |
214 | | - $wgOut->addHTML( contributionsForm( '' ) ); |
215 | | - return; |
216 | | - } |
217 | | - |
218 | | - $options['limit'] = $wgRequest->getInt( 'limit', 50 ); |
219 | | - $options['target'] = $target; |
220 | | - |
221 | | - $nt = Title::makeTitleSafe( NS_USER, $target ); |
222 | | - if ( !$nt ) { |
223 | | - $wgOut->addHTML( contributionsForm( '' ) ); |
224 | | - return; |
225 | | - } |
226 | | - $id = User::idFromName( $nt->getText() ); |
227 | | - |
228 | | - if ( $target != 'newbies' ) { |
229 | | - $target = $nt->getText(); |
230 | | - $wgOut->setSubtitle( contributionsSub( $nt, $id ) ); |
231 | | - $wgOut->setHTMLTitle( wfMsg( 'pagetitle', wfMsg( 'contributions-title', $target ) ) ); |
232 | | - } else { |
233 | | - $wgOut->setSubtitle( wfMsgHtml( 'sp-contributions-newbies-sub') ); |
234 | | - $wgOut->setHTMLTitle( wfMsg( 'pagetitle', wfMsg( 'sp-contributions-newbies-title' ) ) ); |
235 | | - } |
236 | | - |
237 | | - if ( ( $ns = $wgRequest->getVal( 'namespace', null ) ) !== null && $ns !== '' ) { |
238 | | - $options['namespace'] = intval( $ns ); |
239 | | - } else { |
240 | | - $options['namespace'] = ''; |
241 | | - } |
242 | | - |
243 | | - // Allows reverts to have the bot flag in recent changes. It is just here to |
244 | | - // be passed in the form at the top of the page |
245 | | - if ( $wgUser->isAllowed( 'markbotedits' ) && $wgRequest->getBool( 'bot' ) ) { |
246 | | - $options['bot'] = '1'; |
247 | | - } |
248 | | - |
249 | | - $skip = $wgRequest->getText( 'offset' ) || $wgRequest->getText( 'dir' ) == 'prev'; |
250 | | - # Offset overrides year/month selection |
251 | | - if ( ( $month = $wgRequest->getIntOrNull( 'month' ) ) !== null && $month !== -1 ) { |
252 | | - $options['month'] = intval( $month ); |
253 | | - } else { |
254 | | - $options['month'] = ''; |
255 | | - } |
256 | | - if ( ( $year = $wgRequest->getIntOrNull( 'year' ) ) !== null ) { |
257 | | - $options['year'] = intval( $year ); |
258 | | - } else if( $options['month'] ) { |
259 | | - $thisMonth = intval( gmdate( 'n' ) ); |
260 | | - $thisYear = intval( gmdate( 'Y' ) ); |
261 | | - if( intval( $options['month'] ) > $thisMonth ) { |
262 | | - $thisYear--; |
263 | | - } |
264 | | - $options['year'] = $thisYear; |
265 | | - } else { |
266 | | - $options['year'] = ''; |
267 | | - } |
268 | | - |
269 | | - wfRunHooks( 'SpecialContributionsBeforeMainOutput', $id ); |
270 | | - |
271 | | - if( $skip ) { |
272 | | - $options['year'] = ''; |
273 | | - $options['month'] = ''; |
274 | | - } |
275 | | - |
276 | | - $wgOut->addHTML( contributionsForm( $options ) ); |
277 | | - |
278 | | - $pager = new ContribsPager( $target, $options['namespace'], $options['year'], $options['month'] ); |
279 | | - if ( !$pager->getNumRows() ) { |
280 | | - $wgOut->addWikiMsg( 'nocontribs' ); |
281 | | - return; |
282 | | - } |
283 | | - |
284 | | - # Show a message about slave lag, if applicable |
285 | | - if( ( $lag = $pager->getDatabase()->getLag() ) > 0 ) |
286 | | - $wgOut->showLagWarning( $lag ); |
287 | | - |
288 | | - $wgOut->addHTML( |
289 | | - '<p>' . $pager->getNavigationBar() . '</p>' . |
290 | | - $pager->getBody() . |
291 | | - '<p>' . $pager->getNavigationBar() . '</p>' ); |
292 | | - |
293 | | - # If there were contributions, and it was a valid user or IP, show |
294 | | - # the appropriate "footer" message - WHOIS tools, etc. |
295 | | - if( $target != 'newbies' ) { |
296 | | - $message = IP::isIPAddress( $target ) |
297 | | - ? 'sp-contributions-footer-anon' |
298 | | - : 'sp-contributions-footer'; |
299 | | - |
300 | | - |
301 | | - $text = wfMsgNoTrans( $message, $target ); |
302 | | - if( !wfEmptyMsg( $message, $text ) && $text != '-' ) { |
303 | | - $wgOut->addHtml( '<div class="mw-contributions-footer">' ); |
304 | | - $wgOut->addWikiText( $text ); |
305 | | - $wgOut->addHtml( '</div>' ); |
306 | | - } |
307 | | - } |
308 | | -} |
309 | | - |
310 | | -/** |
311 | | - * Generates the subheading with links |
312 | | - * @param Title $nt Title object for the target |
313 | | - * @param integer $id User ID for the target |
314 | | - * @return String: appropriately-escaped HTML to be output literally |
315 | | - */ |
316 | | -function contributionsSub( $nt, $id ) { |
317 | | - global $wgSysopUserBans, $wgLang, $wgUser; |
318 | | - |
319 | | - $sk = $wgUser->getSkin(); |
320 | | - |
321 | | - if ( 0 == $id ) { |
322 | | - $user = $nt->getText(); |
323 | | - } else { |
324 | | - $user = $sk->makeLinkObj( $nt, htmlspecialchars( $nt->getText() ) ); |
325 | | - } |
326 | | - $talk = $nt->getTalkPage(); |
327 | | - if( $talk ) { |
328 | | - # Talk page link |
329 | | - $tools[] = $sk->makeLinkObj( $talk, wfMsgHtml( 'talkpagelinktext' ) ); |
330 | | - if( ( $id != 0 && $wgSysopUserBans ) || ( $id == 0 && IP::isIPAddress( $nt->getText() ) ) ) { |
331 | | - # Block link |
332 | | - if( $wgUser->isAllowed( 'block' ) ) |
333 | | - $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Blockip', $nt->getDBkey() ), wfMsgHtml( 'blocklink' ) ); |
334 | | - # Block log link |
335 | | - $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), |
336 | | - wfMsgHtml( 'sp-contributions-blocklog' ), 'type=block&page=' . $nt->getPrefixedUrl() ); |
337 | | - } |
338 | | - # Other logs link |
339 | | - $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), wfMsgHtml( 'log' ), 'user=' . $nt->getPartialUrl() ); |
340 | | - |
341 | | - # Add link to deleted user contributions for priviledged users |
342 | | - if( $wgUser->isAllowed( 'deletedhistory' ) ) { |
343 | | - $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'DeletedContributions', $nt->getDBkey() ), wfMsgHtml( 'deletedcontributions' ) ); |
344 | | - } |
345 | | - |
346 | | - wfRunHooks( 'ContributionsToolLinks', array( $id, $nt, &$tools ) ); |
347 | | - |
348 | | - $links = implode( ' | ', $tools ); |
349 | | - } |
350 | | - |
351 | | - // Old message 'contribsub' had one parameter, but that doesn't work for |
352 | | - // languages that want to put the "for" bit right after $user but before |
353 | | - // $links. If 'contribsub' is around, use it for reverse compatibility, |
354 | | - // otherwise use 'contribsub2'. |
355 | | - if( wfEmptyMsg( 'contribsub', wfMsg( 'contribsub' ) ) ) { |
356 | | - return wfMsgHtml( 'contribsub2', $user, $links ); |
357 | | - } else { |
358 | | - return wfMsgHtml( 'contribsub', "$user ($links)" ); |
359 | | - } |
360 | | -} |
361 | | - |
362 | | -/** |
363 | | - * Generates the namespace selector form with hidden attributes. |
364 | | - * @param $options Array: the options to be included. |
365 | | - */ |
366 | | -function contributionsForm( $options ) { |
367 | | - global $wgScript, $wgTitle, $wgRequest; |
368 | | - |
369 | | - $options['title'] = $wgTitle->getPrefixedText(); |
370 | | - if ( !isset( $options['target'] ) ) { |
371 | | - $options['target'] = ''; |
372 | | - } else { |
373 | | - $options['target'] = str_replace( '_' , ' ' , $options['target'] ); |
374 | | - } |
375 | | - |
376 | | - if ( !isset( $options['namespace'] ) ) { |
377 | | - $options['namespace'] = ''; |
378 | | - } |
379 | | - |
380 | | - if ( !isset( $options['contribs'] ) ) { |
381 | | - $options['contribs'] = 'user'; |
382 | | - } |
383 | | - |
384 | | - if ( !isset( $options['year'] ) ) { |
385 | | - $options['year'] = ''; |
386 | | - } |
387 | | - |
388 | | - if ( !isset( $options['month'] ) ) { |
389 | | - $options['month'] = ''; |
390 | | - } |
391 | | - |
392 | | - if ( $options['contribs'] == 'newbie' ) { |
393 | | - $options['target'] = ''; |
394 | | - } |
395 | | - |
396 | | - $f = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); |
397 | | - |
398 | | - foreach ( $options as $name => $value ) { |
399 | | - if ( in_array( $name, array( 'namespace', 'target', 'contribs', 'year', 'month' ) ) ) { |
400 | | - continue; |
401 | | - } |
402 | | - $f .= "\t" . Xml::hidden( $name, $value ) . "\n"; |
403 | | - } |
404 | | - |
405 | | - $f .= '<fieldset>' . |
406 | | - Xml::element( 'legend', array(), wfMsg( 'sp-contributions-search' ) ) . |
407 | | - Xml::radioLabel( wfMsgExt( 'sp-contributions-newbies', array( 'parseinline' ) ), 'contribs' , 'newbie' , 'newbie', $options['contribs'] == 'newbie' ? true : false ) . '<br />' . |
408 | | - Xml::radioLabel( wfMsgExt( 'sp-contributions-username', array( 'parseinline' ) ), 'contribs' , 'user', 'user', $options['contribs'] == 'user' ? true : false ) . ' ' . |
409 | | - Xml::input( 'target', 20, $options['target']) . ' '. |
410 | | - '<span style="white-space: nowrap">' . |
411 | | - Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' ' . |
412 | | - Xml::namespaceSelector( $options['namespace'], '' ) . |
413 | | - '</span>' . |
414 | | - Xml::openElement( 'p' ) . |
415 | | - '<span style="white-space: nowrap">' . |
416 | | - Xml::label( wfMsg( 'year' ), 'year' ) . ' '. |
417 | | - Xml::input( 'year', 4, $options['year'], array('id' => 'year', 'maxlength' => 4) ) . |
418 | | - '</span>' . |
419 | | - ' '. |
420 | | - '<span style="white-space: nowrap">' . |
421 | | - Xml::label( wfMsg( 'month' ), 'month' ) . ' '. |
422 | | - Xml::monthSelector( $options['month'], -1 ) . ' '. |
423 | | - '</span>' . |
424 | | - Xml::submitButton( wfMsg( 'sp-contributions-submit' ) ) . |
425 | | - Xml::closeElement( 'p' ); |
426 | | - |
427 | | - $explain = wfMsgExt( 'sp-contributions-explain', 'parseinline' ); |
428 | | - if( !wfEmptyMsg( 'sp-contributions-explain', $explain ) ) |
429 | | - $f .= "<p>{$explain}</p>"; |
430 | | - |
431 | | - $f .= '</fieldset>' . |
432 | | - Xml::closeElement( 'form' ); |
433 | | - return $f; |
434 | | -} |
Index: trunk/phase3/includes/SpecialPage.php |
— | — | @@ -127,7 +127,7 @@ |
128 | 128 | 'Prefixindex' => 'SpecialPrefixindex', |
129 | 129 | 'Ipblocklist' => array( 'SpecialPage', 'Ipblocklist' ), |
130 | 130 | 'Specialpages' => array( 'UnlistedSpecialPage', 'Specialpages' ), |
131 | | - 'Contributions' => array( 'SpecialPage', 'Contributions' ), |
| 131 | + 'Contributions' => 'SpecialContributions', |
132 | 132 | 'Emailuser' => array( 'UnlistedSpecialPage', 'Emailuser' ), |
133 | 133 | 'Whatlinkshere' => array( 'SpecialPage', 'Whatlinkshere' ), |
134 | 134 | 'LinkSearch' => array( 'SpecialPage', 'LinkSearch' ), |