MediaWiki REL1_31
SpecialWithoutinterwiki.php
Go to the documentation of this file.
1<?php
31 private $prefix = '';
32
33 function __construct( $name = 'Withoutinterwiki' ) {
34 parent::__construct( $name );
35 }
36
37 function execute( $par ) {
38 $this->prefix = Title::capitalize(
39 $this->getRequest()->getVal( 'prefix', $par ), NS_MAIN );
40 parent::execute( $par );
41 }
42
43 function getPageHeader() {
44 # Do not show useless input form if special page is cached
45 if ( $this->isCached() ) {
46 return '';
47 }
48
49 $formDescriptor = [
50 'prefix' => [
51 'label-message' => 'allpagesprefix',
52 'name' => 'prefix',
53 'id' => 'wiprefix',
54 'type' => 'text',
55 'size' => 20,
56 'default' => $this->prefix
57 ]
58 ];
59
60 $htmlForm = HTMLForm::factory( 'ooui', $formDescriptor, $this->getContext() );
61 $htmlForm->setWrapperLegend( '' )
62 ->setSubmitTextMsg( 'withoutinterwiki-submit' )
63 ->setMethod( 'get' )
64 ->prepareForm()
65 ->displayForm( false );
66 }
67
68 function sortDescending() {
69 return false;
70 }
71
72 function getOrderFields() {
73 return [ 'page_namespace', 'page_title' ];
74 }
75
76 function isExpensive() {
77 return true;
78 }
79
80 function isSyndicated() {
81 return false;
82 }
83
84 function getQueryInfo() {
85 $query = [
86 'tables' => [ 'page', 'langlinks' ],
87 'fields' => [
88 'namespace' => 'page_namespace',
89 'title' => 'page_title',
90 ],
91 'conds' => [
92 'll_title IS NULL',
93 'page_namespace' => MWNamespace::getContentNamespaces(),
94 'page_is_redirect' => 0
95 ],
96 'join_conds' => [ 'langlinks' => [ 'LEFT JOIN', 'll_from = page_id' ] ]
97 ];
98 if ( $this->prefix ) {
100 $query['conds'][] = 'page_title ' . $dbr->buildLike( $this->prefix, $dbr->anyString() );
101 }
102
103 return $query;
104 }
105
106 protected function getGroupName() {
107 return 'maintenance';
108 }
109}
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
Variant of QueryPage which formats the result as a simple link to the page.
isCached()
Whether or not the output of the page in question is retrieved from the database cache.
getContext()
Gets the context this SpecialPage is executed in.
getRequest()
Get the WebRequest being used for this instance.
Special page lists pages without language links.
isSyndicated()
Sometime we don't want to build rss / atom feeds.
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
execute( $par)
This is the actual workhorse.
getOrderFields()
Subclasses return an array of fields to order by here.
getPageHeader()
The content returned by this function will be output before any result.
isExpensive()
Is this query expensive (for some definition of expensive)? Then we don't let it run in miser mode.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
__construct( $name='Withoutinterwiki')
sortDescending()
Override to sort by increasing values.
null for the local wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
Definition hooks.txt:1620
const NS_MAIN
Definition Defines.php:74
const DB_REPLICA
Definition defines.php:25