MediaWiki
REL1_22
|
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 = $this->msg( '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 00071 function forceExistenceCheck() { 00072 return true; 00073 } 00074 00075 function getQueryInfo() { 00076 return array( 00077 'tables' => array( 'imagelinks', 'image' ), 00078 'fields' => array( 'namespace' => NS_FILE, 00079 'title' => 'il_to', 00080 'value' => 'COUNT(*)' ), 00081 'conds' => array( 'img_name IS NULL' ), 00082 'options' => array( 'GROUP BY' => 'il_to' ), 00083 'join_conds' => array( 'image' => 00084 array( 'LEFT JOIN', 00085 array( 'il_to = img_name' ) 00086 ) 00087 ) 00088 ); 00089 } 00090 00091 protected function getGroupName() { 00092 return 'maintenance'; 00093 } 00094 }