Removed allpagesformtext1 and allpagesformtext2, obsolete
[mediawiki.git] / includes / SpecialDisambiguations.php
blob2522e6668a4fbe023991ecfb2858fa2bcebe63d4
1 <?php
2 /**
4 * @package MediaWiki
5 * @subpackage SpecialPage
6 */
8 /**
11 require_once('QueryPage.php');
13 /**
15 * @package MediaWiki
16 * @subpackage SpecialPage
18 class DisambiguationsPage extends PageQueryPage {
20 function getName() {
21 return 'disambiguations';
24 function isExpensive( ) { return true; }
25 function isSyndicated() { return false; }
27 function getPageHeader( ) {
28 global $wgUser;
29 $sk = $wgUser->getSkin();
31 #FIXME : probably need to add a backlink to the maintenance page.
32 return '<p>'.wfMsg("disambiguationstext", $sk->makeKnownLink(wfMsgForContent('disambiguationspage')) )."</p><br />\n";
35 function getSQL() {
36 $dbr =& wfGetDB( DB_SLAVE );
37 extract( $dbr->tableNames( 'page', 'links' ) );
39 $dp = Title::newFromText(wfMsgForContent("disambiguationspage"));
40 $dns = $dp->getNamespace();
41 $dtitle = $dbr->addQuotes( $dp->getDBkey() );
43 $sql = "SELECT 'Disambiguations' as type,"
44 . " pa.page_namespace AS namespace, pa.page_title AS title"
45 . " FROM {$links} as la, {$links} as lb, {$page} as pa, {$page} as pb"
46 . " WHERE pb.page_namespace = $dns"
47 . " AND pb.page_title = $dtitle"
48 . " AND la.l_from = lb.l_to"
49 . " AND pa.page_id = lb.l_from"
50 . " AND pb.page_id = lb.l_to" ;
52 return $sql;
55 function getOrder() {
56 return '';
59 function formatResult( $skin, $result ) {
60 global $wgContLang ;
61 $dp = Title::newFromText(wfMsgForContent("disambiguationspage"));
62 $title = Title::makeTitle( $result->namespace, $result->title );
64 $from = $skin->makeKnownLinkObj( $title,'');
65 $edit = $skin->makeBrokenLinkObj( $title, "(".wfMsg("qbedit").")" , 'redirect=no');
66 $to = $skin->makeKnownLinkObj( $dp,'');
68 return "$from $edit => $to";
72 /**
73 * Constructor
75 function wfSpecialDisambiguations() {
76 list( $limit, $offset ) = wfCheckLimits();
78 $sd = new DisambiguationsPage();
80 return $sd->doQuery( $offset, $limit );