r49528 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49527‎ | r49528 | r49529 >
Date:21:07, 15 April 2009
Author:catrope
Status:deferred
Tags:
Comment:
querypage-work: Followup to last revision: merge latest changes to includes/specials/ from trunk
Modified paths:
  • /branches/querypage-work/phase3/includes/specials (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialAllmessages.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialAllpages.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialBlockip.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialContributions.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialDeletedContributions.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialFilepath.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialImport.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialIpblocklist.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialListUserRestrictions.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialListusers.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialMIMEsearch.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialPreferences.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialRecentchanges.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialRecentchangeslinked.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialRemoveRestrictions.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialRestrictUser.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialRevisiondelete.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialSearch.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialSpecialpages.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialUndelete.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialWantedcategories.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialWantedfiles.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialWantedpages.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialWantedtemplates.php (modified) (history)
  • /branches/querypage-work/phase3/includes/specials/SpecialWhatlinkshere.php (modified) (history)

Diff [purge]

Index: branches/querypage-work/phase3/includes/specials/SpecialWantedcategories.php
@@ -13,20 +13,12 @@
1414 * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason
1515 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1616 */
17 -class WantedCategoriesPage extends QueryPage {
 17+class WantedCategoriesPage extends WantedQueryPage {
1818
1919 function getName() {
2020 return 'Wantedcategories';
2121 }
2222
23 - function isExpensive() {
24 - return true;
25 - }
26 -
27 - function isSyndicated() {
28 - return false;
29 - }
30 -
3123 function getSQL() {
3224 $dbr = wfGetDB( DB_SLAVE );
3325 list( $categorylinks, $page ) = $dbr->tableNamesN( 'categorylinks', 'page' );
@@ -45,23 +37,6 @@
4638 ";
4739 }
4840
49 - function sortDescending() { return true; }
50 -
51 - /**
52 - * Fetch user page links and cache their existence
53 - */
54 - function preprocessResults( $db, $res ) {
55 - $batch = new LinkBatch;
56 - while ( $row = $db->fetchObject( $res ) )
57 - $batch->add( $row->namespace, $row->title );
58 - $batch->execute();
59 -
60 - // Back to start for display
61 - if ( $db->numRows( $res ) > 0 )
62 - // If there are no rows we get an error seeking.
63 - $db->dataSeek( $res, 0 );
64 - }
65 -
6641 function formatResult( $skin, $result ) {
6742 global $wgLang, $wgContLang;
6843
Index: branches/querypage-work/phase3/includes/specials/SpecialDeletedContributions.php
@@ -333,9 +333,9 @@
334334 * @param $options Array: the options to be included.
335335 */
336336 function getForm( $options ) {
337 - global $wgScript, $wgTitle, $wgRequest;
 337+ global $wgScript, $wgRequest;
338338
339 - $options['title'] = $wgTitle->getPrefixedText();
 339+ $options['title'] = SpecialPage::getTitleFor( 'DeletedContributions' )->getPrefixedText();
340340 if ( !isset( $options['target'] ) ) {
341341 $options['target'] = '';
342342 } else {
Index: branches/querypage-work/phase3/includes/specials/SpecialRemoveRestrictions.php
@@ -1,9 +1,9 @@
22 <?php
33
44 function wfSpecialRemoveRestrictions() {
5 - global $wgOut, $wgRequest, $wgUser, $wgLang, $wgTitle;
 5+ global $wgOut, $wgRequest, $wgUser, $wgLang;
66 $sk = $wgUser->getSkin();
7 -
 7+ $title = SpecialPage::getTitleFor( 'RemoveRestrictions' );
88 $id = $wgRequest->getVal( 'id' );
99 if( !is_numeric( $id ) ) {
1010 $wgOut->addWikiMsg( 'removerestrictions-noid' );
@@ -36,11 +36,11 @@
3737 if( $result )
3838 $wgOut->addHTML( '<strong class="success">' . wfMsgExt( 'removerestrictions-success',
3939 'parseinline', $r->getSubjectText() ) . '</strong>' );
40 - $wgOut->addHTML( Xml::openElement( 'form', array( 'action' => $wgTitle->getLocalUrl( array( 'id' => $id ) ),
 40+ $wgOut->addHTML( Xml::openElement( 'form', array( 'action' => $title->getLocalUrl( array( 'id' => $id ) ),
4141 'method' => 'post' ) ) );
4242 $wgOut->addHTML( Xml::buildForm( $form, 'removerestrictions-submit' ) );
4343 $wgOut->addHTML( Xml::hidden( 'id', $r->getId() ) );
44 - $wgOut->addHTML( Xml::hidden( 'title', $wgTitle->getPrefixedDbKey() ) );
 44+ $wgOut->addHTML( Xml::hidden( 'title', $title->getPrefixedDbKey() ) );
4545 $wgOut->addHTML( Xml::hidden( 'edittoken', $wgUser->editToken() ) );
4646 $wgOut->addHTML( "</form></fieldset>" );
4747 }
Index: branches/querypage-work/phase3/includes/specials/SpecialRevisiondelete.php
@@ -29,11 +29,16 @@
3030 $this->target = $wgRequest->getText( 'target' );
3131 # Handle our many different possible input types.
3232 # Use CVS, since the cgi handling will break on arrays.
33 - $this->oldids = array_filter( explode( ',', $wgRequest->getVal('oldid') ) );
34 - $this->artimestamps = array_filter( explode( ',', $wgRequest->getVal('artimestamp') ) );
35 - $this->logids = array_filter( explode( ',', $wgRequest->getVal('logid') ) );
36 - $this->oldimgs = array_filter( explode( ',', $wgRequest->getVal('oldimage') ) );
37 - $this->fileids = array_filter( explode( ',', $wgRequest->getVal('fileid') ) );
 33+ $this->oldids = explode( ',', $wgRequest->getVal('oldid') );
 34+ $this->oldids = array_unique( array_filter($this->oldids) );
 35+ $this->artimestamps = explode( ',', $wgRequest->getVal('artimestamp') );
 36+ $this->artimestamps = array_unique( array_filter($this->artimestamps) );
 37+ $this->logids = explode( ',', $wgRequest->getVal('logid') );
 38+ $this->logids = array_unique( array_filter($this->logids) );
 39+ $this->oldimgs = explode( ',', $wgRequest->getVal('oldimage') );
 40+ $this->oldimgs = array_unique( array_filter($this->oldimgs) );
 41+ $this->fileids = explode( ',', $wgRequest->getVal('fileid') );
 42+ $this->fileids = array_unique( array_filter($this->fileids) );
3843 # For reviewing deleted files...
3944 $this->file = $wgRequest->getVal( 'file' );
4045 # Only one target set at a time please!
@@ -41,14 +46,13 @@
4247 + (bool)$this->artimestamps + (bool)$this->fileids + (bool)$this->oldimgs;
4348 # No targets?
4449 if( $types == 0 ) {
45 - $wgOut->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
46 - return;
 50+ return $wgOut->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
4751 # Too many targets?
4852 } else if( $types > 1 ) {
49 - $wgOut->showErrorPage( 'revdelete-toomanytargets-title', 'revdelete-toomanytargets-text' );
50 - return;
 53+ return $wgOut->showErrorPage( 'revdelete-toomanytargets-title', 'revdelete-toomanytargets-text' );
5154 }
5255 $this->page = Title::newFromUrl( $this->target );
 56+ $this->contextPage = Title::newFromUrl( $wgRequest->getText( 'page' ) );
5357 # If we have revisions, get the title from the first one
5458 # since they should all be from the same page. This allows
5559 # for more flexibility with page moves...
@@ -81,15 +85,16 @@
8286 $this->showImages();
8387 } else if( $this->deleteKey == 'logid' ) {
8488 $this->showLogItems();
 89+ return; // no logs for now
8590 }
86 - $qc = $this->getLogQueryCond();
 91+ list($qc,$lim) = $this->getLogQueryCond();
8792 # Show relevant lines from the deletion log
8893 $wgOut->addHTML( "<h2>" . htmlspecialchars( LogPage::logName( 'delete' ) ) . "</h2>\n" );
89 - LogEventsList::showLogExtract( $wgOut, 'delete', $this->page->getPrefixedText(), '', 25, $qc );
 94+ LogEventsList::showLogExtract( $wgOut, 'delete', $this->page->getPrefixedText(), '', $lim, $qc );
9095 # Show relevant lines from the suppression log
9196 if( $wgUser->isAllowed( 'suppressionlog' ) ) {
9297 $wgOut->addHTML( "<h2>" . htmlspecialchars( LogPage::logName( 'suppress' ) ) . "</h2>\n" );
93 - LogEventsList::showLogExtract( $wgOut, 'suppress', $this->page->getPrefixedText(), '', 25, $qc );
 98+ LogEventsList::showLogExtract( $wgOut, 'suppress', $this->page->getPrefixedText(), '', $lim, $qc );
9499 }
95100 }
96101
@@ -117,7 +122,8 @@
118123
119124 private function getLogQueryCond() {
120125 $ids = $safeIds = array();
121 - $action = 'revision';
 126+ $limit = 25; // default
 127+ $conds = array( 'log_action' => 'revision' ); // revision delete logs
122128 switch( $this->deleteKey ) {
123129 case 'oldid':
124130 $ids = $this->oldids;
@@ -131,15 +137,12 @@
132138 case 'fileid':
133139 $ids = $this->fileids;
134140 break;
135 - case 'logid':
136 - $ids = $this->logids;
137 - $action = 'event';
138 - break;
 141+ default: // bad type?
 142+ return array($conds,$limit);
139143 }
140 - // Revision delete logs
141 - $conds = array( 'log_action' => $action );
142144 // Just get the whole log if there are a lot if items
143 - if( count($ids) > 20 ) return $conds;
 145+ if( count($ids) > $limit )
 146+ return array($conds,$limit);
144147 // Digit chars only
145148 foreach( $ids as $id ) {
146149 if( preg_match( '/^\d+$/', $id, $m ) ) {
@@ -148,9 +151,11 @@
149152 }
150153 // Format is <id1,id2,i3...>
151154 if( count($safeIds) ) {
152 - $conds[] = "log_params RLIKE '(^|\n|,)(".implode('|',$safeIds).")(,|$)'";
 155+ $conds[] = "log_params RLIKE '^{$this->deleteKey}.*(^|\n|,)(".implode('|',$safeIds).")(,|\n|$)'";
 156+ } else {
 157+ $conds = array('1=0');
153158 }
154 - return $conds;
 159+ return array($conds,$limit);
155160 }
156161
157162 private function secureOperation() {
@@ -243,21 +248,20 @@
244249 $result = $dbr->select( array('revision','page'), '*',
245250 array(
246251 'rev_page' => $this->page->getArticleID(),
247 - 'rev_id' => $where,
248 - 'rev_page = page_id' ),
249 - __METHOD__ );
 252+ 'rev_id' => $where,
 253+ 'rev_page = page_id'
 254+ ),
 255+ __METHOD__
 256+ );
250257 while( $row = $dbr->fetchObject( $result ) ) {
251258 $revObjs[$row->rev_id] = new Revision( $row );
252259 }
253260 foreach( $this->revisions as $revid ) {
254 - // Hiding top revisison is bad
255 - if( !isset($revObjs[$revid]) || $revObjs[$revid]->isCurrent() ) {
256 - continue;
257 - } else if( !$revObjs[$revid]->userCan(Revision::DELETED_RESTRICTED) ) {
258 - // If a rev is hidden from sysops
 261+ if( !isset($revObjs[$revid]) ) continue; // Must exist
 262+ // Check if the revision was Oversighted
 263+ if( !$revObjs[$revid]->userCan(Revision::DELETED_RESTRICTED) ) {
259264 if( !$this->wasPosted ) {
260 - $wgOut->permissionRequired( 'suppressrevision' );
261 - return;
 265+ return $wgOut->permissionRequired( 'suppressrevision' );
262266 }
263267 $UserAllowed = false;
264268 }
@@ -274,9 +278,11 @@
275279 $result = $dbr->select( 'archive', '*',
276280 array(
277281 'ar_namespace' => $this->page->getNamespace(),
278 - 'ar_title' => $this->page->getDBKey(),
279 - 'ar_timestamp' => $where ),
280 - __METHOD__ );
 282+ 'ar_title' => $this->page->getDBKey(),
 283+ 'ar_timestamp' => $where
 284+ ),
 285+ __METHOD__
 286+ );
281287 while( $row = $dbr->fetchObject( $result ) ) {
282288 $timestamp = wfTimestamp( TS_MW, $row->ar_timestamp );
283289 $revObjs[$timestamp] = new Revision( array(
@@ -298,8 +304,7 @@
299305 } else if( !$revObjs[$timestamp]->userCan(Revision::DELETED_RESTRICTED) ) {
300306 // If a rev is hidden from sysops
301307 if( !$this->wasPosted ) {
302 - $wgOut->permissionRequired( 'suppressrevision' );
303 - return;
 308+ return $wgOut->permissionRequired( 'suppressrevision' );
304309 }
305310 $UserAllowed = false;
306311 }
@@ -309,8 +314,7 @@
310315 }
311316 }
312317 if( !$revisions ) {
313 - $wgOut->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
314 - return;
 318+ return $wgOut->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
315319 }
316320
317321 $wgOut->addHTML( "</ul>" );
@@ -334,10 +338,9 @@
335339 } else {
336340 $hidden[] = Xml::hidden( 'artimestamp', implode(',',$this->artimestamps) );
337341 }
338 - $special = SpecialPage::getTitleFor( 'Revisiondelete' );
339342 $wgOut->addHTML(
340343 Xml::openElement( 'form', array( 'method' => 'post',
341 - 'action' => $special->getLocalUrl( 'action=submit' ),
 344+ 'action' => $this->getTitle()->getLocalUrl( 'action=submit' ),
342345 'id' => 'mw-revdel-form-revisions' ) ) .
343346 Xml::openElement( 'fieldset' ) .
344347 xml::element( 'legend', null, wfMsg( 'revdelete-legend' ) )
@@ -381,9 +384,11 @@
382385 }
383386 $result = $dbr->select( 'oldimage', '*',
384387 array(
385 - 'oi_name' => $this->page->getDBKey(),
386 - 'oi_archive_name' => $where ),
387 - __METHOD__ );
 388+ 'oi_name' => $this->page->getDBKey(),
 389+ 'oi_archive_name' => $where
 390+ ),
 391+ __METHOD__
 392+ );
388393 while( $row = $dbr->fetchObject( $result ) ) {
389394 $filesObjs[$row->oi_archive_name] = RepoGroup::singleton()->getLocalRepo()->newFileFromRow( $row );
390395 $filesObjs[$row->oi_archive_name]->user = $row->oi_user;
@@ -397,8 +402,7 @@
398403 } else if( !$filesObjs[$archivename]->userCan(File::DELETED_RESTRICTED) ) {
399404 // If a rev is hidden from sysops
400405 if( !$this->wasPosted ) {
401 - $wgOut->permissionRequired( 'suppressrevision' );
402 - return;
 406+ return $wgOut->permissionRequired( 'suppressrevision' );
403407 }
404408 $UserAllowed = false;
405409 }
@@ -416,8 +420,10 @@
417421 $result = $dbr->select( 'filearchive', '*',
418422 array(
419423 'fa_name' => $this->page->getDBKey(),
420 - 'fa_id' => $where ),
421 - __METHOD__ );
 424+ 'fa_id' => $where
 425+ ),
 426+ __METHOD__
 427+ );
422428 while( $row = $dbr->fetchObject( $result ) ) {
423429 $filesObjs[$row->fa_id] = ArchivedFile::newFromRow( $row );
424430 }
@@ -428,8 +434,7 @@
429435 } else if( !$filesObjs[$fileid]->userCan(File::DELETED_RESTRICTED) ) {
430436 // If a rev is hidden from sysops
431437 if( !$this->wasPosted ) {
432 - $wgOut->permissionRequired( 'suppressrevision' );
433 - return;
 438+ return $wgOut->permissionRequired( 'suppressrevision' );
434439 }
435440 $UserAllowed = false;
436441 }
@@ -440,8 +445,7 @@
441446 }
442447 }
443448 if( !$revisions ) {
444 - $wgOut->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
445 - return;
 449+ return $wgOut->showErrorPage( 'revdelete-nooldid-title','revdelete-nooldid-text' );
446450 }
447451
448452 $wgOut->addHTML( "</ul>" );
@@ -464,10 +468,9 @@
465469 } else {
466470 $hidden[] = Xml::hidden( 'fileid', implode(',',$this->fileids) );
467471 }
468 - $special = SpecialPage::getTitleFor( 'Revisiondelete' );
469472 $wgOut->addHTML(
470473 Xml::openElement( 'form', array( 'method' => 'post',
471 - 'action' => $special->getLocalUrl( 'action=submit' ),
 474+ 'action' => $this->getTitle()->getLocalUrl( 'action=submit' ),
472475 'id' => 'mw-revdel-form-filerevisions' )
473476 ) .
474477 Xml::fieldset( wfMsg( 'revdelete-legend' ) )
@@ -508,10 +511,9 @@
509512 }
510513 list($log,$logtype) = explode( '/',$this->page->getDBKey(), 2 );
511514 $result = $dbr->select( 'logging', '*',
512 - array(
513 - 'log_type' => $logtype,
514 - 'log_id' => $where ),
515 - __METHOD__ );
 515+ array( 'log_type' => $logtype, 'log_id' => $where ),
 516+ __METHOD__
 517+ );
