38 $this->mSort = $this->
getRequest()->getText(
'sort' );
39 if ( !array_key_exists( $this->mSort, $this->
getFieldNames() )
46 } elseif ( $this->
getRequest()->getBool(
'desc' ) ) {
50 parent::__construct();
69 return parent::getBody();
82 $body = parent::getBody();
101 $body = parent::getBody();
104 $pout->
setText( $navigation . $body . $navigation );
120 foreach ( $fields
as $field =>
$name ) {
121 if ( strval(
$name ) ==
'' ) {
122 $s .= Html::rawElement(
'th', [],
' ' ) .
"\n";
128 if ( $this->mSort == $field ) {
133 $class =
"$sortClass TablePager_sort-descending";
138 $class =
"$sortClass TablePager_sort-ascending";
145 $s .= Html::rawElement(
'th', [
'class' => $class ],
$link ) .
"\n";
147 $s .= Html::element(
'th', [],
$name ) .
"\n";
152 $ret = Html::openElement(
'table', [
153 'class' =>
"mw-datatable $tableClass" ]
155 $ret .= Html::rawElement(
'thead', [], Html::rawElement(
'tr', [],
"\n" .
$s .
"\n" ) );
156 $ret .= Html::openElement(
'tbody' ) .
"\n";
166 return "</tbody></table>\n";
175 $msgEmpty = $this->
msg(
'table_pager_empty' )->text();
176 return Html::rawElement(
'tr', [],
177 Html::element(
'td', [
'colspan' => $colspan ], $msgEmpty ) );
186 $this->mCurrentRow = $row;
187 $s = Html::openElement(
'tr', $this->
getRowAttrs( $row ) ) .
"\n";
190 foreach ( $fieldNames
as $field =>
$name ) {
191 $value = isset( $row->$field ) ? $row->$field :
null;
194 if ( $formatted ==
'' ) {
195 $formatted =
' ';
201 $s .= Html::closeElement(
'tr' ) .
"\n";
228 if ( $class ===
'' ) {
255 return [
'class' =>
'TablePager_col_' . $field ];
277 return 'TablePager_nav';
284 return 'TablePager_sort';
297 'first' =>
'table_pager_first',
298 'prev' =>
'table_pager_prev',
299 'next' =>
'table_pager_next',
300 'last' =>
'table_pager_last',
305 foreach ( $labels
as $type => $label ) {
306 $msgLabel = $this->
msg( $label )->escaped();
307 $linkTexts[
$type] =
"<div class='TablePager_nav-enabled'>$msgLabel</div>";
308 $disabledTexts[
$type] =
"<div class='TablePager_nav-disabled'>$msgLabel</div>";
312 $s = Html::openElement(
'table', [
'class' => $this->
getNavClass() ] );
313 $s .= Html::openElement(
'tr' ) .
"\n";
314 $width = 100 / count( $links ) .
'%';
315 foreach ( $labels
as $type => $label ) {
319 $s .= Html::rawElement(
'td',
320 [
'style' =>
"width: $width;",
'class' =>
"TablePager_nav-$type" ],
321 $links[
$type] ) .
"\n";
323 $s .= Html::closeElement(
'tr' ) . Html::closeElement(
'table' ) .
"\n";
333 return [
'mediawiki.pager.tablePager' ];
343 $select =
new XmlSelect(
'limit',
false, $this->mLimit );
348 return $select->getHTML();
359 # Add the current limit from the query string
360 # to avoid that the limit is lost after clicking Go next time
361 if ( !in_array( $this->mLimit, $this->mLimitsShown ) ) {
363 sort( $this->mLimitsShown );
366 foreach ( $this->mLimitsShown
as $key =>
$value ) {
367 # The pair is either $index => $limit, in which case the $value
368 # will be numeric, or $limit => $text, in which case the $value
391 $blacklist = (
array)$blacklist;
393 foreach ( $blacklist
as $name ) {
409 return Html::rawElement(
425 # Make the select with some explanatory text
426 $msgSubmit = $this->
msg(
'table_pager_limit_submit' )->escaped();
428 return $this->
msg(
'table_pager_limit' )
430 "\n<input type=\"submit\" value=\"$msgSubmit\"/>\n" .
wfScript( $script='index')
Get the path to a specified script file, respecting file extensions; this is a wrapper around $wgScri...
getRequest()
Get the WebRequest object.
msg()
Get a Message object with context set Parameters are the same as wfMessage()
getOutput()
Get the OutputPage object.
getLanguage()
Get the Language object.
setContext(IContextSource $context)
Set the IContextSource object.
Class for generating HTML <select> or <datalist> elements.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
the array() calling protocol came about after MediaWiki 1.4rc1.
namespace are movable Hooks may change this value to override the return value of MWNamespace::isMovable(). 'NewDifferenceEngine' do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached one of or reset my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled allows for interception of redirect as a string mapping parameter names to values & $type
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context the output can only depend on parameters provided to this hook not on global state indicating whether full HTML should be generated If generation of HTML may be but other information should still be present in the ParserOutput object to manipulate or replace but no entry for that model exists in $wgContentHandlers if desired whether it is OK to use $contentModel on $title Handler functions that modify $ok should generally return false to prevent further hooks from further modifying $ok inclusive $limit
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
usually copyright or history_copyright This message must be in HTML not wikitext & $link
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing & $attribs
Allows to change the fields on the form that will be generated $name
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
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Interface for objects which can provide a MediaWiki context on request.