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