MediaWiki  REL1_22
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() {
00039         return true;
00040     }
00041 
00042     function isSyndicated() {
00043         return false;
00044     }
00045 
00046     function getQueryInfo() {
00047         return array(
00048             'tables' => array( 'page', 'watchlist' ),
00049             'fields' => array( 'namespace' => 'page_namespace',
00050                     'title' => 'page_title',
00051                     'value' => 'page_namespace' ),
00052             'conds' => array( 'wl_title IS NULL',
00053                     'page_is_redirect' => 0,
00054                     "page_namespace != '" . NS_MEDIAWIKI .
00055                     "'" ),
00056             'join_conds' => array( 'watchlist' => array(
00057                 'LEFT JOIN', array( 'wl_title = page_title',
00058                     'wl_namespace = page_namespace' ) ) )
00059         );
00060     }
00061 
00062     function sortDescending() {
00063         return false;
00064     }
00065 
00066     function getOrderFields() {
00067         return array( 'page_namespace', 'page_title' );
00068     }
00069 
00075     function formatResult( $skin, $result ) {
00076         global $wgContLang;
00077 
00078         $nt = Title::makeTitleSafe( $result->namespace, $result->title );
00079         if ( !$nt ) {
00080             return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ),
00081                 Linker::getInvalidTitleDescription( $this->getContext(), $result->namespace, $result->title ) );
00082         }
00083 
00084         $text = $wgContLang->convert( $nt->getPrefixedText() );
00085 
00086         $plink = Linker::linkKnown( $nt, htmlspecialchars( $text ) );
00087         $token = WatchAction::getWatchToken( $nt, $this->getUser() );
00088         $wlink = Linker::linkKnown(
00089             $nt,
00090             $this->msg( 'watch' )->escaped(),
00091             array(),
00092             array( 'action' => 'watch', 'token' => $token )
00093         );
00094 
00095         return $this->getLanguage()->specialList( $plink, $wlink );
00096     }
00097 
00098     protected function getGroupName() {
00099         return 'maintenance';
00100     }
00101 }