MediaWiki  REL1_19
SpecialUnwatchedpages.php
Go to the documentation of this file.
00001 <?php
00032 class UnwatchedpagesPage extends QueryPage {
00033 
00034         function __construct( $name = 'Unwatchedpages' ) {
00035                 parent::__construct( $name, 'unwatchedpages' );
00036         }
00037 
00038         function isExpensive() { return true; }
00039         function isSyndicated() { return false; }
00040 
00041         function getQueryInfo() {
00042                 return array (
00043                         'tables' => array ( 'page', 'watchlist' ),
00044                         'fields' => array ( 'page_namespace AS namespace',
00045                                         'page_title AS title',
00046                                         'page_namespace AS value' ),
00047                         'conds' => array ( 'wl_title IS NULL',
00048                                         'page_is_redirect' => 0,
00049                                         "page_namespace != '" . NS_MEDIAWIKI .
00050                                         "'" ),
00051                         'join_conds' => array ( 'watchlist' => array (
00052                                 'LEFT JOIN', array ( 'wl_title = page_title',
00053                                         'wl_namespace = page_namespace' ) ) )
00054                 );
00055         }
00056 
00057         function sortDescending() { return false; }
00058 
00059         function getOrderFields() {
00060                 return array( 'page_namespace', 'page_title' );
00061         }
00062 
00068         function formatResult( $skin, $result ) {
00069                 global $wgContLang;
00070 
00071                 $nt = Title::makeTitle( $result->namespace, $result->title );
00072                 $text = $wgContLang->convert( $nt->getPrefixedText() );
00073 
00074                 $plink = Linker::linkKnown(
00075                         $nt,
00076                         htmlspecialchars( $text )
00077                 );
00078                 $token = WatchAction::getWatchToken( $nt, $this->getUser() );
00079                 $wlink = Linker::linkKnown(
00080                         $nt,
00081                         wfMsgHtml( 'watch' ),
00082                         array(),
00083                         array( 'action' => 'watch', 'token' => $token )
00084                 );
00085 
00086                 return $this->getLanguage()->specialList( $plink, $wlink );
00087         }
00088 }