MediaWiki
REL1_19
|
00001 <?php 00032 class WantedFilesPage extends WantedQueryPage { 00033 00034 function __construct( $name = 'Wantedfiles' ) { 00035 parent::__construct( $name ); 00036 } 00037 00038 function getPageHeader() { 00039 # Specifically setting to use "Wanted Files" (NS_MAIN) as title, so as to get what 00040 # category would be used on main namespace pages, for those tricky wikipedia 00041 # admins who like to do {{#ifeq:{{NAMESPACE}}|foo|bar|....}}. 00042 $catMessage = wfMessage( 'broken-file-category' ) 00043 ->title( Title::newFromText( "Wanted Files", NS_MAIN ) ) 00044 ->inContentLanguage(); 00045 00046 if ( !$catMessage->isDisabled() ) { 00047 $category = Title::makeTitleSafe( NS_CATEGORY, $catMessage->text() ); 00048 } else { 00049 $category = false; 00050 } 00051 00052 if ( $category ) { 00053 return $this 00054 ->msg( 'wantedfiletext-cat' ) 00055 ->params( $category->getFullText() ) 00056 ->parseAsBlock(); 00057 } else { 00058 return $this 00059 ->msg( 'wantedfiletext-nocat' ) 00060 ->parseAsBlock(); 00061 } 00062 } 00063 00070 function forceExistenceCheck() { 00071 return true; 00072 } 00073 00074 function getQueryInfo() { 00075 return array ( 00076 'tables' => array ( 'imagelinks', 'image' ), 00077 'fields' => array ( "'" . NS_FILE . "' AS namespace", 00078 'il_to AS title', 00079 'COUNT(*) AS value' ), 00080 'conds' => array ( 'img_name IS NULL' ), 00081 'options' => array ( 'GROUP BY' => 'il_to' ), 00082 'join_conds' => array ( 'image' => 00083 array ( 'LEFT JOIN', 00084 array ( 'il_to = img_name' ) 00085 ) 00086 ) 00087 ); 00088 } 00089 }