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
{
33 function __construct( $name = 'Withoutinterwiki' ) {
34 parent
::__construct( $name );
37 function execute( $par ) {
38 $this->prefix
= Title
::capitalize(
39 $this->getRequest()->getVal( 'prefix', $par ), NS_MAIN
);
40 parent
::execute( $par );
43 function getPageHeader() {
44 # Do not show useless input form if special page is cached
45 if ( $this->isCached() ) {
51 'label-message' => 'allpagesprefix',
56 'default' => $this->prefix
60 $htmlForm = HTMLForm
::factory( 'ooui', $formDescriptor, $this->getContext() );
61 $htmlForm->setWrapperLegend( '' )
62 ->setSubmitTextMsg( 'withoutinterwiki-submit' )
65 ->displayForm( false );
68 function sortDescending() {
72 function getOrderFields() {
73 return [ 'page_namespace', 'page_title' ];
76 function isExpensive() {
80 function isSyndicated() {
84 function getQueryInfo() {
86 'tables' => [ 'page', 'langlinks' ],
88 'namespace' => 'page_namespace',
89 'title' => 'page_title',
90 'value' => 'page_title'
94 'page_namespace' => MWNamespace
::getContentNamespaces(),
95 'page_is_redirect' => 0
97 'join_conds' => [ 'langlinks' => [ 'LEFT JOIN', 'll_from = page_id' ] ]
99 if ( $this->prefix
) {
100 $dbr = wfGetDB( DB_REPLICA
);
101 $query['conds'][] = 'page_title ' . $dbr->buildLike( $this->prefix
, $dbr->anyString() );
107 protected function getGroupName() {
108 return 'maintenance';