MediaWiki  REL1_21
SpecialUnusedtemplates.php
Go to the documentation of this file.
00001 <?php
00032 class UnusedtemplatesPage extends QueryPage {
00033 
00034         function __construct( $name = 'Unusedtemplates' ) {
00035                 parent::__construct( $name );
00036         }
00037 
00038         function isExpensive() {
00039                 return true;
00040         }
00041 
00042         function isSyndicated() {
00043                 return false;
00044         }
00045 
00046         function sortDescending() {
00047                 return false;
00048         }
00049 
00050         function getQueryInfo() {
00051                 return array (
00052                         'tables' => array ( 'page', 'templatelinks' ),
00053                         'fields' => array ( 'namespace' => 'page_namespace',
00054                                         'title' => 'page_title',
00055                                         'value' => 'page_title' ),
00056                         'conds' => array ( 'page_namespace' => NS_TEMPLATE,
00057                                         'tl_from IS NULL',
00058                                         'page_is_redirect' => 0 ),
00059                         'join_conds' => array ( 'templatelinks' => array (
00060                                 'LEFT JOIN', array ( 'tl_title = page_title',
00061                                         'tl_namespace = page_namespace' ) ) )
00062                 );
00063         }
00064 
00070         function formatResult( $skin, $result ) {
00071                 $title = Title::makeTitle( NS_TEMPLATE, $result->title );
00072                 $pageLink = Linker::linkKnown(
00073                         $title,
00074                         null,
00075                         array(),
00076                         array( 'redirect' => 'no' )
00077                 );
00078                 $wlhLink = Linker::linkKnown(
00079                         SpecialPage::getTitleFor( 'Whatlinkshere', $title->getPrefixedText() ),
00080                         $this->msg( 'unusedtemplateswlh' )->escaped()
00081                 );
00082                 return $this->getLanguage()->specialList( $pageLink, $wlhLink );
00083         }
00084 
00085         function getPageHeader() {
00086                 return $this->msg( 'unusedtemplatestext' )->parseAsBlock();
00087         }
00088 
00089         protected function getGroupName() {
00090                 return 'maintenance';
00091         }
00092 }