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