MediaWiki  1.23.1
SpecialWantedfiles.php
Go to the documentation of this file.
1 <?php
33 
34  function __construct( $name = 'Wantedfiles' ) {
35  parent::__construct( $name );
36  }
37 
38  function getPageHeader() {
39  # Specifically setting to use "Wanted Files" (NS_MAIN) as title, so as to get what
40  # category would be used on main namespace pages, for those tricky wikipedia
41  # admins who like to do {{#ifeq:{{NAMESPACE}}|foo|bar|....}}.
42  $catMessage = $this->msg( 'broken-file-category' )
43  ->title( Title::newFromText( "Wanted Files", NS_MAIN ) )
44  ->inContentLanguage();
45 
46  if ( !$catMessage->isDisabled() ) {
47  $category = Title::makeTitleSafe( NS_CATEGORY, $catMessage->text() );
48  } else {
49  $category = false;
50  }
51 
52  if ( $category ) {
53  return $this
54  ->msg( 'wantedfiletext-cat' )
55  ->params( $category->getFullText() )
56  ->parseAsBlock();
57  } else {
58  return $this
59  ->msg( 'wantedfiletext-nocat' )
60  ->parseAsBlock();
61  }
62  }
63 
71  function forceExistenceCheck() {
72  return true;
73  }
74 
75  function getQueryInfo() {
76  return array(
77  'tables' => array( 'imagelinks', 'image' ),
78  'fields' => array(
79  'namespace' => NS_FILE,
80  'title' => 'il_to',
81  'value' => 'COUNT(*)'
82  ),
83  'conds' => array( 'img_name IS NULL' ),
84  'options' => array( 'GROUP BY' => 'il_to' ),
85  'join_conds' => array( 'image' =>
86  array( 'LEFT JOIN',
87  array( 'il_to = img_name' )
88  )
89  )
90  );
91  }
92 
93  protected function getGroupName() {
94  return 'maintenance';
95  }
96 }
Title\newFromText
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Definition: Title.php:189
WantedFilesPage\__construct
__construct( $name='Wantedfiles')
Definition: SpecialWantedfiles.php:34
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
WantedFilesPage\getPageHeader
getPageHeader()
The content returned by this function will be output before any result.
Definition: SpecialWantedfiles.php:38
WantedFilesPage\getGroupName
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
Definition: SpecialWantedfiles.php:93
WantedFilesPage\getQueryInfo
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
Definition: SpecialWantedfiles.php:75
NS_FILE
const NS_FILE
Definition: Defines.php:85
NS_MAIN
const NS_MAIN
Definition: Defines.php:79
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
NS_CATEGORY
const NS_CATEGORY
Definition: Defines.php:93
WantedFilesPage\forceExistenceCheck
forceExistenceCheck()
KLUGE: The results may contain false positives for files that exist e.g.
Definition: SpecialWantedfiles.php:71
Title\makeTitleSafe
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:422
$name
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:336
SpecialPage\msg
msg()
Wrapper around wfMessage that sets the current context.
Definition: SpecialPage.php:609
WantedFilesPage
Querypage that lists the most wanted files.
Definition: SpecialWantedfiles.php:32
WantedQueryPage
Class definition for a wanted query page like WantedPages, WantedTemplates, etc.
Definition: QueryPage.php:766