r23280 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23279‎ | r23280 | r23281 >
Date:04:36, 23 June 2007
Author:robchurch
Status:old
Tags:
Comment:
Remove old SpecialListredirects page
Modified paths:
  • /branches/robchurch/reports/includes/AutoLoader.php (modified) (history)
  • /branches/robchurch/reports/includes/QueryPage.php (modified) (history)
  • /branches/robchurch/reports/includes/SpecialListredirects.php (deleted) (history)

Diff [purge]

Index: branches/robchurch/reports/includes/SpecialListredirects.php
@@ -1,65 +0,0 @@
2 -<?php
3 -/**
4 - * @addtogroup SpecialPage
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 - * Special:Listredirects - Lists all the redirects on the wiki.
13 - * @addtogroup SpecialPage
14 - */
15 -class ListredirectsPage extends QueryPage {
16 -
17 - function getName() { return( 'Listredirects' ); }
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 - $page = $dbr->tableName( 'page' );
25 - $sql = "SELECT 'Listredirects' AS type, page_title AS title, page_namespace AS namespace, 0 AS value FROM $page WHERE page_is_redirect = 1";
26 - return( $sql );
27 - }
28 -
29 - function formatResult( $skin, $result ) {
30 - global $wgContLang;
31 -
32 - # Make a link to the redirect itself
33 - $rd_title = Title::makeTitle( $result->namespace, $result->title );
34 - $arr = $wgContLang->getArrow() . $wgContLang->getDirMark();
35 - $rd_link = $skin->makeKnownLinkObj( $rd_title, '', 'redirect=no' );
36 -
37 - # Find out where the redirect leads
38 - $revision = Revision::newFromTitle( $rd_title );
39 - if( $revision ) {
40 - # Make a link to the destination page
41 - $target = Title::newFromRedirect( $revision->getText() );
42 - if( $target ) {
43 - $targetLink = $skin->makeLinkObj( $target );
44 - } else {
45 - /** @todo Put in some decent error display here */
46 - $targetLink = '*';
47 - }
48 - } else {
49 - /** @todo Put in some decent error display here */
50 - $targetLink = '*';
51 - }
52 -
53 - # Format the whole thing and return it
54 - return "$rd_link $arr $targetLink";
55 -
56 - }
57 -
58 -}
59 -
60 -function wfSpecialListredirects() {
61 - list( $limit, $offset ) = wfCheckLimits();
62 - $lrp = new ListredirectsPage();
63 - $lrp->doQuery( $offset, $limit );
64 -}
65 -
66 -?>
Index: branches/robchurch/reports/includes/AutoLoader.php
@@ -182,7 +182,6 @@
183183 'ImportStringSource' => 'includes/SpecialImport.php',
184184 'ImportStreamSource' => 'includes/SpecialImport.php',
185185 'IPUnblockForm' => 'includes/SpecialIpblocklist.php',
186 - 'ListredirectsPage' => 'includes/SpecialListredirects.php',
187186 'DBLockForm' => 'includes/SpecialLockdb.php',
188187 'LogReader' => 'includes/SpecialLog.php',
189188 'LogViewer' => 'includes/SpecialLog.php',
Index: branches/robchurch/reports/includes/QueryPage.php
@@ -19,7 +19,6 @@
2020 array( 'DeadendPagesPage', 'Deadendpages' ),
2121 array( 'DisambiguationsPage', 'Disambiguations' ),
2222 array( 'DoubleRedirectsPage', 'DoubleRedirects' ),
23 - array( 'ListredirectsPage', 'Listredirects' ),
2423 array( 'LonelyPagesPage', 'Lonelypages' ),
2524 array( 'LongPagesPage', 'Longpages' ),
2625 array( 'MostcategoriesPage', 'Mostcategories' ),

Status & tagging log