Use Doxygen @addtogroup instead of phpdoc @package && @subpackage
[lhc/web/wiklou.git] / includes / SpecialUnusedtemplates.php
1 <?php
2
3 /**
4 * @addtogroup Special pages
5 *
6 * @author Rob Church <robchur@gmail.com>
7 * @copyright © 2006 Rob Church
8 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
9 */
10
11 /**
12 * @addtogroup SpecialPage
13 */
14
15 class UnusedtemplatesPage extends QueryPage {
16
17 function getName() { return( 'Unusedtemplates' ); }
18 function isExpensive() { return true; }
19 function isSyndicated() { return false; }
20 function sortDescending() { return false; }
21
22 function getSQL() {
23 $dbr =& wfGetDB( DB_SLAVE );
24 list( $page, $templatelinks) = $dbr->tableNamesN( 'page', 'templatelinks' );
25 $sql = "SELECT 'Unusedtemplates' AS type, page_title AS title,
26 page_namespace AS namespace, 0 AS value
27 FROM $page
28 LEFT JOIN $templatelinks
29 ON page_namespace = tl_namespace AND page_title = tl_title
30 WHERE page_namespace = 10 AND tl_from IS NULL";
31 return $sql;
32 }
33
34 function formatResult( $skin, $result ) {
35 $title = Title::makeTitle( NS_TEMPLATE, $result->title );
36 $pageLink = $skin->makeKnownLinkObj( $title, '', 'redirect=no' );
37 $wlhLink = $skin->makeKnownLinkObj(
38 SpecialPage::getTitleFor( 'Whatlinkshere' ),
39 wfMsgHtml( 'unusedtemplateswlh' ),
40 'target=' . $title->getPrefixedUrl() );
41 return wfSpecialList( $pageLink, $wlhLink );
42 }
43
44 function getPageHeader() {
45 global $wgOut;
46 return $wgOut->parse( wfMsg( 'unusedtemplatestext' ) );
47 }
48
49 }
50
51 function wfSpecialUnusedtemplates() {
52 list( $limit, $offset ) = wfCheckLimits();
53 $utp = new UnusedtemplatesPage();
54 $utp->doQuery( $offset, $limit );
55 }
56
57 ?>