4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 * http://www.gnu.org/copyleft/gpl.html
21 * Special page lists pages without language links
24 * @ingroup SpecialPage
25 * @author Rob Church <robchur@gmail.com>
27 class WithoutInterwikiPage
extends PageQueryPage
{
31 return 'Withoutinterwiki';
34 function getPageHeader() {
35 global $wgScript, $wgMiserMode;
37 # Do not show useless input form if wiki is running in misermode
42 $prefix = $this->prefix
;
43 $t = SpecialPage
::getTitleFor( $this->getName() );
45 return Xml
::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) .
46 Xml
::openElement( 'fieldset' ) .
47 Xml
::element( 'legend', null, wfMsg( 'withoutinterwiki-legend' ) ) .
48 Xml
::hidden( 'title', $t->getPrefixedText() ) .
49 Xml
::inputLabel( wfMsg( 'allpagesprefix' ), 'prefix', 'wiprefix', 20, $prefix ) . ' ' .
50 Xml
::submitButton( wfMsg( 'withoutinterwiki-submit' ) ) .
51 Xml
::closeElement( 'fieldset' ) .
52 Xml
::closeElement( 'form' );
55 function sortDescending() {
59 function isExpensive() {
63 function isSyndicated() {
68 $dbr = wfGetDB( DB_SLAVE
);
69 list( $page, $langlinks ) = $dbr->tableNamesN( 'page', 'langlinks' );
70 $prefix = $this->prefix ?
'AND page_title' . $dbr->buildLike( $this->prefix
, $dbr->anyString() ) : '';
72 "SELECT 'Withoutinterwiki' AS type,
73 page_namespace AS namespace,
79 WHERE ll_title IS NULL
80 AND page_namespace=" . NS_MAIN
. "
81 AND page_is_redirect = 0
85 function setPrefix( $prefix = '' ) {
86 $this->prefix
= $prefix;
91 function wfSpecialWithoutinterwiki() {
92 global $wgRequest, $wgContLang;
93 list( $limit, $offset ) = wfCheckLimits();
94 // Only searching the mainspace anyway
95 $prefix = Title
::capitalize( $wgRequest->getVal( 'prefix' ), NS_MAIN
);
96 $wip = new WithoutInterwikiPage();
97 $wip->setPrefix( $prefix );
98 $wip->doQuery( $offset, $limit );