Add the other existing $skin.css/.js to the message files too to be consistent
[mediawiki.git] / includes / SpecialWithoutinterwiki.php
blob2092e43b52490e7319a7aec0101b450f704c146b
1 <?php
2 /**
3 * @file
4 * @ingroup SpecialPage
5 */
7 /**
8 * Special page lists pages without language links
10 * @ingroup SpecialPage
11 * @author Rob Church <robchur@gmail.com>
13 class WithoutInterwikiPage extends PageQueryPage {
14 private $prefix = '';
16 function getName() {
17 return 'Withoutinterwiki';
20 function getPageHeader() {
21 global $wgScript, $wgMiserMode;
23 # Do not show useless input form if wiki is running in misermode
24 if( $wgMiserMode ) {
25 return '';
28 $prefix = $this->prefix;
29 $t = SpecialPage::getTitleFor( $this->getName() );
31 return Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) .
32 Xml::openElement( 'fieldset' ) .
33 Xml::element( 'legend', null, wfMsg( 'withoutinterwiki-legend' ) ) .
34 Xml::hidden( 'title', $t->getPrefixedText() ) .
35 Xml::inputLabel( wfMsg( 'allpagesprefix' ), 'prefix', 'wiprefix', 20, $prefix ) . ' ' .
36 Xml::submitButton( wfMsg( 'withoutinterwiki-submit' ) ) .
37 Xml::closeElement( 'fieldset' ) .
38 Xml::closeElement( 'form' );
41 function sortDescending() {
42 return false;
45 function isExpensive() {
46 return true;
49 function isSyndicated() {
50 return false;
53 function getSQL() {
54 $dbr = wfGetDB( DB_SLAVE );
55 list( $page, $langlinks ) = $dbr->tableNamesN( 'page', 'langlinks' );
56 $prefix = $this->prefix ? "AND page_title LIKE '" . $dbr->escapeLike( $this->prefix ) . "%'" : '';
57 return
58 "SELECT 'Withoutinterwiki' AS type,
59 page_namespace AS namespace,
60 page_title AS title,
61 page_title AS value
62 FROM $page
63 LEFT JOIN $langlinks
64 ON ll_from = page_id
65 WHERE ll_title IS NULL
66 AND page_namespace=" . NS_MAIN . "
67 AND page_is_redirect = 0
68 {$prefix}";
71 function setPrefix( $prefix = '' ) {
72 $this->prefix = $prefix;
77 function wfSpecialWithoutinterwiki() {
78 global $wgRequest, $wgContLang, $wgCapitalLinks;
79 list( $limit, $offset ) = wfCheckLimits();
80 if( $wgCapitalLinks ) {
81 $prefix = $wgContLang->ucfirst( $wgRequest->getVal( 'prefix' ) );
82 } else {
83 $prefix = $wgRequest->getVal( 'prefix' );
85 $wip = new WithoutInterwikiPage();
86 $wip->setPrefix( $prefix );
87 $wip->doQuery( $offset, $limit );