Patched jquery-1.4.2 to not crash in IE7 when a style property is set with 'null...
[mediawiki.git] / includes / specials / SpecialUnusedtemplates.php
blob6ddbab3289d6c3761cd19244c1401b51709a14b2
1 <?php
2 /**
3 * @file
4 * @ingroup SpecialPage
5 */
7 /**
8 * implements Special:Unusedtemplates
9 * @author Rob Church <robchur@gmail.com>
10 * @copyright © 2006 Rob Church
11 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
12 * @ingroup SpecialPage
14 class UnusedtemplatesPage extends QueryPage {
16 function getName() { return( 'Unusedtemplates' ); }
17 function isExpensive() { return true; }
18 function isSyndicated() { return false; }
19 function sortDescending() { return false; }
21 function getSQL() {
22 $dbr = wfGetDB( DB_SLAVE );
23 list( $page, $templatelinks) = $dbr->tableNamesN( 'page', 'templatelinks' );
24 $sql = "SELECT 'Unusedtemplates' AS type, page_title AS title,
25 page_namespace AS namespace, 0 AS value
26 FROM $page
27 LEFT JOIN $templatelinks
28 ON page_namespace = tl_namespace AND page_title = tl_title
29 WHERE page_namespace = 10 AND tl_from IS NULL
30 AND page_is_redirect = 0";
31 return $sql;
34 function formatResult( $skin, $result ) {
35 $title = Title::makeTitle( NS_TEMPLATE, $result->title );
36 $pageLink = $skin->linkKnown(
37 $title,
38 null,
39 array(),
40 array( 'redirect' => 'no' )
42 $wlhLink = $skin->linkKnown(
43 SpecialPage::getTitleFor( 'Whatlinkshere' ),
44 wfMsgHtml( 'unusedtemplateswlh' ),
45 array(),
46 array( 'target' => $title->getPrefixedText() )
48 return wfSpecialList( $pageLink, $wlhLink );
51 function getPageHeader() {
52 return wfMsgExt( 'unusedtemplatestext', array( 'parse' ) );
57 function wfSpecialUnusedtemplates() {
58 list( $limit, $offset ) = wfCheckLimits();
59 $utp = new UnusedtemplatesPage();
60 $utp->doQuery( $offset, $limit );