From 370e83bb0dfd0c70de268c93bf07ad5ee0897192 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 15 Aug 2008 01:29:47 +0200 Subject: Update auf 1.13.0 --- includes/specials/SpecialUnusedtemplates.php | 54 ++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 includes/specials/SpecialUnusedtemplates.php (limited to 'includes/specials/SpecialUnusedtemplates.php') diff --git a/includes/specials/SpecialUnusedtemplates.php b/includes/specials/SpecialUnusedtemplates.php new file mode 100644 index 00000000..89acd09c --- /dev/null +++ b/includes/specials/SpecialUnusedtemplates.php @@ -0,0 +1,54 @@ + + * @copyright © 2006 Rob Church + * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later + * @ingroup SpecialPage + */ +class UnusedtemplatesPage extends QueryPage { + + function getName() { return( 'Unusedtemplates' ); } + function isExpensive() { return true; } + function isSyndicated() { return false; } + function sortDescending() { return false; } + + function getSQL() { + $dbr = wfGetDB( DB_SLAVE ); + list( $page, $templatelinks) = $dbr->tableNamesN( 'page', 'templatelinks' ); + $sql = "SELECT 'Unusedtemplates' AS type, page_title AS title, + page_namespace AS namespace, 0 AS value + FROM $page + LEFT JOIN $templatelinks + ON page_namespace = tl_namespace AND page_title = tl_title + WHERE page_namespace = 10 AND tl_from IS NULL + AND page_is_redirect = 0"; + return $sql; + } + + function formatResult( $skin, $result ) { + $title = Title::makeTitle( NS_TEMPLATE, $result->title ); + $pageLink = $skin->makeKnownLinkObj( $title, '', 'redirect=no' ); + $wlhLink = $skin->makeKnownLinkObj( + SpecialPage::getTitleFor( 'Whatlinkshere' ), + wfMsgHtml( 'unusedtemplateswlh' ), + 'target=' . $title->getPrefixedUrl() ); + return wfSpecialList( $pageLink, $wlhLink ); + } + + function getPageHeader() { + return wfMsgExt( 'unusedtemplatestext', array( 'parse' ) ); + } + +} + +function wfSpecialUnusedtemplates() { + list( $limit, $offset ) = wfCheckLimits(); + $utp = new UnusedtemplatesPage(); + $utp->doQuery( $offset, $limit ); +} -- cgit v1.2.3-54-g00ecf