516518 while( $row = $dbr->fetchObject( $result ) ) {
517519 $logRows[$row->log_id] = $row;
518520 }
@@ -523,8 +525,7 @@
524526 } else if( !LogEventsList::userCan( $logRows[$logid],Revision::DELETED_RESTRICTED) ) {
525527 // If an event is hidden from sysops
526528 if( !$this->wasPosted ) {
527 - $wgOut->permissionRequired( 'suppressrevision' );
528 - return;
 529+ return $wgOut->permissionRequired( 'suppressrevision' );
529530 }
530531 $UserAllowed = false;
531532 }
@@ -533,8 +534,7 @@
534535 $bitfields |= $logRows[$logid]->log_deleted;
535536 }
536537 if( !$logItems ) {
537 - $wgOut->showErrorPage( 'revdelete-nologid-title', 'revdelete-nologid-text' );
538 - return;
 538+ return $wgOut->showErrorPage( 'revdelete-nologid-title', 'revdelete-nologid-text' );
539539 }
540540
541541 $wgOut->addHTML( "</ul>" );
@@ -548,15 +548,15 @@
549549 Xml::submitButton( wfMsg( 'revdelete-submit' ) ) );
550550 $hidden = array(
551551 Xml::hidden( 'wpEditToken', $wgUser->editToken() ),
552 - Xml::hidden( 'target', $this->page->getPrefixedText() ),
 552+ Xml::hidden( 'target', $this->page->getPrefixedDBKey() ),
 553+ Xml::hidden( 'page', $this->contextPage ? $this->contextPage->getPrefixedDBKey() : '' ),
553554 Xml::hidden( 'type', $this->deleteKey ),
554555 Xml::hidden( 'logid', implode(',',$this->logids) )
555556 );
556557
557 - $special = SpecialPage::getTitleFor( 'Revisiondelete' );
558558 $wgOut->addHTML(
559559 Xml::openElement( 'form', array( 'method' => 'post',
560 - 'action' => $special->getLocalUrl( 'action=submit' ), 'id' => 'mw-revdel-form-logs' ) ) .
 560+ 'action' => $this->getTitle()->getLocalUrl( 'action=submit' ), 'id' => 'mw-revdel-form-logs' ) ) .
