MediaWiki  1.28.1
SpecialProtectedpages.php
Go to the documentation of this file.
1 <?php
25 
32  protected $IdLevel = 'level';
33  protected $IdType = 'type';
34 
35  public function __construct() {
36  parent::__construct( 'Protectedpages' );
37  }
38 
39  public function execute( $par ) {
40  $this->setHeaders();
41  $this->outputHeader();
42  $this->getOutput()->addModuleStyles( 'mediawiki.special' );
43 
44  $request = $this->getRequest();
45  $type = $request->getVal( $this->IdType );
46  $level = $request->getVal( $this->IdLevel );
47  $sizetype = $request->getVal( 'sizetype' );
48  $size = $request->getIntOrNull( 'size' );
49  $ns = $request->getIntOrNull( 'namespace' );
50  $indefOnly = $request->getBool( 'indefonly' ) ? 1 : 0;
51  $cascadeOnly = $request->getBool( 'cascadeonly' ) ? 1 : 0;
52  $noRedirect = $request->getBool( 'noredirect' ) ? 1 : 0;
53 
54  $pager = new ProtectedPagesPager(
55  $this,
56  [],
57  $type,
58  $level,
59  $ns,
60  $sizetype,
61  $size,
62  $indefOnly,
63  $cascadeOnly,
64  $noRedirect,
65  $this->getLinkRenderer()
66  );
67 
68  $this->getOutput()->addHTML( $this->showOptions(
69  $ns,
70  $type,
71  $level,
72  $sizetype,
73  $size,
74  $indefOnly,
75  $cascadeOnly,
76  $noRedirect
77  ) );
78 
79  if ( $pager->getNumRows() ) {
80  $this->getOutput()->addParserOutputContent( $pager->getFullOutput() );
81  } else {
82  $this->getOutput()->addWikiMsg( 'protectedpagesempty' );
83  }
84  }
85 
97  protected function showOptions( $namespace, $type = 'edit', $level, $sizetype,
98  $size, $indefOnly, $cascadeOnly, $noRedirect
99  ) {
100  $title = $this->getPageTitle();
101 
102  return Xml::openElement( 'form', [ 'method' => 'get', 'action' => wfScript() ] ) .
103  Xml::openElement( 'fieldset' ) .
104  Xml::element( 'legend', [], $this->msg( 'protectedpages' )->text() ) .
105  Html::hidden( 'title', $title->getPrefixedDBkey() ) . "\n" .
106  $this->getNamespaceMenu( $namespace ) . "\n" .
107  $this->getTypeMenu( $type ) . "\n" .
108  $this->getLevelMenu( $level ) . "\n" .
109  "<br />\n" .
110  $this->getExpiryCheck( $indefOnly ) . "\n" .
111  $this->getCascadeCheck( $cascadeOnly ) . "\n" .
112  $this->getRedirectCheck( $noRedirect ) . "\n" .
113  "<br />\n" .
114  $this->getSizeLimit( $sizetype, $size ) . "\n" .
115  Xml::submitButton( $this->msg( 'protectedpages-submit' )->text() ) . "\n" .
116  Xml::closeElement( 'fieldset' ) .
117  Xml::closeElement( 'form' );
118  }
119 
127  protected function getNamespaceMenu( $namespace = null ) {
128  return Html::rawElement( 'span', [ 'class' => 'mw-input-with-label' ],
130  [
131  'selected' => $namespace,
132  'all' => '',
133  'label' => $this->msg( 'namespace' )->text()
134  ], [
135  'name' => 'namespace',
136  'id' => 'namespace',
137  'class' => 'namespaceselector',
138  ]
139  )
140  );
141  }
142 
147  protected function getExpiryCheck( $indefOnly ) {
148  return '<span class="mw-input-with-label">' . Xml::checkLabel(
149  $this->msg( 'protectedpages-indef' )->text(),
150  'indefonly',
151  'indefonly',
152  $indefOnly
153  ) . "</span>\n";
154  }
155 
160  protected function getCascadeCheck( $cascadeOnly ) {
161  return '<span class="mw-input-with-label">' . Xml::checkLabel(
162  $this->msg( 'protectedpages-cascade' )->text(),
163  'cascadeonly',
164  'cascadeonly',
165  $cascadeOnly
166  ) . "</span>\n";
167  }
168 
173  protected function getRedirectCheck( $noRedirect ) {
174  return '<span class="mw-input-with-label">' . Xml::checkLabel(
175  $this->msg( 'protectedpages-noredirect' )->text(),
176  'noredirect',
177  'noredirect',
178  $noRedirect
179  ) . "</span>\n";
180  }
181 
187  protected function getSizeLimit( $sizetype, $size ) {
188  $max = $sizetype === 'max';
189 
190  return '<span class="mw-input-with-label">' . Xml::radioLabel(
191  $this->msg( 'minimum-size' )->text(),
192  'sizetype',
193  'min',
194  'wpmin',
195  !$max
196  ) .
197  ' ' .
199  $this->msg( 'maximum-size' )->text(),
200  'sizetype',
201  'max',
202  'wpmax',
203  $max
204  ) .
205  ' ' .
206  Xml::input( 'size', 9, $size, [ 'id' => 'wpsize' ] ) .
207  ' ' .
208  Xml::label( $this->msg( 'pagesize' )->text(), 'wpsize' ) . "</span>\n";
209  }
210 
216  protected function getTypeMenu( $pr_type ) {
217  $m = []; // Temporary array
218  $options = [];
219 
220  // First pass to load the log names
221  foreach ( Title::getFilteredRestrictionTypes( true ) as $type ) {
222  // Messages: restriction-edit, restriction-move, restriction-create, restriction-upload
223  $text = $this->msg( "restriction-$type" )->text();
224  $m[$text] = $type;
225  }
226 
227  // Third pass generates sorted XHTML content
228  foreach ( $m as $text => $type ) {
229  $selected = ( $type == $pr_type );
230  $options[] = Xml::option( $text, $type, $selected ) . "\n";
231  }
232 
233  return '<span class="mw-input-with-label">' .
234  Xml::label( $this->msg( 'restriction-type' )->text(), $this->IdType ) . ' ' .
235  Xml::tags( 'select',
236  [ 'id' => $this->IdType, 'name' => $this->IdType ],
237  implode( "\n", $options ) ) . "</span>";
238  }
239 
245  protected function getLevelMenu( $pr_level ) {
246  // Temporary array
247  $m = [ $this->msg( 'restriction-level-all' )->text() => 0 ];
248  $options = [];
249 
250  // First pass to load the log names
251  foreach ( $this->getConfig()->get( 'RestrictionLevels' ) as $type ) {
252  // Messages used can be 'restriction-level-sysop' and 'restriction-level-autoconfirmed'
253  if ( $type != '' && $type != '*' ) {
254  $text = $this->msg( "restriction-level-$type" )->text();
255  $m[$text] = $type;
256  }
257  }
258 
259  // Third pass generates sorted XHTML content
260  foreach ( $m as $text => $type ) {
261  $selected = ( $type == $pr_level );
262  $options[] = Xml::option( $text, $type, $selected );
263  }
264 
265  return '<span class="mw-input-with-label">' .
266  Xml::label( $this->msg( 'restriction-level' )->text(), $this->IdLevel ) . ' ' .
267  Xml::tags( 'select',
268  [ 'id' => $this->IdLevel, 'name' => $this->IdLevel ],
269  implode( "\n", $options ) ) . "</span>";
270  }
271 
272  protected function getGroupName() {
273  return 'maintenance';
274  }
275 }
276 
282  public $mForm, $mConds;
284 
288  private $linkRenderer;
289 
303  function __construct( $form, $conds = [], $type, $level, $namespace,
304  $sizetype = '', $size = 0, $indefonly = false, $cascadeonly = false, $noredirect = false,
306  ) {
307  $this->mForm = $form;
308  $this->mConds = $conds;
309  $this->type = ( $type ) ? $type : 'edit';
310  $this->level = $level;
311  $this->namespace = $namespace;
312  $this->sizetype = $sizetype;
313  $this->size = intval( $size );
314  $this->indefonly = (bool)$indefonly;
315  $this->cascadeonly = (bool)$cascadeonly;
316  $this->noredirect = (bool)$noredirect;
317  $this->linkRenderer = $linkRenderer;
318  parent::__construct( $form->getContext() );
319  }
320 
322  # Do a link batch query
323  $lb = new LinkBatch;
324  $userids = [];
325 
326  foreach ( $result as $row ) {
327  $lb->add( $row->page_namespace, $row->page_title );
328  // field is nullable, maybe null on old protections
329  if ( $row->log_user !== null ) {
330  $userids[] = $row->log_user;
331  }
332  }
333 
334  // fill LinkBatch with user page and user talk
335  if ( count( $userids ) ) {
336  $userCache = UserCache::singleton();
337  $userCache->doQuery( $userids, [], __METHOD__ );
338  foreach ( $userids as $userid ) {
339  $name = $userCache->getProp( $userid, 'name' );
340  if ( $name !== false ) {
341  $lb->add( NS_USER, $name );
342  $lb->add( NS_USER_TALK, $name );
343  }
344  }
345  }
346 
347  $lb->execute();
348  }
349 
350  function getFieldNames() {
351  static $headers = null;
352 
353  if ( $headers == [] ) {
354  $headers = [
355  'log_timestamp' => 'protectedpages-timestamp',
356  'pr_page' => 'protectedpages-page',
357  'pr_expiry' => 'protectedpages-expiry',
358  'log_user' => 'protectedpages-performer',
359  'pr_params' => 'protectedpages-params',
360  'log_comment' => 'protectedpages-reason',
361  ];
362  foreach ( $headers as $key => $val ) {
363  $headers[$key] = $this->msg( $val )->text();
364  }
365  }
366 
367  return $headers;
368  }
369 
376  function formatValue( $field, $value ) {
378  $row = $this->mCurrentRow;
379 
380  switch ( $field ) {
381  case 'log_timestamp':
382  // when timestamp is null, this is a old protection row
383  if ( $value === null ) {
384  $formatted = Html::rawElement(
385  'span',
386  [ 'class' => 'mw-protectedpages-unknown' ],
387  $this->msg( 'protectedpages-unknown-timestamp' )->escaped()
388  );
389  } else {
390  $formatted = htmlspecialchars( $this->getLanguage()->userTimeAndDate(
391  $value, $this->getUser() ) );
392  }
393  break;
394 
395  case 'pr_page':
396  $title = Title::makeTitleSafe( $row->page_namespace, $row->page_title );
397  if ( !$title ) {
398  $formatted = Html::element(
399  'span',
400  [ 'class' => 'mw-invalidtitle' ],
402  $this->getContext(),
403  $row->page_namespace,
404  $row->page_title
405  )
406  );
407  } else {
408  $formatted = $this->linkRenderer->makeLink( $title );
409  }
410  if ( !is_null( $row->page_len ) ) {
411  $formatted .= $this->getLanguage()->getDirMark() .
412  ' ' . Html::rawElement(
413  'span',
414  [ 'class' => 'mw-protectedpages-length' ],
415  Linker::formatRevisionSize( $row->page_len )
416  );
417  }
418  break;
419 
420  case 'pr_expiry':
421  $formatted = htmlspecialchars( $this->getLanguage()->formatExpiry(
422  $value, /* User preference timezone */true ) );
423  $title = Title::makeTitleSafe( $row->page_namespace, $row->page_title );
424  if ( $this->getUser()->isAllowed( 'protect' ) && $title ) {
425  $changeProtection = $this->linkRenderer->makeKnownLink(
426  $title,
427  $this->msg( 'protect_change' )->text(),
428  [],
429  [ 'action' => 'unprotect' ]
430  );
431  $formatted .= ' ' . Html::rawElement(
432  'span',
433  [ 'class' => 'mw-protectedpages-actions' ],
434  $this->msg( 'parentheses' )->rawParams( $changeProtection )->escaped()
435  );
436  }
437  break;
438 
439  case 'log_user':
440  // when timestamp is null, this is a old protection row
441  if ( $row->log_timestamp === null ) {
442  $formatted = Html::rawElement(
443  'span',
444  [ 'class' => 'mw-protectedpages-unknown' ],
445  $this->msg( 'protectedpages-unknown-performer' )->escaped()
446  );
447  } else {
448  $username = UserCache::singleton()->getProp( $value, 'name' );
450  $row->log_deleted,
452  $this->getUser()
453  ) ) {
454  if ( $username === false ) {
455  $formatted = htmlspecialchars( $value );
456  } else {
457  $formatted = Linker::userLink( $value, $username )
459  }
460  } else {
461  $formatted = $this->msg( 'rev-deleted-user' )->escaped();
462  }
464  $formatted = '<span class="history-deleted">' . $formatted . '</span>';
465  }
466  }
467  break;
468 
469  case 'pr_params':
470  $params = [];
471  // Messages: restriction-level-sysop, restriction-level-autoconfirmed
472  $params[] = $this->msg( 'restriction-level-' . $row->pr_level )->escaped();
473  if ( $row->pr_cascade ) {
474  $params[] = $this->msg( 'protect-summary-cascade' )->escaped();
475  }
476  $formatted = $this->getLanguage()->commaList( $params );
477  break;
478 
479  case 'log_comment':
480  // when timestamp is null, this is an old protection row
481  if ( $row->log_timestamp === null ) {
482  $formatted = Html::rawElement(
483  'span',
484  [ 'class' => 'mw-protectedpages-unknown' ],
485  $this->msg( 'protectedpages-unknown-reason' )->escaped()
486  );
487  } else {
489  $row->log_deleted,
491  $this->getUser()
492  ) ) {
493  $formatted = Linker::formatComment( $value !== null ? $value : '' );
494  } else {
495  $formatted = $this->msg( 'rev-deleted-comment' )->escaped();
496  }
498  $formatted = '<span class="history-deleted">' . $formatted . '</span>';
499  }
500  }
501  break;
502 
503  default:
504  throw new MWException( "Unknown field '$field'" );
505  }
506 
507  return $formatted;
508  }
509 
510  function getQueryInfo() {
511  $conds = $this->mConds;
512  $conds[] = 'pr_expiry > ' . $this->mDb->addQuotes( $this->mDb->timestamp() ) .
513  ' OR pr_expiry IS NULL';
514  $conds[] = 'page_id=pr_page';
515  $conds[] = 'pr_type=' . $this->mDb->addQuotes( $this->type );
516 
517  if ( $this->sizetype == 'min' ) {
518  $conds[] = 'page_len>=' . $this->size;
519  } elseif ( $this->sizetype == 'max' ) {
520  $conds[] = 'page_len<=' . $this->size;
521  }
522 
523  if ( $this->indefonly ) {
524  $infinity = $this->mDb->addQuotes( $this->mDb->getInfinity() );
525  $conds[] = "pr_expiry = $infinity OR pr_expiry IS NULL";
526  }
527  if ( $this->cascadeonly ) {
528  $conds[] = 'pr_cascade = 1';
529  }
530  if ( $this->noredirect ) {
531  $conds[] = 'page_is_redirect = 0';
532  }
533 
534  if ( $this->level ) {
535  $conds[] = 'pr_level=' . $this->mDb->addQuotes( $this->level );
536  }
537  if ( !is_null( $this->namespace ) ) {
538  $conds[] = 'page_namespace=' . $this->mDb->addQuotes( $this->namespace );
539  }
540 
541  return [
542  'tables' => [ 'page', 'page_restrictions', 'log_search', 'logging' ],
543  'fields' => [
544  'pr_id',
545  'page_namespace',
546  'page_title',
547  'page_len',
548  'pr_type',
549  'pr_level',
550  'pr_expiry',
551  'pr_cascade',
552  'log_timestamp',
553  'log_user',
554  'log_comment',
555  'log_deleted',
556  ],
557  'conds' => $conds,
558  'join_conds' => [
559  'log_search' => [
560  'LEFT JOIN', [
561  'ls_field' => 'pr_id', 'ls_value = ' . $this->mDb->buildStringCast( 'pr_id' )
562  ]
563  ],
564  'logging' => [
565  'LEFT JOIN', [
566  'ls_log_id = log_id'
567  ]
568  ]
569  ]
570  ];
571  }
572 
573  protected function getTableClass() {
574  return parent::getTableClass() . ' mw-protectedpages';
575  }
576 
577  function getIndexField() {
578  return 'pr_id';
579  }
580 
581  function getDefaultSort() {
582  return 'pr_id';
583  }
584 
585  function isFieldSortable( $field ) {
586  // no index for sorting exists
587  return false;
588  }
589 }
Table-based display with a user-selectable sort order.
Definition: TablePager.php:28
getLanguage()
Get the Language object.
wfScript($script= 'index')
Get the path to a specified script file, respecting file extensions; this is a wrapper around $wgScri...
static isDeleted($row, $field)
static element($element, $attribs=null, $contents= '', $allowShortTag=true)
Format an XML element with given attributes and, optionally, text content.
Definition: Xml.php:39
getLevelMenu($pr_level)
Creates the input label of the restriction level.
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
static radioLabel($label, $name, $value, $id, $checked=false, $attribs=[])
Convenience function to build an HTML radio button with a label.
Definition: Xml.php:445
static rawElement($element, $attribs=[], $contents= '')
Returns an HTML element in a string.
Definition: Html.php:209
static formatRevisionSize($size)
Definition: Linker.php:1573
static hidden($name, $value, array $attribs=[])
Convenience function to produce an input element with type=hidden.
Definition: Html.php:758
$value
static input($name, $size=false, $value=false, $attribs=[])
Convenience function to build an HTML text input field.
Definition: Xml.php:275
msg()
Wrapper around wfMessage that sets the current context.
getOutput()
Get the OutputPage being used for this instance.
static getFilteredRestrictionTypes($exists=true)
Get a filtered list of all restriction types supported by this wiki.
Definition: Title.php:2549
static submitButton($value, $attribs=[])
Convenience function to build an HTML submit button When $wgUseMediaWikiUIEverywhere is true it will ...
Definition: Xml.php:460
__construct($form, $conds=[], $type, $level, $namespace, $sizetype= '', $size=0, $indefonly=false, $cascadeonly=false, $noredirect=false, LinkRenderer $linkRenderer)
static label($label, $id, $attribs=[])
Convenience function to build an HTML form label.
Definition: Xml.php:359
The index of the header message $result[1]=The index of the body text message $result[2 through n]=Parameters passed to body text message.Please note the header message cannot receive/use parameters. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item.Return false to stop further processing of the tag $reader:XMLReader object $logInfo:Array of information 'ImportHandlePageXMLTag':When parsing a XML tag in a page.Return false to stop further processing of the tag $reader:XMLReader object &$pageInfo:Array of information 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision.Return false to stop further processing of the tag $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information 'ImportHandleToplevelXMLTag':When parsing a top level XML tag.Return false to stop further processing of the tag $reader:XMLReader object 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload.Return false to stop further processing of the tag $reader:XMLReader object $revisionInfo:Array of information 'ImportLogInterwikiLink':Hook to change the interwiki link used in log entries and edit summaries for transwiki imports.&$fullInterwikiPrefix:Interwiki prefix, may contain colons.&$pageTitle:String that contains page title. 'ImportSources':Called when reading from the $wgImportSources configuration variable.Can be used to lazy-load the import sources list.&$importSources:The value of $wgImportSources.Modify as necessary.See the comment in DefaultSettings.php for the detail of how to structure this array. 'InfoAction':When building information to display on the action=info page.$context:IContextSource object &$pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect.&$title:Title object for the current page &$request:WebRequest &$ignoreRedirect:boolean to skip redirect check &$target:Title/string of redirect target &$article:Article object 'InternalParseBeforeLinks':during Parser's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings.&$parser:Parser object &$text:string containing partially parsed text &$stripState:Parser's internal StripState object 'InternalParseBeforeSanitize':during Parser's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings.Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments.&$parser:Parser object &$text:string containing partially parsed text &$stripState:Parser's internal StripState object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not.Return true without providing an interwiki to continue interwiki search.$prefix:interwiki prefix we are looking for.&$iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InvalidateEmailComplete':Called after a user's email has been invalidated successfully.$user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification.Callee may modify $url and $query, URL will be constructed as $url.$query &$url:URL to index.php &$query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) &$article:article(object) being checked 'IsTrustedProxy':Override the result of IP::isTrustedProxy() &$ip:IP being check &$result:Change this value to override the result of IP::isTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from &$allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of Sanitizer::validateEmail(), for instance to return false if the domain name doesn't match your organization.$addr:The e-mail address entered by the user &$result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user &$result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we're looking for a messages file for &$file:The messages file path, you can override this to change the location. 'LanguageGetMagic':DEPRECATED!Use $magicWords in a file listed in $wgExtensionMessagesFiles instead.Use this to define synonyms of magic words depending of the language &$magicExtensions:associative array of magic words synonyms $lang:language code(string) 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces.Do not use this hook to add namespaces.Use CanonicalNamespaces for that.&$namespaces:Array of namespaces indexed by their numbers 'LanguageGetSpecialPageAliases':DEPRECATED!Use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead.Use to define aliases of special pages names depending of the language &$specialPageAliases:associative array of magic words synonyms $lang:language code(string) 'LanguageGetTranslatedLanguageNames':Provide translated language names.&$names:array of language code=> language name $code:language of the preferred translations 'LanguageLinks':Manipulate a page's language links.This is called in various places to allow extensions to define the effective language links for a page.$title:The page's Title.&$links:Associative array mapping language codes to prefixed links of the form"language:title".&$linkFlags:Associative array mapping prefixed links to arrays of flags.Currently unused, but planned to provide support for marking individual language links in the UI, e.g.for featured articles. 'LanguageSelector':Hook to change the language selector available on a page.$out:The output page.$cssClassName:CSS class name of the language selector. 'LinkBegin':DEPRECATED!Use HtmlPageLinkRendererBegin instead.Used when generating internal and interwiki links in Linker::link(), before processing starts.Return false to skip default processing and return $ret.See documentation for Linker::link() for details on the expected meanings of parameters.$skin:the Skin object $target:the Title that the link is pointing to &$html:the contents that the< a > tag should have(raw HTML) $result
Definition: hooks.txt:1934
outputHeader($summaryMessageKey= '')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
Class representing a list of titles The execute() method checks them all for existence and adds them ...
Definition: LinkBatch.php:32
static closeElement($element)
Shortcut to close an XML element.
Definition: Xml.php:118
const DELETED_COMMENT
Definition: LogPage.php:34
msg()
Get a Message object with context set Parameters are the same as wfMessage()
Parent class for all special pages.
Definition: SpecialPage.php:36
Class that generates HTML links for pages.
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 $options
Definition: hooks.txt:1046
static option($text, $value=null, $selected=false, $attribs=[])
Convenience function to build an HTML drop-down list item.
Definition: Xml.php:485
static openElement($element, $attribs=null)
This opens an XML element.
Definition: Xml.php:109
getContext()
Get the base IContextSource object.
$params
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes! ...
static makeTitleSafe($ns, $title, $fragment= '', $interwiki= '')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:535
namespace and then decline to actually register it file or subcat img or subcat $title
Definition: hooks.txt:953
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
Definition: design.txt:12
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
Definition: distributors.txt:9
static formatComment($comment, $title=null, $local=false, $wikiId=null)
This function is called by all recent changes variants, by the page history, and by the user contribu...
Definition: Linker.php:1180
const DELETED_USER
Definition: LogPage.php:35
getSizeLimit($sizetype, $size)
static userLink($userId, $userName, $altUserName=false)
Make user link (or user contributions for unregistered users)
Definition: Linker.php:984
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
Definition: injection.txt:35
this hook is for auditing only or null if authentication failed before getting that far $username
Definition: hooks.txt:802
This document describes the state of Postgres support in and is fairly well maintained The main code is very well while extensions are very hit and miss it is probably the most supported database after MySQL Much of the work in making MediaWiki database agnostic came about through the work of creating Postgres as and are nearing end of but without copying over all the usage comments General notes on the but these can almost always be programmed around *Although Postgres has a true BOOLEAN type
Definition: postgres.txt:22
static tags($element, $attribs=null, $contents)
Same as Xml::element(), but does not escape contents.
Definition: Xml.php:131
error also a ContextSource you ll probably need to make sure the header is varied on $request
Definition: hooks.txt:2573
static userCanBitfield($bitfield, $field, User $user=null)
Determine if the current user is allowed to view a particular field of this log row, if it's marked as deleted.
getTypeMenu($pr_type)
Creates the input label of the restriction type.
getConfig()
Shortcut to get main config object.
static userToolLinks($userId, $userText, $redContribsWhenNoEdits=false, $flags=0, $edits=null)
Generate standard user tool links (talk, contributions, block link, etc.)
Definition: Linker.php:1017
showOptions($namespace, $type= 'edit', $level, $sizetype, $size, $indefOnly, $cascadeOnly, $noRedirect)
add($ns, $dbkey)
Definition: LinkBatch.php:79
static checkLabel($label, $name, $id, $checked=false, $attribs=[])
Convenience function to build an HTML checkbox with a label.
Definition: Xml.php:420
static getInvalidTitleDescription(IContextSource $context, $namespace, $title)
Get a message saying that an invalid title was encountered.
Definition: Linker.php:300
getRequest()
Get the WebRequest being used for this instance.
A special page that lists protected pages.
const NS_USER_TALK
Definition: Defines.php:59
static element($element, $attribs=[], $contents= '')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
Definition: Html.php:229
static singleton()
Definition: UserCache.php:34
getUser()
Get the User object.
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
Definition: hooks.txt:2491
getNamespaceMenu($namespace=null)
Prepare the namespace filter drop-down; standard namespace selector, sans the MediaWiki namespace...
getPageTitle($subpage=false)
Get a self-referential title object.
static namespaceSelector(array $params=[], array $selectAttribs=[])
Build a drop-down box for selecting a namespace.
Definition: Html.php:846
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:300