43 parent::__construct(
'Prefixindex' );
57 $out->addModuleStyles(
'mediawiki.special' );
61 $from =
$request->getVal(
'from',
'' );
62 $prefix =
$request->getVal(
'prefix',
'' );
63 $ns =
$request->getIntOrNull(
'namespace' );
64 $namespace = (int)$ns;
65 $this->hideRedirects =
$request->getBool(
'hideredirects', $this->hideRedirects );
66 $this->stripPrefix =
$request->getBool(
'stripprefix', $this->stripPrefix );
70 ( $namespace > 0 && array_key_exists( $namespace,
$namespaces ) )
71 ? $this->
msg(
'prefixindex-namespace', str_replace(
'_',
' ',
$namespaces[$namespace] ) )
72 : $this->
msg(
'prefixindex' )
76 if ( $par !==
null ) {
78 } elseif ( $prefix !=
'' ) {
80 } elseif ( $from !=
'' && $ns ===
null ) {
87 if ( $this->
including() || $showme !=
'' || $ns !==
null ) {
101 $out = Xml::openElement(
'div', [
'class' =>
'namespaceoptions' ] );
102 $out .= Xml::openElement(
104 [
'method' =>
'get',
'action' => $this->
getConfig()->
get(
'Script' ) ]
107 $out .= Xml::openElement(
'fieldset' );
108 $out .= Xml::element(
'legend',
null, $this->
msg(
'allpages' )->
text() );
109 $out .= Xml::openElement(
'table', [
'id' =>
'nsselect',
'class' =>
'allpages' ] );
111 <td class='mw-label'>" .
112 Xml::label( $this->
msg(
'allpagesprefix' )->
text(),
'nsfrom' ) .
114 <td class='mw-input'>" .
115 Xml::input(
'prefix', 30, str_replace(
'_',
' ', $from ), [
'id' =>
'nsfrom' ] ) .
119 <td class='mw-label'>" .
120 Xml::label( $this->
msg(
'namespace' )->
text(),
'namespace' ) .
122 <td class='mw-input'>" .
123 Html::namespaceSelector( [
124 'selected' => $namespace,
126 'name' =>
'namespace',
128 'class' =>
'namespaceselector',
131 $this->
msg(
'allpages-hide-redirects' )->
text(),
137 $this->
msg(
'prefixindex-strip' )->
text(),
142 Xml::submitButton( $this->
msg(
'prefixindex-submit' )->
text() ) .
145 $out .= Xml::closeElement(
'table' );
146 $out .= Xml::closeElement(
'fieldset' );
147 $out .= Xml::closeElement(
'form' );
148 $out .= Xml::closeElement(
'div' );
161 if ( $from ===
null ) {
172 if ( !$prefixList || !$fromList ) {
173 $out = $this->
msg(
'allpagesbadtitle' )->parseAsBlock();
174 } elseif ( !array_key_exists( $namespace,
$namespaces ) ) {
176 $out = $this->
msg(
'allpages-bad-ns', $namespace )->parse();
179 list( $namespace, $prefixKey, $prefix ) = $prefixList;
180 list( , $fromKey, ) = $fromList;
182 # ## @todo FIXME: Should complain if $fromNs != $namespace
187 'page_namespace' => $namespace,
188 'page_title' .
$dbr->buildLike( $prefixKey,
$dbr->anyString() ),
189 'page_title >= ' .
$dbr->addQuotes( $fromKey ),
192 if ( $this->hideRedirects ) {
193 $conds[
'page_is_redirect'] = 0;
198 [
'page_namespace',
'page_title' ],
199 LinkCache::getSelectFields()
204 'ORDER BY' =>
'page_title',
205 'LIMIT' => $this->maxPerPage + 1,
206 'USE INDEX' =>
'name_title',
212 if (
$res->numRows() > 0 ) {
213 $out = Html::openElement(
'ul', [
'class' =>
'mw-prefixindex-list' ] );
214 $linkCache = MediaWikiServices::getInstance()->getLinkCache();
216 $prefixLength = strlen( $prefix );
217 foreach (
$res as $row ) {
218 if ( $n >= $this->maxPerPage ) {
222 $title = Title::newFromRow( $row );
224 $linkCache->addGoodLinkObjFromRow( $title, $row );
225 $displayed = $title->getText();
227 if ( $this->stripPrefix && $prefixLength !== strlen( $displayed ) ) {
228 $displayed = substr( $displayed, $prefixLength );
230 $link = ( $title->isRedirect() ?
'<div class="allpagesredirect">' :
'' ) .
235 ( $title->isRedirect() ?
'</div>' :
'' );
237 $out .=
"<li>$link</li>\n";
241 $out .= Html::closeElement(
'ul' );
243 if (
$res->numRows() > 2 ) {
246 $out = Html::rawElement(
'div', [
'class' =>
'mw-prefixindex-body' ],
$out );
264 if (
$res && ( $n == $this->maxPerPage ) && $nextRow ) {
266 'from' => $nextRow->page_title,
272 if ( $namespace || $prefix ==
'' ) {
275 $query[
'namespace'] = $namespace;
280 $this->
msg(
'nextpage', str_replace(
'_',
' ', $nextRow->page_title ) )->text(),
286 $topOut .= Html::rawElement(
'div',
287 [
'class' =>
'mw-prefixindex-nav' ],
292 $out .=
"\n" . Html::element(
'hr' ) .
295 [
'class' =>
'mw-prefixindex-nav' ],
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.
Implements Special:Allpages.
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.
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.
prefixSearchString( $search, $limit, $offset)
Perform a regular substring search for prefixSearchSubpages.
Implements Special:Prefixindex.
namespacePrefixForm( $namespace=NS_MAIN, $from='')
HTML for the top form.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
prefixSearchSubpages( $search, $limit, $offset)
Return an array of subpages beginning with $search that this special page will accept.
$stripPrefix
Whether to remove the searched prefix from the displayed link.
execute( $par)
Entry point : initialise variables and call subfunctions.
showPrefixChunk( $namespace=NS_MAIN, $prefix, $from=null)
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
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the local content language as $wgContLang
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
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
usually copyright or history_copyright This message must be in HTML not wikitext & $link
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