Go to the documentation of this file.
45 parent::__construct(
'Prefixindex' );
59 $out->addModuleStyles(
'mediawiki.special' );
63 $from = $request->getVal(
'from',
'' );
64 $prefix = $request->getVal(
'prefix',
'' );
65 $ns = $request->getIntOrNull(
'namespace' );
66 $namespace = (int)$ns;
67 $this->hideRedirects = $request->getBool(
'hideredirects', $this->hideRedirects );
68 $this->stripPrefix = $request->getBool(
'stripprefix', $this->stripPrefix );
69 $this->columns = $request->getInt(
'columns', $this->columns );
73 ( $namespace > 0 && array_key_exists( $namespace,
$namespaces ) )
74 ? $this->
msg(
'prefixindex-namespace', str_replace(
'_',
' ',
$namespaces[$namespace] ) )
75 : $this->
msg(
'prefixindex' )
79 if ( isset( $par ) ) {
81 } elseif ( $prefix !=
'' ) {
83 } elseif (
$from !=
'' && $ns ===
null ) {
90 if ( $this->
including() || $showme !=
'' || $ns !==
null ) {
113 <td class='mw-label'>" .
116 <td class='mw-input'>" .
121 <td class='mw-label'>" .
124 <td class='mw-input'>" .
126 'selected' => $namespace,
128 'name' =>
'namespace',
130 'class' =>
'namespaceselector',
133 $this->
msg(
'allpages-hide-redirects' )->
text(),
139 $this->
msg(
'prefixindex-strip' )->
text(),
163 if (
$from ===
null ) {
171 if ( !$prefixList || !$fromList ) {
172 $out = $this->
msg(
'allpagesbadtitle' )->parseAsBlock();
173 } elseif ( !array_key_exists( $namespace,
$namespaces ) ) {
175 $out = $this->
msg(
'allpages-bad-ns', $namespace )->parse();
178 list( $namespace, $prefixKey, $prefix ) = $prefixList;
179 list( , $fromKey, ) = $fromList;
181 ### @todo FIXME: Should complain if $fromNs != $namespace
186 'page_namespace' => $namespace,
187 'page_title' .
$dbr->buildLike( $prefixKey,
$dbr->anyString() ),
188 'page_title >= ' .
$dbr->addQuotes( $fromKey ),
191 if ( $this->hideRedirects ) {
192 $conds[
'page_is_redirect'] = 0;
196 array(
'page_namespace',
'page_title',
'page_is_redirect' ),
200 'ORDER BY' =>
'page_title',
201 'LIMIT' => $this->maxPerPage + 1,
202 'USE INDEX' =>
'name_title',
206 ### @todo FIXME: Side link to previous
209 if (
$res->numRows() > 0 ) {
212 $prefixLength = strlen( $prefix );
213 while ( ( $n < $this->maxPerPage ) && (
$s =
$res->fetchObject() ) ) {
216 $displayed =
$t->getText();
218 if ( $this->stripPrefix && $prefixLength !== strlen( $displayed ) ) {
219 $displayed = substr( $displayed, $prefixLength );
221 $link = (
$s->page_is_redirect ?
'<div class="allpagesredirect">' :
'' ) .
224 htmlspecialchars( $displayed ),
225 $s->page_is_redirect ?
array(
'class' =>
'mw-redirect' ) :
array()
227 (
$s->page_is_redirect ?
'</div>' :
'' );
229 $link =
'[[' . htmlspecialchars(
$s->page_title ) .
']]';
231 if (
$n % $this->columns == 0 ) {
234 $out .=
"<td>$link</td>";
236 if (
$n % $this->columns == 0 ) {
241 if (
$n % $this->columns != 0 ) {
262 <td id="mw-prefixindex-nav-form" class="mw-prefixindex-nav">';
264 if ( isset(
$res ) &&
$res && (
$n == $this->maxPerPage ) &&
265 (
$s =
$res->fetchObject() )
268 'from' =>
$s->page_title,
270 'hideredirects' => $this->hideRedirects,
271 'stripprefix' => $this->stripPrefix,
272 'columns' => $this->columns,
275 if ( $namespace || $prefix ==
'' ) {
278 $query[
'namespace'] = $namespace;
283 $this->
msg(
'nextpage', str_replace(
'_',
' ',
$s->page_title ) )->escaped(),
293 array(
'class' =>
'mw-prefixindex-nav' ),
297 $out2 .=
"</td></tr>" .
static checkLabel( $label, $name, $id, $checked=false, $attribs=array())
Convenience function to build an HTML checkbox with a label.
getPageTitle( $subpage=false)
Get a self-referential title object.
static & makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
getOutput()
Get the OutputPage being used for this instance.
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
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
static hidden( $name, $value, $attribs=array())
Convenience function to produce an input element with type=hidden.
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 content language as $wgContLang
showPrefixChunk( $namespace=NS_MAIN, $prefix, $from=null)
execute( $par)
Entry point : initialise variables and call subfunctions.
set to $title object and return false for a match for latest after cache objects are set use the ContentHandler facility to handle CSS and JavaScript for highlighting & $link
static openElement( $element, $attribs=null)
This opens an XML element.
static linkKnown( $target, $html=null, $customAttribs=array(), $query=array(), $options=array( 'known', 'noclasses'))
Identical to link(), except $options defaults to 'known'.
static element( $element, $attribs=array(), $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
$stripPrefix
Whether to remove the searched prefix from the displayed link.
static element( $element, $attribs=null, $contents='', $allowShortTag=true)
Format an XML element with given attributes and, optionally, text content.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
when a variable name is used in a it is silently declared as a new masking the global
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
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
namespacePrefixForm( $namespace=NS_MAIN, $from='')
HTML for the top form.
msg()
Wrapper around wfMessage that sets the current context.
getRequest()
Get the WebRequest being used for this instance.
getNamespaceKeyAndText( $ns, $text)
namespace and then decline to actually register it & $namespaces
static closeElement( $element)
Shortcut to close an XML element.
static namespaceSelector(array $params=array(), array $selectAttribs=array())
Build a drop-down box for selecting a namespace.
static submitButton( $value, $attribs=array())
Convenience function to build an HTML submit button.
Implements Special:Allpages.
static input( $name, $size=false, $value=false, $attribs=array())
Convenience function to build an HTML text input field.
static rawElement( $element, $attribs=array(), $contents='')
Returns an HTML element in a string.
static label( $label, $id, $attribs=array())
Convenience function to build an HTML form label.
return true to allow those checks to and false if checking is done use this to change the tables headers temp or archived zone change it to an object instance and return false override the list derivative used the name of the old file when set the default code will be skipped add a value to it if you want to add a cookie that have to vary cache options can modify $query
Implements Special:Prefixindex.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
including( $x=null)
Whether the special page is being evaluated via transclusion.