561561 Xml::fieldset( wfMsg( 'revdelete-legend' ) )
562562 );
563563
@@ -643,7 +643,7 @@
644644 * @returns string
645645 */
646646 private function fileLine( $file ) {
647 - global $wgLang, $wgTitle;
 647+ global $wgLang;
648648
649649 $target = $this->page->getPrefixedText();
650650 $date = $wgLang->timeanddate( $file->getTimestamp(), true );
@@ -655,7 +655,7 @@
656656 if( !$file->userCan(File::DELETED_FILE) ) {
657657 $pageLink = $date;
658658 } else {
659 - $pageLink = $this->skin->makeKnownLinkObj( $wgTitle, $date,
 659+ $pageLink = $this->skin->makeKnownLinkObj( $this->getTitle(), $date,
660660 "target=$target&file=$file->sha1.".$file->getExtension() );
661661 }
662662 $pageLink = '<span class="history-deleted">' . $pageLink . '</span>';
@@ -665,9 +665,8 @@
666666 $pageLink = "<a href=\"{$url}\">{$date}</a>";
667667 }
668668
669 - $data = wfMsg( 'widthheight',
670 - $wgLang->formatNum( $file->getWidth() ),
671 - $wgLang->formatNum( $file->getHeight() ) ) .
 669+ $data = wfMsg( 'widthheight', $wgLang->formatNum( $file->getWidth() ),
 670+ $wgLang->formatNum( $file->getHeight() ) ) .
672671 ' (' . wfMsgExt( 'nbytes', 'parsemag', $wgLang->formatNum( $file->getSize() ) ) . ')';
673672 $data = htmlspecialchars( $data );
674673
@@ -694,9 +693,8 @@
695694 $del = ' <tt>' . wfMsgHtml( 'deletedrev' ) . '</tt>';
696695 }
697696
698 - $data = wfMsg( 'widthheight',
699 - $wgLang->formatNum( $file->getWidth() ),
700 - $wgLang->formatNum( $file->getHeight() ) ) .
 697+ $data = wfMsg( 'widthheight', $wgLang->formatNum( $file->getWidth() ),
 698+ $wgLang->formatNum( $file->getHeight() ) ) .
701699 ' (' . wfMsgExt( 'nbytes', 'parsemag', $wgLang->formatNum( $file->getSize() ) ) . ')';
702700 $data = htmlspecialchars( $data );
703701
@@ -794,31 +792,26 @@
795793 $wgOut->permissionRequired( 'suppressrevision' );
796794 return false;
797795 }
798 - # If the save went through, go to success message. Otherwise
799 - # bounce back to form...
 796+ # If the save went through, go to success message...
800797 if( $this->save( $bitfield, $comment, $this->page ) ) {
801798 $this->success();
802 - } else if( $request->getCheck( 'oldid' ) || $request->getCheck( 'artimestamp' ) ) {
803 - return $this->showRevs();
804 - } else if( $request->getCheck( 'logid' ) ) {
805 - return $this->showLogs();
806 - } else if( $request->getCheck( 'oldimage' ) || $request->getCheck( 'fileid' ) ) {
807 - return $this->showImages();
 799+ return true;
 800+ # ...otherwise, bounce back to form...
 801+ } else {
 802+ $this->failure();
808803 }
 804+ return false;
809805 }
810806
811807 private function success() {
812808 global $wgOut;
813 -
814809 $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
815 -
816810 $wrap = '<span class="success">$1</span>';
817 -
818811 if( $this->deleteKey == 'logid' ) {
819812 $wgOut->wrapWikiMsg( $wrap, 'logdelete-success' );
820813 $this->showLogItems();
821814 } else if( $this->deleteKey == 'oldid' || $this->deleteKey == 'artimestamp' ) {
822 - $wgOut->wrapWikiMsg( $wrap, 'revdelete-success' );
 815+ $wgOut->wrapWikiMsg( $wrap, 'revdelete-success' );
823816 $this->showRevs();
824817 } else if( $this->deleteKey == 'fileid' ) {
825818 $wgOut->wrapWikiMsg( $wrap, 'revdelete-success' );
@@ -828,6 +821,24 @@
829822 $this->showImages();
830823 }
831824 }
 825+
 826+ private function failure() {
 827+ global $wgOut;
 828+ $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
 829+ $wrap = '<span class="error">$1</span>';
 830+ if( $this->deleteKey == 'logid' ) {
 831+ $this->showLogItems();
 832+ } else if( $this->deleteKey == 'oldid' || $this->deleteKey == 'artimestamp' ) {
 833+ $wgOut->wrapWikiMsg( $wrap, 'revdelete-failure' );
 834+ $this->showRevs();
 835+ } else if( $this->deleteKey == 'fileid' ) {
 836+ $wgOut->wrapWikiMsg( $wrap, 'revdelete-failure' );
 837+ $this->showImages();
 838+ } else if( $this->deleteKey == 'oldimage' ) {
 839+ $wgOut->wrapWikiMsg( $wrap, 'revdelete-failure' );
 840+ $this->showImages();
 841+ }
 842+ }
