50 parent::__construct( $name );
64 $out->allowClickjacking();
67 $from =
$request->getVal(
'from',
null );
68 $to =
$request->getVal(
'to',
null );
69 $namespace =
$request->getInt(
'namespace' );
71 $miserMode = (bool)$this->
getConfig()->get(
'MiserMode' );
74 $hideredirects =
$request->getBool(
'hideredirects',
false ) && !$miserMode;
79 ( $namespace > 0 && array_key_exists( $namespace,
$namespaces ) ) ?
80 $this->
msg(
'allinnamespace', str_replace(
'_',
' ',
$namespaces[$namespace] ) ) :
81 $this->
msg(
'allarticles' )
83 $out->addModuleStyles(
'mediawiki.special' );
85 if ( $par !==
null ) {
86 $this->
showChunk( $namespace, $par, $to, $hideredirects );
87 } elseif ( $from !==
null && $to ===
null ) {
88 $this->
showChunk( $namespace, $from, $to, $hideredirects );
90 $this->
showToplevel( $namespace, $from, $to, $hideredirects );
103 $from =
'', $to =
'', $hideRedirects =
false
105 $miserMode = (bool)$this->
getConfig()->get(
'MiserMode' );
112 'label-message' =>
'allpagesfrom',
113 'default' => str_replace(
'_',
' ', $from ),
120 'label-message' =>
'allpagesto',
121 'default' => str_replace(
'_',
' ', $to ),
124 'type' =>
'namespaceselect',
125 'name' =>
'namespace',
127 'label-message' =>
'namespace',
129 'value' => $namespace,
133 'name' =>
'hideredirects',
134 'id' =>
'hidredirects',
135 'label-message' =>
'allpages-hide-redirects',
136 'value' => $hideRedirects,
141 unset( $fields[
'hideredirects'] );
144 $form = HTMLForm::factory(
'table', $fields, $this->
getContext() );
145 $form->setMethod(
'get' )
146 ->setWrapperLegendMsg(
'allpages' )
147 ->setSubmitTextMsg(
'allpagessubmit' )
149 ->displayForm(
false );
159 $from = Title::makeTitleSafe( $namespace, $from );
160 $to = Title::makeTitleSafe( $namespace, $to );
161 $from = ( $from && $from->isLocal() ) ? $from->getDBkey() :
null;
162 $to = ( $to && $to->isLocal() ) ? $to->getDBkey() :
null;
164 $this->
showChunk( $namespace, $from, $to, $hideredirects );
173 function showChunk( $namespace =
NS_MAIN, $from =
false, $to =
false, $hideredirects =
false ) {
182 if ( !$fromList || !$toList ) {
183 $out = $this->
msg(
'allpagesbadtitle' )->parseAsBlock();
184 } elseif ( !array_key_exists( $namespace,
$namespaces ) ) {
186 $out = $this->
msg(
'allpages-bad-ns', $namespace )->parse();
189 list( $namespace, $fromKey, $from ) = $fromList;
190 list( , $toKey, $to ) = $toList;
193 $filterConds = [
'page_namespace' => $namespace ];
194 if ( $hideredirects ) {
195 $filterConds[
'page_is_redirect'] = 0;
198 $conds = $filterConds;
199 $conds[] =
'page_title >= ' .
$dbr->addQuotes( $fromKey );
200 if ( $toKey !==
"" ) {
201 $conds[] =
'page_title <= ' .
$dbr->addQuotes( $toKey );
205 [
'page_namespace',
'page_title',
'page_is_redirect',
'page_id' ],
209 'ORDER BY' =>
'page_title',
210 'LIMIT' => $this->maxPerPage + 1,
211 'USE INDEX' =>
'name_title',
216 if (
$res->numRows() > 0 ) {
217 $out = Html::openElement(
'ul', [
'class' =>
'mw-allpages-chunk' ] );
219 while ( ( $n < $this->maxPerPage ) && (
$s =
$res->fetchObject() ) ) {
220 $t = Title::newFromRow(
$s );
223 (
$s->page_is_redirect ?
' class="allpagesredirect"' :
'' ) .
228 $out .=
'<li>[[' . htmlspecialchars(
$s->page_title ) .
"]]</li>\n";
232 $out .= Html::closeElement(
'ul' );
234 if (
$res->numRows() > 2 ) {
237 $out = Html::rawElement(
'div', [
'class' =>
'mw-allpages-body' ],
$out );
243 if ( $fromKey !==
'' && !$this->
including() ) {
244 # Get the first title from previous chunk
245 $prevConds = $filterConds;
246 $prevConds[] =
'page_title < ' .
$dbr->addQuotes( $fromKey );
247 $prevKey =
$dbr->selectField(
252 [
'ORDER BY' =>
'page_title DESC',
'OFFSET' => $this->maxPerPage - 1 ]
255 if ( $prevKey ===
false ) {
256 # The previous chunk is not complete, need to link to the very first title
257 # available in the database
258 $prevKey =
$dbr->selectField(
263 [
'ORDER BY' =>
'page_title' ]
267 if ( $prevKey !==
false ) {
268 $prevTitle = Title::makeTitle( $namespace, $prevKey );
284 $query = [
'from' => $prevTitle->getText() ];
287 $query[
'namespace'] = $namespace;
290 if ( $hideredirects ) {
291 $query[
'hideredirects'] = $hideredirects;
296 $this->
msg(
'prevpage', $prevTitle->getText() )->text(),
304 if ( $n == $this->maxPerPage &&
$s =
$res->fetchObject() ) {
305 # $s is the first link of the next chunk
306 $t = Title::makeTitle( $namespace,
$s->page_title );
307 $query = [
'from' =>
$t->getText() ];
310 $query[
'namespace'] = $namespace;
313 if ( $hideredirects ) {
314 $query[
'hideredirects'] = $hideredirects;
319 $this->
msg(
'nextpage',
$t->getText() )->text(),
327 if ( count( $navLinks ) ) {
329 $pagination = Html::rawElement(
'div',
330 [
'class' =>
'mw-allpages-nav' ],
334 $output->addHTML( $pagination );
335 $out .= Html::element(
'hr' ) . $pagination;
348 # shortcut for common case
349 return [ $ns,
'',
'' ];
352 $t = Title::makeTitleSafe( $ns, $text );
353 if (
$t &&
$t->isLocal() ) {
354 return [
$t->getNamespace(),
$t->getDBkey(),
$t->getText() ];
359 # try again, in case the problem was an empty pagename
360 $text = preg_replace(
'/(#|$)/',
'X$1', $text );
361 $t = Title::makeTitleSafe( $ns, $text );
362 if (
$t &&
$t->isLocal() ) {
363 return [
$t->getNamespace(),
'',
'' ];
within a display generated by the Derivative if and wherever such third party notices normally appear The contents of the NOTICE file are for informational purposes only and do not modify the License You may add Your own attribution notices within Derivative Works that You alongside or as an addendum to the NOTICE text from the provided that such additional attribution notices cannot be construed as modifying the License You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for or distribution of Your or for any such Derivative Works as a provided Your and distribution of the Work otherwise complies with the conditions stated in this License Submission of Contributions Unless You explicitly state any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this without any additional terms or conditions Notwithstanding the nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions Trademarks This License does not grant permission to use the trade service or product names of the except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file Disclaimer of Warranty Unless required by applicable law or agreed to in Licensor provides the WITHOUT WARRANTIES OR CONDITIONS OF ANY either express or including
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
Shortcut to construct an includable special page.
Implements Special:Allpages.
$maxPerPage
Maximum number of pages to show on single subpage.
__construct( $name='Allpages')
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
showToplevel( $namespace=NS_MAIN, $from='', $to='', $hideredirects=false)
execute( $par)
Entry point : initialise variables and call subfunctions.
prefixSearchSubpages( $search, $limit, $offset)
Return an array of subpages beginning with $search that this special page will accept.
showChunk( $namespace=NS_MAIN, $from=false, $to=false, $hideredirects=false)
$nsfromMsg
Determines, which message describes the input field 'nsfrom'.
outputHTMLForm( $namespace=NS_MAIN, $from='', $to='', $hideRedirects=false)
Outputs the HTMLForm used on this page.
getNamespaceKeyAndText( $ns, $text)
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getOutput()
Get the OutputPage being used for this instance.
getContext()
Gets the context this SpecialPage is executed in.
msg( $key)
Wrapper around wfMessage that sets the current context.
getConfig()
Shortcut to get main config object.
getRequest()
Get the WebRequest being used for this instance.
getPageTitle( $subpage=false)
Get a self-referential title object.
getLanguage()
Shortcut to get user's language.
prefixSearchString( $search, $limit, $offset)
Perform a regular substring search for prefixSearchSubpages.
MediaWiki Linker LinkRenderer null $linkRenderer
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on $request
static configuration should be added through ResourceLoaderGetConfigVars instead can be used to get the real title after the basic globals have been set but before ordinary actions take place $output
namespace and then decline to actually register it & $namespaces
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out
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