From 183851b06bd6c52f3cae5375f433da720d410447 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 11 Oct 2006 18:12:39 +0000 Subject: MediaWiki 1.7.1 wiederhergestellt --- includes/SpecialUnusedtemplates.php | 59 +++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 includes/SpecialUnusedtemplates.php (limited to 'includes/SpecialUnusedtemplates.php') diff --git a/includes/SpecialUnusedtemplates.php b/includes/SpecialUnusedtemplates.php new file mode 100644 index 00000000..b33a24da --- /dev/null +++ b/includes/SpecialUnusedtemplates.php @@ -0,0 +1,59 @@ + + * @copyright © 2006 Rob Church + * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later + */ + +/** + * @package MediaWiki + * @subpackage 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 ); + extract( $dbr->tableNames( '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"; + return $sql; + } + + function formatResult( $skin, $result ) { + $title = Title::makeTitle( NS_TEMPLATE, $result->title ); + $pageLink = $skin->makeKnownLinkObj( $title, '', 'redirect=no' ); + $wlhLink = $skin->makeKnownLinkObj( + Title::makeTitle( NS_SPECIAL, 'Whatlinkshere' ), + wfMsgHtml( 'unusedtemplateswlh' ), + 'target=' . $title->getPrefixedUrl() ); + return wfSpecialList( $pageLink, $wlhLink ); + } + + function getPageHeader() { + global $wgOut; + return $wgOut->parse( wfMsg( 'unusedtemplatestext' ) ); + } + +} + +function wfSpecialUnusedtemplates() { + list( $limit, $offset ) = wfCheckLimits(); + $utp = new UnusedtemplatesPage(); + $utp->doQuery( $offset, $limit ); +} + +?> -- cgit v1.2.3-54-g00ecf