832843
833844 /**
834845 * Put together a rev_deleted bitfield from the submitted checkboxes
@@ -864,6 +875,7 @@
865876 } else if( isset($this->events) ) {
866877 return $deleter->setEventVisibility( $title, $this->events, $bitfield, $reason );
867878 }
 879+ return false;
868880 }
869881 }
870882
@@ -892,30 +904,32 @@
893905 foreach( $items as $revid ) {
894906 $where[] = intval($revid);
895907 }
896 - $result = $this->dbw->select( 'revision', '*',
897 - array(
898 - 'rev_page' => $title->getArticleID(),
899 - 'rev_id' => $where ),
900 - __METHOD__ );
 908+ $result = $this->dbw->select( array('revision','page'), '*',
 909+ array( 'rev_page' => $title->getArticleID(),
 910+ 'rev_id' => $where, 'rev_page = page_id' ),
 911+ __METHOD__
 912+ );
901913 while( $row = $this->dbw->fetchObject( $result ) ) {
902914 $revObjs[$row->rev_id] = new Revision( $row );
903915 }
904916 // To work!
905917 foreach( $items as $revid ) {
906 - if( !isset($revObjs[$revid]) || $revObjs[$revid]->isCurrent() ) {
 918+ if( !isset($revObjs[$revid]) ) {
907919 $success = false;
908920 continue; // Must exist
 921+ } else if( $revObjs[$revid]->isCurrent() && ($bitfield & Revision::DELETED_TEXT) ) {
 922+ $success = false;
 923+ continue; // Cannot hide current version text
909924 } else if( !$revObjs[$revid]->userCan(Revision::DELETED_RESTRICTED) ) {
910 - $userAllowedAll=false;
 925+ $userAllowedAll = false;
911926 continue;
912927 }
913928 // For logging, maintain a count of revisions
914929 if( $revObjs[$revid]->mDeleted != $bitfield ) {
915 - $revCount++;
916 - $revIDs[]=$revid;
917 -
 930+ $revIDs[] = $revid;
918931 $this->updateRevision( $revObjs[$revid], $bitfield );
919932 $this->updateRecentChangesEdits( $revObjs[$revid], $bitfield, false );
 933+ $revCount++;
920934 }
921935 }
922936 // Clear caches...
@@ -955,8 +969,9 @@
956970 array(
957971 'ar_namespace' => $title->getNamespace(),
958972 'ar_title' => $title->getDBKey(),
959 - 'ar_timestamp' => $where ),
960 - __METHOD__ );
 973+ 'ar_timestamp' => $where
 974+ ), __METHOD__
 975+ );
961976 while( $row = $this->dbw->fetchObject( $result ) ) {
962977 $timestamp = wfTimestamp( TS_MW, $row->ar_timestamp );
963978 $revObjs[$timestamp] = new Revision( array(
@@ -986,10 +1001,9 @@
9871002 }
9881003 // Which revisions did we change anything about?
9891004 if( $revObjs[$timestamp]->mDeleted != $bitfield ) {
990 - $Id_set[]=$timestamp;
991 - $count++;
992 -
993 - $this->updateArchive( $revObjs[$timestamp], $title, $bitfield );
 1005+ $Id_set[] = $timestamp;
 1006+ $this->updateArchive( $revObjs[$timestamp], $title, $bitfield );
 1007+ $count++;
9941008 }
9951009 }
9961010 // For logging, maintain a count of revisions
@@ -1023,10 +1037,9 @@
10241038 $where[] = $timestamp.'!'.$title->getDBKey();
10251039 }
10261040 $result = $this->dbw->select( 'oldimage', '*',
1027 - array(
1028 - 'oi_name' => $title->getDBKey(),
1029 - 'oi_archive_name' => $where ),
1030 - __METHOD__ );
 1041+ array( 'oi_name' => $title->getDBKey(), 'oi_archive_name' => $where ),
 1042+ __METHOD__
 1043+ );
10311044 while( $row = $this->dbw->fetchObject( $result ) ) {
10321045 $filesObjs[$row->oi_archive_name] = RepoGroup::singleton()->getLocalRepo()->newFileFromRow( $row );
10331046 $filesObjs[$row->oi_archive_name]->user = $row->oi_user;
@@ -1172,10 +1185,9 @@
11731186 }
11741187 list($log,$logtype) = explode( '/',$title->getDBKey(), 2 );
11751188 $result = $this->dbw->select( 'logging', '*',
1176 - array(
1177 - 'log_type' => $logtype,
1178 - 'log_id' => $where ),
1179 - __METHOD__ );
 1189+ array( 'log_type' => $logtype, 'log_id' => $where ),
 1190+ __METHOD__
 1191+ );
11801192 while( $row = $this->dbw->fetchObject( $result ) ) {
11811193 $logRows[$row->log_id] = $row;
11821194 }
@@ -1185,18 +1197,17 @@
11861198 $success = false;
11871199 continue; // Must exist
11881200 } else if( !LogEventsList::userCan($logRows[$logid], LogPage::DELETED_RESTRICTED)
1189 - || $logRows[$logid]->log_type == 'suppress' ) {
1190 - // Don't hide from oversight log!!!
1191 - $userAllowedAll=false;
 1201+ || $logRows[$logid]->log_type == 'suppress' )
 1202+ {
 1203+ $userAllowedAll=false; // Don't hide from oversight log!!!
11921204 continue;
11931205 }
11941206 // Which logs did we change anything about?
11951207 if( $logRows[$logid]->log_deleted != $bitfield ) {
1196 - $log_Ids[]=$logid;
 1208+ $log_Ids[] = $logid;
 1209+ $this->updateLogs( $logRows[$logid], $bitfield );
 1210+ $this->updateRecentChangesLog( $logRows[$logid], $bitfield );
11971211 $count++;
1198 -
1199 - $this->updateLogs( $logRows[$logid], $bitfield );
1200 - $this->updateRecentChangesLog( $logRows[$logid], $bitfield, true );
12011212 }
12021213 }
12031214 // Don't log or touch if nothing changed
@@ -1330,9 +1341,9 @@
13311342 function updateRevision( $rev, $bitfield ) {
13321343 $this->dbw->update( 'revision',
13331344 array( 'rev_deleted' => $bitfield ),
1334 - array( 'rev_id' => $rev->getId(),
1335 - 'rev_page' => $rev->getPage() ),
1336 - __METHOD__ );
 1345+ array( 'rev_id' => $rev->getId(), 'rev_page' => $rev->getPage() ),
 1346+ __METHOD__
 1347+ );
13371348 }
13381349
13391350 /**
@@ -1346,8 +1357,10 @@
13471358 array( 'ar_deleted' => $bitfield ),
13481359 array( 'ar_namespace' => $title->getNamespace(),
13491360 'ar_title' => $title->getDBKey(),
 1361+ // use timestamp for index
13501362 'ar_timestamp' => $this->dbw->timestamp( $rev->getTimestamp() ),
1351 - 'ar_rev_id' => $rev->getId() ),
 1363+ 'ar_rev_id' => $rev->getId()
 1364+ ),
13521365 __METHOD__ );
13531366 }
13541367
@@ -1361,7 +1374,8 @@
13621375 array( 'oi_deleted' => $bitfield ),
13631376 array( 'oi_name' => $file->getName(),
13641377 'oi_timestamp' => $this->dbw->timestamp( $file->getTimestamp() ) ),
1365 - __METHOD__ );
 1378+ __METHOD__
 1379+ );
13661380 }
13671381
13681382 /**
@@ -1373,7 +1387,8 @@
13741388 $this->dbw->update( 'filearchive',
13751389 array( 'fa_deleted' => $bitfield ),
13761390 array( 'fa_id' => $file->getId() ),
1377 - __METHOD__ );
 1391+ __METHOD__
 1392+ );
13781393 }
13791394
13801395 /**
@@ -1385,7 +1400,8 @@
13861401 $this->dbw->update( 'logging',
13871402 array( 'log_deleted' => $bitfield ),
13881403 array( 'log_id' => $row->log_id ),
1389 - __METHOD__ );
 1404+ __METHOD__
 1405+ );
13901406 }
13911407
13921408 /**
@@ -1399,7 +1415,8 @@
14001416 'rc_patrolled' => 1 ),
14011417 array( 'rc_this_oldid' => $rev->getId(),
14021418 'rc_timestamp' => $this->dbw->timestamp( $rev->getTimestamp() ) ),
1403 - __METHOD__ );
 1419+ __METHOD__
 1420+ );
14041421 }
14051422
14061423 /**
@@ -1413,7 +1430,8 @@
14141431 'rc_patrolled' => 1 ),
14151432 array( 'rc_logid' => $row->log_id,
14161433 'rc_timestamp' => $row->log_timestamp ),
1417 - __METHOD__ );
 1434+ __METHOD__
 1435+ );
14181436 }
14191437
14201438 /**
@@ -1440,7 +1458,7 @@
14411459 * @param int $diff The xor of the old and new bitfields.
14421460 * @param array $arr The array to update.
14431461 */
1444 - function checkItem( $desc, $field, $diff, $new, &$arr ) {
 1462+ protected static function checkItem( $desc, $field, $diff, $new, &$arr ) {
14451463 if( $diff & $field ) {
14461464 $arr[ ( $new & $field ) ? 0 : 1 ][] = $desc;
14471465 }
@@ -1458,15 +1476,15 @@
14591477 * @param int $o The old bitfield.
14601478 * @return An array as described above.
14611479 */
1462 - function getChanges( $n, $o ) {
 1480+ protected static function getChanges( $n, $o ) {
14631481 $diff = $n ^ $o;
14641482 $ret = array( 0 => array(), 1 => array(), 2 => array() );
14651483 // Build bitfield changes in language
1466 - $this->checkItem( wfMsgForContent( 'revdelete-content' ),
 1484+ self::checkItem( wfMsgForContent( 'revdelete-content' ),
14671485 Revision::DELETED_TEXT, $diff, $n, $ret );
1468 - $this->checkItem( wfMsgForContent( 'revdelete-summary' ),
 1486+ self::checkItem( wfMsgForContent( 'revdelete-summary' ),
14691487 Revision::DELETED_COMMENT, $diff, $n, $ret );
1470 - $this->checkItem( wfMsgForContent( 'revdelete-uname' ),
 1488+ self::checkItem( wfMsgForContent( 'revdelete-uname' ),
14711489 Revision::DELETED_USER, $diff, $n, $ret );
14721490 // Restriction application to sysops
14731491 if( $diff & Revision::DELETED_RESTRICTED ) {
@@ -1486,34 +1504,25 @@
14871505 * @param int $count The number of effected revisions.
14881506 * @param int $nbitfield The new bitfield for the revision.
14891507 * @param int $obitfield The old bitfield for the revision.
1490 - * @param string $comment The comment associated with the change.
14911508 * @param bool $isForLog
14921509 */
1493 - function getLogMessage( $count, $nbitfield, $obitfield, $comment, $isForLog = false ) {
1494 - global $wgContLang;
1495 -
 1510+ public static function getLogMessage( $count, $nbitfield, $obitfield, $isForLog = false ) {
 1511+ global $wgLang;
14961512 $s = '';
1497 - $changes = $this->getChanges( $nbitfield, $obitfield );
1498 -
 1513+ $changes = self::getChanges( $nbitfield, $obitfield );
14991514 if( count( $changes[0] ) ) {
1500 - $s .= wfMsgForContent ( 'revdelete-hid', implode ( ', ', $changes[0] ) );
 1515+ $s .= wfMsgForContent( 'revdelete-hid', implode( ', ', $changes[0] ) );
15011516 }
15021517 if( count( $changes[1] ) ) {
15031518 if ($s) $s .= '; ';
1504 - $s .= wfMsgForContent ( 'revdelete-unhid', implode ( ', ', $changes[1] ) );
 1519+ $s .= wfMsgForContent( 'revdelete-unhid', implode( ', ', $changes[1] ) );
15051520 }
15061521 if( count( $changes[2] ) ) {
15071522 $s .= $s ? ' (' . $changes[2][0] . ')' : $changes[2][0];
15081523 }
1509 -
15101524 $msg = $isForLog ? 'logdelete-log-message' : 'revdelete-log-message';
1511 - $ret = wfMsgExt ( $msg, array( 'parsemag', 'content' ),
1512 - $s, $wgContLang->formatNum( $count ) );
 1525+ return wfMsgExt( $msg, array( 'parsemag', 'content' ), $s, $wgLang->formatNum($count) );
15131526
1514 - if( $comment ) $ret .= ": $comment";
1515 -
1516 - return $ret;
1517 -
15181527 }
15191528
15201529 /**
@@ -1534,16 +1543,15 @@
15351544 $logtype = ( ($nbitfield | $obitfield) & Revision::DELETED_RESTRICTED ) ?
15361545 'suppress' : 'delete';
15371546 $log = new LogPage( $logtype );
 1547+ $itemCSV = implode(',',$items);
15381548
1539 - $reason = $this->getLogMessage( $count, $nbitfield, $obitfield, $comment, $param == 'logid' );
1540 -
15411549 if( $param == 'logid' ) {
1542 - $params = array( implode( ',', $items) );
1543 - $log->addEntry( 'event', $title, $reason, $params );
 1550+ $params = array( $itemCSV, "ofield={$obitfield}", "nfield={$nbitfield}" );
 1551+ $log->addEntry( 'event', $title, $comment, $params );
15441552 } else {
15451553 // Add params for effected page and ids
1546 - $params = array( $param, implode( ',', $items) );
1547 - $log->addEntry( 'revision', $title, $reason, $params );
 1554+ $params = array( $param, $itemCSV, "ofield={$obitfield}", "nfield={$nbitfield}" );
 1555+ $log->addEntry( 'revision', $title, $comment, $params );
15481556 }
15491557 }
15501558 }
Index: branches/querypage-work/phase3/includes/specials/SpecialListUserRestrictions.php
@@ -23,12 +23,12 @@
2424
2525 class SpecialListUserRestrictionsForm {
2626 public function getHTML() {
27 - global $wgRequest, $wgScript, $wgTitle;
 27+ global $wgRequest, $wgScript;
2828 $action = htmlspecialchars( $wgScript );
2929 $s = '';
3030 $s .= Xml::fieldset( wfMsg( 'listuserrestrictions-legend' ) );
3131 $s .= "<form action=\"{$action}\">";
32 - $s .= Xml::hidden( 'title', $wgTitle->getPrefixedDbKey() );
 32+ $s .= Xml::hidden( 'title', SpecialPage::getTitleFor('ListUserRestrictions')->getPrefixedDbKey() );
3333 $s .= Xml::label( wfMsgHtml( 'listuserrestrictions-type' ), 'type' ) . '&nbsp;' .
3434 self::typeSelector( 'type', $wgRequest->getVal( 'type' ), 'type' );
3535 $s .= '&nbsp;';
Index: branches/querypage-work/phase3/includes/specials/SpecialBlockip.php
@@ -519,12 +519,15 @@
520520 array('ar_user_text' => $userId), __METHOD__ );
521521 # Hide name from logs
522522 $dbw->update( 'logging', array("log_deleted = log_deleted $op $delUser"),
523 - array('log_user' => $userId), __METHOD__ );
 523+ array('log_user' => $userId, "log_type != 'suppress'"), __METHOD__ );
524524 $dbw->update( 'logging', array("log_deleted = log_deleted $op $delAction"),
525 - array('log_namespace' => NS_USER, 'log_title' => $userDbKey), __METHOD__ );
 525+ array('log_namespace' => NS_USER, 'log_title' => $userDbKey,
 526+ "log_type != 'suppress'"), __METHOD__ );
526527 # Hide name from RC
527528 $dbw->update( 'recentchanges', array("rc_deleted = rc_deleted $op $delUser"),
528529 array('rc_user_text' => $name), __METHOD__ );
 530+ $dbw->update( 'recentchanges', array("rc_deleted = rc_deleted $op $delAction"),
 531+ array('rc_namespace' => NS_USER, 'rc_title' => $userDbKey, 'rc_logid > 0'), __METHOD__ );
529532 # Hide name from live images
530533 $dbw->update( 'oldimage', array("oi_deleted = oi_deleted $op $delUser"),
531534 array('oi_user_text' => $name), __METHOD__ );
@@ -597,7 +600,8 @@
598601 $flags[] = 'anononly';
599602 if( $this->BlockCreateAccount )
600603 $flags[] = 'nocreate';
601 - if( !$this->BlockEnableAutoblock )
 604+ if( !$this->BlockEnableAutoblock && !IP::isIPAddress( $this->BlockAddress ) )
 605+ // Same as anononly, this is not displayed when blocking an IP address
602606 $flags[] = 'noautoblock';
603607 if ( $this->BlockEmail )
604608 $flags[] = 'noemail';
Index: branches/querypage-work/phase3/includes/specials/SpecialAllpages.php
@@ -114,8 +114,7 @@
115115 * @param integer $namespace (default NS_MAIN)
116116 */
117117 function showToplevel( $namespace = NS_MAIN, $from = '', $to = '' ) {
118 - global $wgOut, $wgContLang;
119 - $align = $wgContLang->isRtl() ? 'left' : 'right';
 118+ global $wgOut;
120119
121120 # TODO: Either make this *much* faster or cache the title index points
122121 # in the querycache table.
@@ -198,13 +197,13 @@
199198 }
200199
201200 # At this point, $lines should contain an even number of elements.
202 - $out .= "<table class='allpageslist' style='background: inherit;'>";
 201+ $out .= Xml::openElement( 'table', array( 'class' => 'allpageslist' ) );
203202 while( count ( $lines ) > 0 ) {
204203 $inpoint = array_shift( $lines );
205204 $outpoint = array_shift( $lines );
206205 $out .= $this->showline( $inpoint, $outpoint, $namespace );
207206 }
208 - $out .= '</table>';
 207+ $out .= Xml::closeElement( 'table' );
209208 $nsForm = $this->namespaceForm( $namespace, $from, $to );
210209
211210 # Is there more?
@@ -213,11 +212,17 @@
214213 } else {
215214 if( isset($from) || isset($to) ) {
216215 global $wgUser;
217 - $out2 = '<table style="background: inherit;" width="100%" cellpadding="0" cellspacing="0" border="0">';
218 - $out2 .= '<tr valign="top"><td>' . $nsForm;
219 - $out2 .= '</td><td align="' . $align . '" style="font-size: smaller; margin-bottom: 1em;">' .
220 - $wgUser->getSkin()->makeKnownLinkObj( $this->getTitle(), wfMsgHtml ( 'allpages' ) );
221 - $out2 .= "</td></tr></table>";
 216+ $out2 = Xml::openElement( 'table', array( 'class' => 'mw-allpages-table-form' ) ).
 217+ '<tr>
 218+ <td>' .
 219+ $nsForm .
 220+ '</td>
 221+ <td class="mw-allpages-nav">' .
 222+ $wgUser->getSkin()->link( $this->getTitle(), wfMsgHtml ( 'allpages' ),
 223+ array(), array(), 'known' ) .
 224+ "</td>
 225+ </tr>" .
 226+ Xml::closeElement( 'table' );
222227 } else {
223228 $out2 = $nsForm;
224229 }
@@ -233,7 +238,6 @@
234239 */
235240 function showline( $inpoint, $outpoint, $namespace = NS_MAIN ) {
236241 global $wgContLang;
237 - $align = $wgContLang->isRtl() ? 'left' : 'right';
238242 $inpointf = htmlspecialchars( str_replace( '_', ' ', $inpoint ) );
239243 $outpointf = htmlspecialchars( str_replace( '_', ' ', $outpoint ) );
240244 // Don't let the length runaway
@@ -248,7 +252,7 @@
249253 "<a href=\"$link\">$inpointf</a></td><td>",
250254 "</td><td><a href=\"$link\">$outpointf</a>"
251255 );
252 - return '<tr><td align="' . $align . '">'.$out.'</td></tr>';
 256+ return '<tr><td class="mw-allpages-alphaindexline">' . $out . '</td></tr>';
253257 }
254258
255259 /**
@@ -264,8 +268,6 @@
265269 $fromList = $this->getNamespaceKeyAndText($namespace, $from);
266270 $toList = $this->getNamespaceKeyAndText( $namespace, $to );
267271 $namespaces = $wgContLang->getNamespaces();
268 - $align = $wgContLang->isRtl() ? 'left' : 'right';
269 -
270272 $n = 0;
271273
272274 if ( !$fromList || !$toList ) {
@@ -299,8 +301,7 @@
300302 );
301303
302304 if( $res->numRows() > 0 ) {
303 - $out = '<table style="background: inherit;" border="0" width="100%">';
304 -
 305+ $out = Xml::openElement( 'table', array( 'class' => 'mw-allpages-table-chunk' ) );
305306 while( ( $n < $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) {
306307 $t = Title::makeTitle( $s->page_namespace, $s->page_title );
307308 if( $t ) {
@@ -316,13 +317,13 @@
317318 $out .= "<td width=\"33%\">$link</td>";
318319 $n++;
319320 if( $n % 3 == 0 ) {
320 - $out .= '</tr>';
 321+ $out .= "</tr>\n";
321322 }
322323 }
323324 if( ($n % 3) != 0 ) {
324 - $out .= '</tr>';
 325+ $out .= "</tr>\n";
325326 }
326 - $out .= '</table>';
 327+ $out .= Xml::closeElement( 'table' );
327328 } else {
328329 $out = '';
329330 }
@@ -370,11 +371,13 @@
371372 $self = $this->getTitle();
372373
373374 $nsForm = $this->namespaceForm( $namespace, $from, $to );
374 - $out2 = '<table style="background: inherit;" width="100%" cellpadding="0" cellspacing="0" border="0">';
375 - $out2 .= '<tr valign="top"><td>' . $nsForm;
376 - $out2 .= '</td><td align="' . $align . '" style="font-size: smaller; margin-bottom: 1em;">' .
377 - $sk->makeKnownLinkObj( $self,
378 - wfMsgHtml ( 'allpages' ) );
 375+ $out2 = Xml::openElement( 'table', array( 'class' => 'mw-allpages-table-form' ) ).
 376+ '<tr>
 377+ <td>' .
 378+ $nsForm .
 379+ '</td>
 380+ <td class="mw-allpages-nav">' .
 381+ $sk->link( $self, wfMsgHtml ( 'allpages' ), array(), array(), 'known' );
379382
380383 # Do we put a previous link ?
381384 if( isset( $prevTitle ) && $pt = $prevTitle->getText() ) {
@@ -399,7 +402,7 @@
400403
401404 $wgOut->addHTML( $out2 . $out );
402405 if( isset($prevLink) or isset($nextLink) ) {
403 - $wgOut->addHTML( '<hr /><p style="font-size: smaller; float: ' . $align . '">' );
 406+ $wgOut->addHTML( '<hr /><p class="mw-allpages-nav">' );
404407 if( isset( $prevLink ) ) {
405408 $wgOut->addHTML( $prevLink );
406409 }
Index: branches/querypage-work/phase3/includes/specials/SpecialWantedpages.php
@@ -8,7 +8,7 @@
99 * implements Special:Wantedpages
1010 * @ingroup SpecialPage
1111 */
12 -class WantedPagesPage extends QueryPage {
 12+class WantedPagesPage extends WantedQueryPage {
1313 var $nlinks;
1414
1515 function WantedPagesPage( $inc = false, $nlinks = true ) {
@@ -20,11 +20,6 @@
2121 return 'Wantedpages';
2222 }
2323
24 - function isExpensive() {
25 - return true;
26 - }
27 - function isSyndicated() { return false; }
28 -
2924 function getSQL() {
3025 global $wgWantedPagesThreshold;
3126 $count = $wgWantedPagesThreshold - 1;
@@ -49,66 +44,6 @@
5045 wfRunHooks( 'WantedPages::getSQL', array( &$this, &$sql ) );
5146 return $sql;
5247 }
53 -
54 - /**
55 - * Cache page existence for performance
56 - */
57 - function preprocessResults( $db, $res ) {
58 - $batch = new LinkBatch;
59 - while ( $row = $db->fetchObject( $res ) )
60 - $batch->add( $row->namespace, $row->title );
61 - $batch->execute();
62 -
63 - // Back to start for display
64 - if ( $db->numRows( $res ) > 0 )
65 - // If there are no rows we get an error seeking.
66 - $db->dataSeek( $res, 0 );
67 - }
68 -
69 - /**
70 - * Format an individual result
71 - *
72 - * @param $skin Skin to use for UI elements
73 - * @param $result Result row
74 - * @return string
75 - */
76 - public function formatResult( $skin, $result ) {
77 - $title = Title::makeTitleSafe( $result->namespace, $result->title );
78 - if( $title instanceof Title ) {
79 - if( $this->isCached() ) {
80 - $pageLink = $title->exists()
81 - ? '<s>' . $skin->makeLinkObj( $title ) . '</s>'
82 - : $skin->makeBrokenLinkObj( $title );
83 - } else {
84 - $pageLink = $skin->makeBrokenLinkObj( $title );
85 - }
86 - return wfSpecialList( $pageLink, $this->makeWlhLink( $title, $skin, $result ) );
87 - } else {
88 - $tsafe = htmlspecialchars( $result->title );
89 - return wfMsg( 'wantedpages-badtitle', $tsafe );
90 - }
91 - }
92 -
93 - /**
94 - * Make a "what links here" link for a specified result if required
95 - *
96 - * @param $title Title to make the link for
97 - * @param $skin Skin to use
98 - * @param $result Result row
99 - * @return string
100 - */
101 - private function makeWlhLink( $title, $skin, $result ) {
102 - global $wgLang;
103 - if( $this->nlinks ) {
104 - $wlh = SpecialPage::getTitleFor( 'Whatlinkshere' );
105 - $label = wfMsgExt( 'nlinks', array( 'parsemag', 'escape' ),
106 - $wgLang->formatNum( $result->value ) );
107 - return $skin->makeKnownLinkObj( $wlh, $label, 'target=' . $title->getPrefixedUrl() );
108 - } else {
109 - return null;
110 - }
111 - }
112 -
11348 }
11449
11550 /**
Index: branches/querypage-work/phase3/includes/specials/SpecialUndelete.php
@@ -642,7 +642,7 @@
643643 $this->showList( $result );
644644 }
645645 } else {
646 - $wgOut->addWikiText( wfMsgHtml( 'undelete-header' ) );
 646+ $wgOut->addWikiMsg( 'undelete-header' );
647647 }
648648 return;
649649 }
@@ -763,7 +763,7 @@
764764 $wgOut->addHTML( '<hr />' );
765765 }
766766 } else {
767 - $wgOut->addHTML( wfMsgHtml( 'undelete-nodiff' ) );
 767+ $wgOut->addWikiMsg( 'undelete-nodiff' );
768768 }
769769 }
770770
@@ -774,13 +774,16 @@
775775 $t = htmlspecialchars( $wgLang->time( $timestamp, true ) );
776776 $user = $skin->revUserTools( $rev );
777777
778 - $wgOut->addHTML( '<p>' . wfMsgHtml( 'undelete-revision', $link, $time, $user, $d, $t ) . '</p>' );
 778+ if( $this->mPreview ) {
 779+ $openDiv = '<div id="mw-undelete-revision" class="mw-warning">';
 780+ } else {
 781+ $openDiv = '<div id="mw-undelete-revision">';
 782+ }
779783
 784+ $wgOut->addHTML( $openDiv . wfMsgWikiHtml( 'undelete-revision', $link, $time, $user, $d, $t ) . '</div>' );
780785 wfRunHooks( 'UndeleteShowRevision', array( $this->mTargetObj, $rev ) );
781786
782787 if( $this->mPreview ) {
783 - $wgOut->addHTML( "<hr />\n" );
784 -
785788 //Hide [edit]s
786789 $popts = $wgOut->parserOptions();
787790 $popts->setEditSection( false );
@@ -941,7 +944,7 @@
942945 $wgOut->setPagetitle( wfMsg( 'viewdeletedpage' ) );
943946 }
944947
945 - $wgOut->addWikiText( wfMsgHtml( 'undeletepagetitle', $this->mTargetObj->getPrefixedText()) );
 948+ $wgOut->addWikiMsg( 'undeletepagetitle', $this->mTargetObj->getPrefixedText() );
946949
947950 $archive = new PageArchive( $this->mTargetObj );
948951 /*
Index: branches/querypage-work/phase3/includes/specials/SpecialWhatlinkshere.php
@@ -7,40 +7,27 @@
88 */
99
1010 /**
11 - * Entry point
12 - * @param $par String: An article name ??
13 - */
14 -function wfSpecialWhatlinkshere($par = NULL) {
15 - global $wgRequest;
16 - $page = new WhatLinksHerePage( $wgRequest, $par );
17 - $page->execute();
18 -}
19 -
20 -/**
2111 * implements Special:Whatlinkshere
2212 * @ingroup SpecialPage
2313 */
24 -class WhatLinksHerePage {
25 - // Stored data
26 - protected $par;
 14+class SpecialWhatLinksHere extends SpecialPage {
2715
2816 // Stored objects
2917 protected $opts, $target, $selfTitle;
3018
3119 // Stored globals
32 - protected $skin, $request;
 20+ protected $skin;
3321
3422 protected $limits = array( 20, 50, 100, 250, 500 );
3523
36 - function WhatLinksHerePage( $request, $par = null ) {
 24+ public function __construct() {
 25+ parent::__construct( 'Whatlinkshere' );
3726 global $wgUser;
38 - $this->request = $request;
3927 $this->skin = $wgUser->getSkin();
40 - $this->par = $par;
4128 }
4229
43 - function execute() {
44 - global $wgOut;
 30+ function execute( $par ) {
 31+ global $wgOut, $wgRequest;
4532
4633 $opts = new FormOptions();
4734
@@ -54,12 +41,12 @@
5542 $opts->add( 'hidelinks', false );
5643 $opts->add( 'hideimages', false );
5744
58 - $opts->fetchValuesFromRequest( $this->request );
 45+ $opts->fetchValuesFromRequest( $wgRequest );
5946 $opts->validateIntBounds( 'limit', 0, 5000 );
6047
6148 // Give precedence to subpage syntax
62 - if ( isset($this->par) ) {
63 - $opts->setValue( 'target', $this->par );
 49+ if ( isset($par) ) {
 50+ $opts->setValue( 'target', $par );
6451 }
6552
6653 // Bind to member variable
@@ -346,7 +333,7 @@
347334 }
348335
349336 function whatlinkshereForm() {
350 - global $wgScript, $wgTitle;
 337+ global $wgScript;
351338
352339 // We get nicer value from the title object
353340 $this->opts->consumeValue( 'target' );
@@ -360,7 +347,7 @@
361348 $f = Xml::openElement( 'form', array( 'action' => $wgScript ) );
362349
363350 # Values that should not be forgotten
364 - $f .= Xml::hidden( 'title', $wgTitle->getPrefixedText() );
 351+ $f .= Xml::hidden( 'title', SpecialPage::getTitleFor( 'Whatlinkshere' )->getPrefixedText() );
365352 foreach ( $this->opts->getUnconsumedValues() as $name => $value ) {
366353 $f .= Xml::hidden( $name, $value );
367354 }
Index: branches/querypage-work/phase3/includes/specials/SpecialRecentchanges.php
@@ -306,7 +306,7 @@
307307 // Is there either one namespace selected or excluded?
308308 // Tag filtering also has a better index.
309309 // Also, if this is "all" or main namespace, just use timestamp index.
310 - if( is_null($namespace) || $invert || $namespace == NS_MAIN || $opts['tagfilter'] ) {
 310+ if( is_null($namespace) || $invert || $opts['tagfilter'] ) {
311311 $res = $dbr->select( $tables, '*', $conds, __METHOD__,
312312 array( 'ORDER BY' => 'rc_timestamp DESC', 'LIMIT' => $limit ) +
313313 $query_options,
@@ -597,8 +597,12 @@
598598 global $wgUser;
599599 $sk = $wgUser->getSkin();
600600 $params = $override + $options;
601 - return $sk->link( $this->getTitle(), htmlspecialchars( $title ),
602 - ( $active ? array( 'style'=>'font-weight: bold;' ) : array() ), $params, array( 'known' ) );
 601+ if ( $active ) {
 602+ return $sk->link( $this->getTitle(), '<strong>' . htmlspecialchars( $title ) . '</strong>',
 603+ array(), $params, array( 'known' ) );
 604+ } else {
 605+ return $sk->link( $this->getTitle(), htmlspecialchars( $title ), array() , $params, array( 'known' ) );
 606+ }
603607 }
604608
605609 /**
Index: branches/querypage-work/phase3/includes/specials/SpecialFilepath.php
@@ -37,13 +37,13 @@
3838 }
3939
4040 function execute() {
41 - global $wgOut, $wgTitle, $wgScript;
 41+ global $wgOut, $wgScript;
4242
4343 $wgOut->addHTML(
4444 Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'id' => 'specialfilepath' ) ) .
4545 Xml::openElement( 'fieldset' ) .
4646 Xml::element( 'legend', null, wfMsg( 'filepath' ) ) .
47 - Xml::hidden( 'title', $wgTitle->getPrefixedText() ) .
 47+ Xml::hidden( 'title', SpecialPage::getTitleFor( 'Filepath' )->getPrefixedText() ) .
4848 Xml::inputLabel( wfMsg( 'filepath-page' ), 'file', 'file', 25, is_object( $this->mTitle ) ? $this->mTitle->getText() : '' ) . ' ' .
4949 Xml::submitButton( wfMsg( 'filepath-submit' ) ) . "\n" .
5050 Xml::closeElement( 'fieldset' ) .
Index: branches/querypage-work/phase3/includes/specials/SpecialRestrictUser.php
@@ -36,12 +36,12 @@
3737
3838 class RestrictUserForm {
3939 public static function selectUserForm( $val = null, $error = null ) {
40 - global $wgScript, $wgTitle;
 40+ global $wgScript;
4141 $action = htmlspecialchars( $wgScript );
4242 $s = Xml::fieldset( wfMsg( 'restrictuser-userselect' ) ) . "<form action=\"{$action}\">";
4343 if( $error )
4444 $s .= '<p>' . $error . '</p>';
45 - $s .= Xml::hidden( 'title', $wgTitle->getPrefixedDbKey() );
 45+ $s .= Xml::hidden( 'title', SpecialPage::getTitleFor( 'RestrictUser' )->getPrefixedDbKey() );
4646 $form = array( 'restrictuser-user' => Xml::input( 'user', false, $val ) );
4747 $s .= Xml::buildForm( $form, 'restrictuser-go' );
4848 $s .= "</form></fieldset>";
@@ -59,7 +59,7 @@
6060 }
6161
6262 public static function pageRestrictionForm( $uid, $user, $oldRestrictions ) {
63 - global $wgOut, $wgTitle, $wgRequest, $wgUser;
 63+ global $wgOut, $wgRequest, $wgUser;
6464 $error = '';
6565 $success = false;
6666 if( $wgRequest->wasPosted() && $wgRequest->getVal( 'type' ) == UserRestriction::PAGE &&
@@ -86,7 +86,7 @@
8787
8888 self::printSuccessError( $success, $error );
8989
90 - $wgOut->addHTML( Xml::openElement( 'form', array( 'action' => $wgTitle->getLocalUrl(),
 90+ $wgOut->addHTML( Xml::openElement( 'form', array( 'action' => SpecialPage::getTitleFor( 'RestrictUser' )->getLocalUrl(),
9191 'method' => 'post' ) ) );
9292 $wgOut->addHTML( Xml::hidden( 'type', UserRestriction::PAGE ) );
9393 $wgOut->addHTML( Xml::hidden( 'edittoken', $wgUser->editToken() ) );
@@ -130,7 +130,7 @@
131131 }
132132
133133 public static function namespaceRestrictionForm( $uid, $user, $oldRestrictions ) {
134 - global $wgOut, $wgTitle, $wgRequest, $wgUser, $wgContLang;
 134+ global $wgOut, $wgRequest, $wgUser, $wgContLang;
135135 $error = '';
136136 $success = false;
137137 if( $wgRequest->wasPosted() && $wgRequest->getVal( 'type' ) == UserRestriction::NAMESPACE &&
@@ -154,7 +154,7 @@
155155
156156 self::printSuccessError( $success, $error );
157157
158 - $wgOut->addHTML( Xml::openElement( 'form', array( 'action' => $wgTitle->getLocalUrl(),
 158+ $wgOut->addHTML( Xml::openElement( 'form', array( 'action' => SpecialPage::getTitleFor( 'RestrictUser' )->getLocalUrl(),
159159 'method' => 'post' ) ) );
160160 $wgOut->addHTML( Xml::hidden( 'type', UserRestriction::NAMESPACE ) );
161161 $wgOut->addHTML( Xml::hidden( 'edittoken', $wgUser->editToken() ) );
Index: branches/querypage-work/phase3/includes/specials/SpecialSpecialpages.php
@@ -55,7 +55,7 @@
5656 $total = count($sortedPages);
5757 $count = 0;
5858
59 - $wgOut->wrapWikiMsg( "<h4 class='mw-specialpagesgroup'>$1</h4>\n", "specialpages-group-$group" );
 59+ $wgOut->wrapWikiMsg( "<h4 class=\"mw-specialpagesgroup\" id=\"mw-specialpagesgroup-$group\">$1</h4>\n", "specialpages-group-$group" );
6060 $wgOut->addHTML( "<table style='width: 100%;' class='mw-specialpages-table'><tr>" );
6161 $wgOut->addHTML( "<td width='30%' valign='top'><ul>\n" );
6262 foreach( $sortedPages as $desc => $specialpage ) {
Index: branches/querypage-work/phase3/includes/specials/SpecialAllmessages.php
@@ -9,7 +9,7 @@
1010 * Constructor.
1111 */
1212 function wfSpecialAllmessages() {
13 - global $wgOut, $wgRequest, $wgMessageCache, $wgTitle;
 13+ global $wgOut, $wgRequest, $wgMessageCache;
1414 global $wgUseDatabaseMessages, $wgLang;
1515
1616 # The page isn't much use if the MediaWiki namespace is not being used
@@ -47,12 +47,13 @@
4848
4949 wfProfileIn( __METHOD__ . '-output' );
5050 $wgOut->addScriptFile( 'allmessages.js' );
 51+ $title = SpecialPage::getTitleFor( 'Allmessages' );
5152 if ( $ot == 'php' ) {
5253 $navText .= wfAllMessagesMakePhp( $messages );
5354 $wgOut->addHTML( $wgLang->pipeList( array(
5455 'PHP',
55 - '<a href="' . $wgTitle->escapeLocalUrl( 'ot=html' ) . '">HTML</a>',
56 - '<a href="' . $wgTitle->escapeLocalUrl( 'ot=xml' ) . '">XML</a>' .
 56+ '<a href="' . $title->escapeLocalUrl( 'ot=html' ) . '">HTML</a>',
 57+ '<a href="' . $title->escapeLocalUrl( 'ot=xml' ) . '">XML</a>' .
5758 '<pre>' . htmlspecialchars( $navText ) . '</pre>'
5859 ) ) );
5960 } else if ( $ot == 'xml' ) {
@@ -61,9 +62,9 @@
6263 echo wfAllMessagesMakeXml( $messages );
6364 } else {
6465 $wgOut->addHTML( $wgLang->pipeList( array(
65 - '<a href="' . $wgTitle->escapeLocalUrl( 'ot=php' ) . '">PHP</a>',
 66+ '<a href="' . $title->escapeLocalUrl( 'ot=php' ) . '">PHP</a>',
6667 'HTML',
67 - '<a href="' . $wgTitle->escapeLocalUrl( 'ot=xml' ) . '">XML</a>'
 68+ '<a href="' . $title->escapeLocalUrl( 'ot=xml' ) . '">XML</a>'
6869 ) ) );
6970 $wgOut->addWikiText( $navText );
7071 $wgOut->addHTML( wfAllMessagesMakeHTMLText( $messages ) );
Index: branches/querypage-work/phase3/includes/specials/SpecialRecentchangeslinked.php
@@ -85,13 +85,8 @@
8686 $join_conds['watchlist'] = array( 'LEFT JOIN', "wl_user={$uid} AND wl_title=rc_title AND wl_namespace=rc_namespace" );
8787 }
8888
89 - ChangeTags::modifyDisplayQuery( $tables,
90 - $select,
91 - $conds,
92 - $join_conds,
93 - $query_options,
94 - $opts['tagfilter'],
95 - );
 89+ ChangeTags::modifyDisplayQuery( $tables, $select, $conds, $join_conds,
 90+ $query_options, $opts['tagfilter'] );
9691
9792 // XXX: parent class does this, should we too?
9893 // wfRunHooks('SpecialRecentChangesQuery', array( &$conds, &$tables, &$join_conds, $opts ) );
@@ -195,7 +190,6 @@
196191
197192 function setBottomText( OutputPage $out, FormOptions $opts ){
198193 if( isset( $this->mTargetTitle ) && is_object( $this->mTargetTitle ) ){
199 - global $wgUser;
200194 $out->setFeedAppendQuery( "target=" . urlencode( $this->mTargetTitle->getPrefixedDBkey() ) );
201195 }
202196 if( isset( $this->mResultEmpty ) && $this->mResultEmpty ){
Index: branches/querypage-work/phase3/includes/specials/SpecialWantedtemplates.php
@@ -15,20 +15,12 @@
1616 * @copyright Copyright © 2008, Danny B.
1717 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1818 */
19 -class WantedTemplatesPage extends QueryPage {
 19+class WantedTemplatesPage extends WantedQueryPage {
2020
2121 function getName() {
2222 return 'Wantedtemplates';
2323 }
2424
25 - function isExpensive() {
26 - return true;
27 - }
28 -
29 - function isSyndicated() {
30 - return false;
31 - }
32 -
3325 function getSQL() {
3426 $dbr = wfGetDB( DB_SLAVE );
3527 list( $templatelinks, $page ) = $dbr->tableNamesN( 'templatelinks', 'page' );
@@ -45,55 +37,6 @@
4638 GROUP BY tl_namespace, tl_title
4739 ";
4840 }
49 -
50 - function sortDescending() { return true; }
51 -
52 - /**
53 - * Fetch user page links and cache their existence
54 - */
55 - function preprocessResults( $db, $res ) {
56 - $batch = new LinkBatch;
57 - while ( $row = $db->fetchObject( $res ) )
58 - $batch->add( $row->namespace, $row->title );
59 - $batch->execute();
60 -
61 - // Back to start for display
62 - if ( $db->numRows( $res ) > 0 )
63 - // If there are no rows we get an error seeking.
64 - $db->dataSeek( $res, 0 );
65 - }
66 -
67 - function formatResult( $skin, $result ) {
68 - global $wgLang, $wgContLang;
69 -
70 - $nt = Title::makeTitle( $result->namespace, $result->title );
71 - $text = $wgContLang->convert( $nt->getText() );
72 -
73 - $plink = $this->isCached() ?
74 - $skin->makeLinkObj( $nt, htmlspecialchars( $text ) ) :
75 - $skin->makeBrokenLinkObj( $nt, htmlspecialchars( $text ) );
76 -
77 - return wfSpecialList(
78 - $plink,
79 - $this->makeWlhLink( $nt, $skin, $result )
80 - );
81 - }
82 -
83 - /**
84 - * Make a "what links here" link for a given title
85 - *
86 - * @param Title $title Title to make the link for
87 - * @param Skin $skin Skin to use
88 - * @param object $result Result row
89 - * @return string
90 - */
91 - private function makeWlhLink( $title, $skin, $result ) {
92 - global $wgLang;
93 - $wlh = SpecialPage::getTitleFor( 'Whatlinkshere' );
94 - $label = wfMsgExt( 'nlinks', array( 'parsemag', 'escape' ),
95 - $wgLang->formatNum( $result->value ) );
96 - return $skin->link( $wlh, $label, array(), array( 'target' => $title->getPrefixedText() ) );
97 - }
9841 }
9942
10043 /**
Index: branches/querypage-work/phase3/includes/specials/SpecialContributions.php
@@ -39,7 +39,7 @@
4040 return;
4141 }
4242
43 - $this->opts['limit'] = $wgRequest->getInt( 'limit', 50 );
 43+ $this->opts['limit'] = $wgRequest->getInt( 'limit', $wgUser->getOption('rclimit') );
4444 $this->opts['target'] = $target;
4545
4646 $nt = Title::makeTitleSafe( NS_USER, $target );
@@ -203,9 +203,9 @@
204204 * @param $this->opts Array: the options to be included.
205205 */
206206 protected function getForm() {
207 - global $wgScript, $wgTitle;
 207+ global $wgScript;
208208
209 - $this->opts['title'] = $wgTitle->getPrefixedText();
 209+ $this->opts['title'] = SpecialPage::getTitleFor( 'Contributions' )->getPrefixedText();
210210 if( !isset( $this->opts['target'] ) ) {
211211 $this->opts['target'] = '';
212212 } else {
Index: branches/querypage-work/phase3/includes/specials/SpecialSearch.php
@@ -617,7 +617,7 @@
618618 $redirectLabel = Xml::label( wfMsg( 'powersearch-redir' ), 'redirs' );
619619 $searchField = Xml::inputLabel( wfMsg('powersearch-field'), 'search', 'powerSearchText', 50, $term,
620620 array( 'type' => 'text') );
621 - $searchButton = Xml::submitButton( wfMsg( 'powersearch' ), array( 'name' => 'fulltext' )) . "\n";
 621+ $searchButton = Xml::submitButton( wfMsg( 'powersearch' ) ) . "\n";
622622 $searchTitle = SpecialPage::getTitleFor( 'Search' );
623623
624624 $redirectText = '';
@@ -759,7 +759,7 @@
760760 // Term box
761761 $out .= Xml::input( 'search', 50, $term, array( 'type' => 'text', 'id' => 'searchText' ) ) . "\n";
762762 $out .= Xml::hidden( 'fulltext', 'Search' );
763 - $out .= Xml::submitButton( wfMsg( 'searchbutton' ), array( 'name' => 'fulltext' ) );
 763+ $out .= Xml::submitButton( wfMsg( 'searchbutton' ) );
764764 $out .= ' (' . wfMsgExt('searchmenu-help',array('parseinline') ) . ')';
765765 $out .= Xml::closeElement( 'form' );
766766 // Add prefix link for single-namespace searches
@@ -1428,7 +1428,7 @@
14291429 $redirect = Xml::check( 'redirs', $this->searchRedirects, array( 'value' => '1', 'id' => 'redirs' ) );
14301430 $redirectLabel = Xml::label( wfMsg( 'powersearch-redir' ), 'redirs' );
14311431 $searchField = Xml::input( 'search', 50, $term, array( 'type' => 'text', 'id' => 'powerSearchText' ) );
1432 - $searchButton = Xml::submitButton( wfMsg( 'powersearch' ), array( 'name' => 'fulltext' ) ) . "\n";
 1432+ $searchButton = Xml::submitButton( wfMsg( 'powersearch' ) ) . "\n";
14331433 $searchTitle = SpecialPage::getTitleFor( 'Search' );
14341434 $searchHiddens = Xml::hidden( 'title', $searchTitle->getPrefixedText() ) . "\n";
14351435 $searchHiddens .= Xml::hidden( 'fulltext', 'Advanced search' ) . "\n";
@@ -1480,7 +1480,7 @@
14811481 }
14821482 $out .= Xml::hidden( 'title', $searchTitle->getPrefixedText() );
14831483 $out .= Xml::hidden( 'fulltext', 'Search' );
1484 - $out .= Xml::submitButton( wfMsg( 'searchbutton' ), array( 'name' => 'fulltext' ) );
 1484+ $out .= Xml::submitButton( wfMsg( 'searchbutton' ) );
14851485 $out .= Xml::closeElement( 'form' );
14861486
14871487 return $out;
Index: branches/querypage-work/phase3/includes/specials/SpecialMIMEsearch.php
@@ -83,12 +83,12 @@
8484 * Output the HTML search form, and constructs the MIMEsearchPage object.
8585 */
8686 function wfSpecialMIMEsearch( $par = null ) {
87 - global $wgRequest, $wgTitle, $wgOut;
 87+ global $wgRequest, $wgOut;
8888
8989 $mime = isset( $par ) ? $par : $wgRequest->getText( 'mime' );
9090
9191 $wgOut->addHTML(
92 - Xml::openElement( 'form', array( 'id' => 'specialmimesearch', 'method' => 'get', 'action' => $wgTitle->getLocalUrl() ) ) .
 92+ Xml::openElement( 'form', array( 'id' => 'specialmimesearch', 'method' => 'get', 'action' => SpecialPage::getTitleFor( 'MIMEsearch' )->getLocalUrl() ) ) .
9393 Xml::openElement( 'fieldset' ) .
9494 Xml::element( 'legend', null, wfMsg( 'mimesearch' ) ) .
9595 Xml::inputLabel( wfMsg( 'mimetype' ), 'mime', 'mime', 20, $mime ) . ' ' .
Index: branches/querypage-work/phase3/includes/specials/SpecialIpblocklist.php
@@ -306,7 +306,7 @@
307307 }
308308
309309 function searchForm() {
310 - global $wgTitle, $wgScript, $wgRequest, $wgLang;
 310+ global $wgScript, $wgRequest, $wgLang;
311311
312312 $showhide = array( wfMsg( 'show' ), wfMsg( 'hide' ) );
313313 $nondefaults = array();
@@ -334,7 +334,7 @@
335335
336336 return
337337 Xml::tags( 'form', array( 'action' => $wgScript ),
338 - Xml::hidden( 'title', $wgTitle->getPrefixedDbKey() ) .
 338+ Xml::hidden( 'title', SpecialPage::getTitleFor( 'Ipblocklist' )->getPrefixedDbKey() ) .
339339 Xml::openElement( 'fieldset' ) .
340340 Xml::element( 'legend', null, wfMsg( 'ipblocklist-legend' ) ) .
341341 Xml::inputLabel( wfMsg( 'ipblocklist-username' ), 'ip', 'ip', /* size */ false, $this->ip ) .
Index: branches/querypage-work/phase3/includes/specials/SpecialListusers.php
@@ -74,7 +74,7 @@
7575 $dbr = wfGetDB( DB_SLAVE );
7676 $conds = array();
7777 // Don't show hidden names
78 - $conds[] = 'ipb_deleted IS NULL OR ipb_deleted = 0';
 78+ $conds[] = 'ipb_deleted IS NULL';
7979 if( $this->requestedGroup != '' ) {
8080 $conds['ug_group'] = $this->requestedGroup;
8181 $useIndex = '';
@@ -97,7 +97,7 @@
9898
9999 $query = array(
100100 'tables' => " $user $useIndex LEFT JOIN $user_groups ON user_id=ug_user
101 - LEFT JOIN $ipblocks ON user_id=ipb_user AND ipb_auto=0 ",
 101+ LEFT JOIN $ipblocks ON user_id=ipb_user AND ipb_deleted=1 AND ipb_auto=0 ",
102102 'fields' => array(
103103 $this->creationSort ? 'MAX(user_name) AS user_name' : 'user_name',
104104 $this->creationSort ? 'user_id' : 'MAX(user_id) AS user_id',
Index: branches/querypage-work/phase3/includes/specials/SpecialPreferences.php
@@ -104,10 +104,11 @@
105105 }
106106
107107 function execute() {
108 - global $wgUser, $wgOut, $wgTitle;
 108+ global $wgUser, $wgOut;
109109
110110 if ( $wgUser->isAnon() ) {
111 - $wgOut->showErrorPage( 'prefsnologin', 'prefsnologintext', array($wgTitle->getPrefixedDBkey()) );
 111+ $wgOut->showErrorPage( 'prefsnologin', 'prefsnologintext',
 112+ array( SpecialPage::getTitleFor( 'Preferences' )->getPrefixedDBkey() ) );
112113 return;
113114 }
114115 if ( wfReadOnly() ) {
Index: branches/querypage-work/phase3/includes/specials/SpecialWantedfiles.php
@@ -13,20 +13,12 @@
1414 * @copyright Copyright © 2008, Soxred93
1515 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1616 */
17 -class WantedFilesPage extends QueryPage {
 17+class WantedFilesPage extends WantedQueryPage {
1818
1919 function getName() {
2020 return 'Wantedfiles';
2121 }
2222
23 - function isExpensive() {
24 - return true;
25 - }
26 -
27 - function isSyndicated() {
28 - return false;
29 - }
30 -
3123 function getSQL() {
3224 $dbr = wfGetDB( DB_SLAVE );
3325 list( $imagelinks, $page ) = $dbr->tableNamesN( 'imagelinks', 'page' );
@@ -44,55 +36,6 @@
4537 GROUP BY il_to
4638 ";
4739 }
48 -
49 - function sortDescending() { return true; }
50 -
51 - /**
52 - * Fetch user page links and cache their existence
53 - */
54 - function preprocessResults( $db, $res ) {
55 - $batch = new LinkBatch;
56 - while ( $row = $db->fetchObject( $res ) )
57 - $batch->add( $row->namespace, $row->title );
58 - $batch->execute();
59 -
60 - // Back to start for display
61 - if ( $db->numRows( $res ) > 0 )
62 - // If there are no rows we get an error seeking.
63 - $db->dataSeek( $res, 0 );
64 - }
65 -
66 - function formatResult( $skin, $result ) {
67 - global $wgLang, $wgContLang;
68 -
69 - $nt = Title::makeTitle( $result->namespace, $result->title );
70 - $text = $wgContLang->convert( $nt->getText() );
71 -
72 - $plink = $this->isCached() ?
73 - $skin->makeLinkObj( $nt, htmlspecialchars( $text ) ) :
74 - $skin->makeBrokenLinkObj( $nt, htmlspecialchars( $text ) );
75 -
76 - return wfSpecialList(
77 - $plink,
78 - $this->makeWlhLink( $nt, $skin, $result )
79 - );
80 - }
81 -
82 - /**
83 - * Make a "what links here" link for a given title
84 - *
85 - * @param Title $title Title to make the link for
86 - * @param Skin $skin Skin to use
87 - * @param object $result Result row
88 - * @return string
89 - */
90 - private function makeWlhLink( $title, $skin, $result ) {
91 - global $wgLang;
92 - $wlh = SpecialPage::getTitleFor( 'Whatlinkshere' );
93 - $label = wfMsgExt( 'nlinks', array( 'parsemag', 'escape' ),
94 - $wgLang->formatNum( $result->value ) );
95 - return $skin->link( $wlh, $label, array(), array( 'target' => $title->getPrefixedText() ) );
96 - }
9740 }
9841
9942 /**
Index: branches/querypage-work/phase3/includes/specials/SpecialImport.php
@@ -132,11 +132,11 @@
133133 }
134134
135135 private function showForm() {
136 - global $wgUser, $wgOut, $wgRequest, $wgTitle, $wgImportSources, $wgExportMaxLinkDepth;
 136+ global $wgUser, $wgOut, $wgRequest, $wgImportSources, $wgExportMaxLinkDepth;
137137 if( !$wgUser->isAllowed( 'import' ) && !$wgUser->isAllowed( 'importupload' ) )
138138 return $wgOut->permissionRequired( 'import' );
139139
140 - $action = $wgTitle->getLocalUrl( 'action=submit' );
 140+ $action = $this->getTitle()->getLocalUrl( 'action=submit' );
141141
142142 if( $wgUser->isAllowed( 'importupload' ) ) {
143143 $wgOut->addWikiMsg( "importtext" );
Property changes on: branches/querypage-work/phase3/includes/specials
___________________________________________________________________
Added: svn:mergeinfo
144144 Merged /trunk/phase3/includes/specials:r49084-49527

Follow-up revisions

RevisionCommit summaryAuthorDate
r65314querypage-work2: Merge r49528 from querypage-workreedy14:06, 20 April 2010

Status & tagging log