MediaWiki  1.27.2
SpecialProtectedpages.php
Go to the documentation of this file.
1 <?php
30  protected $IdLevel = 'level';
31  protected $IdType = 'type';
32 
33  public function __construct() {
34  parent::__construct( 'Protectedpages' );
35  }
36 
37  public function execute( $par ) {
38  $this->setHeaders();
39  $this->outputHeader();
40  $this->getOutput()->addModuleStyles( 'mediawiki.special' );
41 
42  $request = $this->getRequest();
43  $type = $request->getVal( $this->IdType );
44  $level = $request->getVal( $this->IdLevel );
45  $sizetype = $request->getVal( 'sizetype' );
46  $size = $request->getIntOrNull( 'size' );
47  $ns = $request->getIntOrNull( 'namespace' );
48  $indefOnly = $request->getBool( 'indefonly' ) ? 1 : 0;
49  $cascadeOnly = $request->getBool( 'cascadeonly' ) ? 1 : 0;
50  $noRedirect = $request->getBool( 'noredirect' ) ? 1 : 0;
51 
52  $pager = new ProtectedPagesPager(
53  $this,
54  [],
55  $type,
56  $level,
57  $ns,
58  $sizetype,
59  $size,
60  $indefOnly,
61  $cascadeOnly,
62  $noRedirect
63  );
64 
65  $this->getOutput()->addHTML( $this->showOptions(
66  $ns,
67  $type,
68  $level,
69  $sizetype,
70  $size,
71  $indefOnly,
72  $cascadeOnly,
73  $noRedirect
74  ) );
75 
76  if ( $pager->getNumRows() ) {
77  $this->getOutput()->addParserOutputContent( $pager->getFullOutput() );
78  } else {
79  $this->getOutput()->addWikiMsg( 'protectedpagesempty' );
80  }
81  }
82 
94  protected function showOptions( $namespace, $type = 'edit', $level, $sizetype,
95  $size, $indefOnly, $cascadeOnly, $noRedirect
96  ) {
97  $title = $this->getPageTitle();
98 
99  return Xml::openElement( 'form', [ 'method' => 'get', 'action' => wfScript() ] ) .
100  Xml::openElement( 'fieldset' ) .
101  Xml::element( 'legend', [], $this->msg( 'protectedpages' )->text() ) .
102  Html::hidden( 'title', $title->getPrefixedDBkey() ) . "\n" .
103  $this->getNamespaceMenu( $namespace ) . "\n" .
104  $this->getTypeMenu( $type ) . "\n" .
105  $this->getLevelMenu( $level ) . "\n" .
106  "<br />\n" .
107  $this->getExpiryCheck( $indefOnly ) . "\n" .
108  $this->getCascadeCheck( $cascadeOnly ) . "\n" .
109  $this->getRedirectCheck( $noRedirect ) . "\n" .
110  "<br />\n" .
111  $this->getSizeLimit( $sizetype, $size ) . "\n" .
112  Xml::submitButton( $this->msg( 'protectedpages-submit' )->text() ) . "\n" .
113  Xml::closeElement( 'fieldset' ) .
114  Xml::closeElement( 'form' );
115  }
116 
124  protected function getNamespaceMenu( $namespace = null ) {
125  return Html::rawElement( 'span', [ 'class' => 'mw-input-with-label' ],
127  [
128  'selected' => $namespace,
129  'all' => '',
130  'label' => $this->msg( 'namespace' )->text()
131  ], [
132  'name' => 'namespace',
133  'id' => 'namespace',
134  'class' => 'namespaceselector',
135  ]
136  )
137  );
138  }
139 
144  protected function getExpiryCheck( $indefOnly ) {
145  return '<span class="mw-input-with-label">' . Xml::checkLabel(
146  $this->msg( 'protectedpages-indef' )->text(),
147  'indefonly',
148  'indefonly',
149  $indefOnly
150  ) . "</span>\n";
151  }
152 
157  protected function getCascadeCheck( $cascadeOnly ) {
158  return '<span class="mw-input-with-label">' . Xml::checkLabel(
159  $this->msg( 'protectedpages-cascade' )->text(),
160  'cascadeonly',
161  'cascadeonly',
162  $cascadeOnly
163  ) . "</span>\n";
164  }
165 
170  protected function getRedirectCheck( $noRedirect ) {
171  return '<span class="mw-input-with-label">' . Xml::checkLabel(
172  $this->msg( 'protectedpages-noredirect' )->text(),
173  'noredirect',
174  'noredirect',
175  $noRedirect
176  ) . "</span>\n";
177  }
178 
184  protected function getSizeLimit( $sizetype, $size ) {
185  $max = $sizetype === 'max';
186 
187  return '<span class="mw-input-with-label">' . Xml::radioLabel(
188  $this->msg( 'minimum-size' )->text(),
189  'sizetype',
190  'min',
191  'wpmin',
192  !$max
193  ) .
194  ' ' .
196  $this->msg( 'maximum-size' )->text(),
197  'sizetype',
198  'max',
199  'wpmax',
200  $max
201  ) .
202  ' ' .
203  Xml::input( 'size', 9, $size, [ 'id' => 'wpsize' ] ) .
204  ' ' .
205  Xml::label( $this->msg( 'pagesize' )->text(), 'wpsize' ) . "</span>\n";
206  }
207 
213  protected function getTypeMenu( $pr_type ) {
214  $m = []; // Temporary array
215  $options = [];
216 
217  // First pass to load the log names
218  foreach ( Title::getFilteredRestrictionTypes( true ) as $type ) {
219  // Messages: restriction-edit, restriction-move, restriction-create, restriction-upload
220  $text = $this->msg( "restriction-$type" )->text();
221  $m[$text] = $type;
222  }
223 
224  // Third pass generates sorted XHTML content
225  foreach ( $m as $text => $type ) {
226  $selected = ( $type == $pr_type );
227  $options[] = Xml::option( $text, $type, $selected ) . "\n";
228  }
229 
230  return '<span class="mw-input-with-label">' .
231  Xml::label( $this->msg( 'restriction-type' )->text(), $this->IdType ) . ' ' .
232  Xml::tags( 'select',
233  [ 'id' => $this->IdType, 'name' => $this->IdType ],
234  implode( "\n", $options ) ) . "</span>";
235  }
236 
242  protected function getLevelMenu( $pr_level ) {
243  // Temporary array
244  $m = [ $this->msg( 'restriction-level-all' )->text() => 0 ];
245  $options = [];
246 
247  // First pass to load the log names
248  foreach ( $this->getConfig()->get( 'RestrictionLevels' ) as $type ) {
249  // Messages used can be 'restriction-level-sysop' and 'restriction-level-autoconfirmed'
250  if ( $type != '' && $type != '*' ) {
251  $text = $this->msg( "restriction-level-$type" )->text();
252  $m[$text] = $type;
253  }
254  }
255 
256  // Third pass generates sorted XHTML content
257  foreach ( $m as $text => $type ) {
258  $selected = ( $type == $pr_level );
259  $options[] = Xml::option( $text, $type, $selected );
260  }
261 
262  return '<span class="mw-input-with-label">' .
263  Xml::label( $this->msg( 'restriction-level' )->text(), $this->IdLevel ) . ' ' .
264  Xml::tags( 'select',
265  [ 'id' => $this->IdLevel, 'name' => $this->IdLevel ],
266  implode( "\n", $options ) ) . "</span>";
267  }
268 
269  protected function getGroupName() {
270  return 'maintenance';
271  }
272 }
273 
279  public $mForm, $mConds;
281 
282  function __construct( $form, $conds = [], $type, $level, $namespace,
283  $sizetype = '', $size = 0, $indefonly = false, $cascadeonly = false, $noredirect = false
284  ) {
285  $this->mForm = $form;
286  $this->mConds = $conds;
287  $this->type = ( $type ) ? $type : 'edit';
288  $this->level = $level;
289  $this->namespace = $namespace;
290  $this->sizetype = $sizetype;
291  $this->size = intval( $size );
292  $this->indefonly = (bool)$indefonly;
293  $this->cascadeonly = (bool)$cascadeonly;
294  $this->noredirect = (bool)$noredirect;
295  parent::__construct( $form->getContext() );
296  }
297 
299  # Do a link batch query
300  $lb = new LinkBatch;
301  $userids = [];
302 
303  foreach ( $result as $row ) {
304  $lb->add( $row->page_namespace, $row->page_title );
305  // field is nullable, maybe null on old protections
306  if ( $row->log_user !== null ) {
307  $userids[] = $row->log_user;
308  }
309  }
310 
311  // fill LinkBatch with user page and user talk
312  if ( count( $userids ) ) {
313  $userCache = UserCache::singleton();
314  $userCache->doQuery( $userids, [], __METHOD__ );
315  foreach ( $userids as $userid ) {
316  $name = $userCache->getProp( $userid, 'name' );
317  if ( $name !== false ) {
318  $lb->add( NS_USER, $name );
319  $lb->add( NS_USER_TALK, $name );
320  }
321  }
322  }
323 
324  $lb->execute();
325  }
326 
327  function getFieldNames() {
328  static $headers = null;
329 
330  if ( $headers == [] ) {
331  $headers = [
332  'log_timestamp' => 'protectedpages-timestamp',
333  'pr_page' => 'protectedpages-page',
334  'pr_expiry' => 'protectedpages-expiry',
335  'log_user' => 'protectedpages-performer',
336  'pr_params' => 'protectedpages-params',
337  'log_comment' => 'protectedpages-reason',
338  ];
339  foreach ( $headers as $key => $val ) {
340  $headers[$key] = $this->msg( $val )->text();
341  }
342  }
343 
344  return $headers;
345  }
346 
353  function formatValue( $field, $value ) {
355  $row = $this->mCurrentRow;
356 
357  $formatted = '';
358 
359  switch ( $field ) {
360  case 'log_timestamp':
361  // when timestamp is null, this is a old protection row
362  if ( $value === null ) {
363  $formatted = Html::rawElement(
364  'span',
365  [ 'class' => 'mw-protectedpages-unknown' ],
366  $this->msg( 'protectedpages-unknown-timestamp' )->escaped()
367  );
368  } else {
369  $formatted = htmlspecialchars( $this->getLanguage()->userTimeAndDate(
370  $value, $this->getUser() ) );
371  }
372  break;
373 
374  case 'pr_page':
375  $title = Title::makeTitleSafe( $row->page_namespace, $row->page_title );
376  if ( !$title ) {
377  $formatted = Html::element(
378  'span',
379  [ 'class' => 'mw-invalidtitle' ],
381  $this->getContext(),
382  $row->page_namespace,
383  $row->page_title
384  )
385  );
386  } else {
387  $formatted = Linker::link( $title );
388  }
389  if ( !is_null( $row->page_len ) ) {
390  $formatted .= $this->getLanguage()->getDirMark() .
391  ' ' . Html::rawElement(
392  'span',
393  [ 'class' => 'mw-protectedpages-length' ],
394  Linker::formatRevisionSize( $row->page_len )
395  );
396  }
397  break;
398 
399  case 'pr_expiry':
400  $formatted = htmlspecialchars( $this->getLanguage()->formatExpiry(
401  $value, /* User preference timezone */true ) );
402  $title = Title::makeTitleSafe( $row->page_namespace, $row->page_title );
403  if ( $this->getUser()->isAllowed( 'protect' ) && $title ) {
404  $changeProtection = Linker::linkKnown(
405  $title,
406  $this->msg( 'protect_change' )->escaped(),
407  [],
408  [ 'action' => 'unprotect' ]
409  );
410  $formatted .= ' ' . Html::rawElement(
411  'span',
412  [ 'class' => 'mw-protectedpages-actions' ],
413  $this->msg( 'parentheses' )->rawParams( $changeProtection )->escaped()
414  );
415  }
416  break;
417 
418  case 'log_user':
419  // when timestamp is null, this is a old protection row
420  if ( $row->log_timestamp === null ) {
421  $formatted = Html::rawElement(
422  'span',
423  [ 'class' => 'mw-protectedpages-unknown' ],
424  $this->msg( 'protectedpages-unknown-performer' )->escaped()
425  );
426  } else {
427  $username = UserCache::singleton()->getProp( $value, 'name' );
429  $row->log_deleted,
431  $this->getUser()
432  ) ) {
433  if ( $username === false ) {
434  $formatted = htmlspecialchars( $value );
435  } else {
436  $formatted = Linker::userLink( $value, $username )
438  }
439  } else {
440  $formatted = $this->msg( 'rev-deleted-user' )->escaped();
441  }
443  $formatted = '<span class="history-deleted">' . $formatted . '</span>';
444  }
445  }
446  break;
447 
448  case 'pr_params':
449  $params = [];
450  // Messages: restriction-level-sysop, restriction-level-autoconfirmed
451  $params[] = $this->msg( 'restriction-level-' . $row->pr_level )->escaped();
452  if ( $row->pr_cascade ) {
453  $params[] = $this->msg( 'protect-summary-cascade' )->escaped();
454  }
455  $formatted = $this->getLanguage()->commaList( $params );
456  break;
457 
458  case 'log_comment':
459  // when timestamp is null, this is an old protection row
460  if ( $row->log_timestamp === null ) {
461  $formatted = Html::rawElement(
462  'span',
463  [ 'class' => 'mw-protectedpages-unknown' ],
464  $this->msg( 'protectedpages-unknown-reason' )->escaped()
465  );
466  } else {
468  $row->log_deleted,
470  $this->getUser()
471  ) ) {
472  $formatted = Linker::formatComment( $value !== null ? $value : '' );
473  } else {
474  $formatted = $this->msg( 'rev-deleted-comment' )->escaped();
475  }
477  $formatted = '<span class="history-deleted">' . $formatted . '</span>';
478  }
479  }
480  break;
481 
482  default:
483  throw new MWException( "Unknown field '$field'" );
484  }
485 
486  return $formatted;
487  }
488 
489  function getQueryInfo() {
490  $conds = $this->mConds;
491  $conds[] = 'pr_expiry > ' . $this->mDb->addQuotes( $this->mDb->timestamp() ) .
492  ' OR pr_expiry IS NULL';
493  $conds[] = 'page_id=pr_page';
494  $conds[] = 'pr_type=' . $this->mDb->addQuotes( $this->type );
495 
496  if ( $this->sizetype == 'min' ) {
497  $conds[] = 'page_len>=' . $this->size;
498  } elseif ( $this->sizetype == 'max' ) {
499  $conds[] = 'page_len<=' . $this->size;
500  }
501 
502  if ( $this->indefonly ) {
503  $infinity = $this->mDb->addQuotes( $this->mDb->getInfinity() );
504  $conds[] = "pr_expiry = $infinity OR pr_expiry IS NULL";
505  }
506  if ( $this->cascadeonly ) {
507  $conds[] = 'pr_cascade = 1';
508  }
509  if ( $this->noredirect ) {
510  $conds[] = 'page_is_redirect = 0';
511  }
512 
513  if ( $this->level ) {
514  $conds[] = 'pr_level=' . $this->mDb->addQuotes( $this->level );
515  }
516  if ( !is_null( $this->namespace ) ) {
517  $conds[] = 'page_namespace=' . $this->mDb->addQuotes( $this->namespace );
518  }
519 
520  return [
521  'tables' => [ 'page', 'page_restrictions', 'log_search', 'logging' ],
522  'fields' => [
523  'pr_id',
524  'page_namespace',
525  'page_title',
526  'page_len',
527  'pr_type',
528  'pr_level',
529  'pr_expiry',
530  'pr_cascade',
531  'log_timestamp',
532  'log_user',
533  'log_comment',
534  'log_deleted',
535  ],
536  'conds' => $conds,
537  'join_conds' => [
538  'log_search' => [
539  'LEFT JOIN', [
540  'ls_field' => 'pr_id', 'ls_value = pr_id'
541  ]
542  ],
543  'logging' => [
544  'LEFT JOIN', [
545  'ls_log_id = log_id'
546  ]
547  ]
548  ]
549  ];
550  }
551 
552  protected function getTableClass() {
553  return parent::getTableClass() . ' mw-protectedpages';
554  }
555 
556  function getIndexField() {
557  return 'pr_id';
558  }
559 
560  function getDefaultSort() {
561  return 'pr_id';
562  }
563 
564  function isFieldSortable( $field ) {
565  // no index for sorting exists
566  return false;
567  }
568 }
Table-based display with a user-selectable sort order.
Definition: TablePager.php:28
getLanguage()
Get the Language object.
static linkKnown($target, $html=null, $customAttribs=[], $query=[], $options=[ 'known', 'noclasses'])
Identical to link(), except $options defaults to 'known'.
Definition: Linker.php:264
magic word the default is to use $key to get the and $key value or $key value text $key value html to format the value $key
Definition: hooks.txt:2321
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.
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:210
static formatRevisionSize($size)
Definition: Linker.php:1678
static hidden($name, $value, array $attribs=[])
Convenience function to produce an input element with type=hidden.
Definition: Html.php:759
$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:2542
static submitButton($value, $attribs=[])
Convenience function to build an HTML submit button When $wgUseMediaWikiUIEverywhere is true it will ...
Definition: Xml.php:460
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':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:1796
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:31
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
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:1004
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
__construct($form, $conds=[], $type, $level, $namespace, $sizetype= '', $size=0, $indefonly=false, $cascadeonly=false, $noredirect=false)
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:548
namespace and then decline to actually register it file or subcat img or subcat $title
Definition: hooks.txt:912
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:1290
static link($target, $html=null, $customAttribs=[], $query=[], $options=[])
This function returns an HTML link to the given target.
Definition: Linker.php:195
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:1102
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:762
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:2418
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:1133
showOptions($namespace, $type= 'edit', $level, $sizetype, $size, $indefOnly, $cascadeOnly, $noRedirect)
add($ns, $dbkey)
Definition: LinkBatch.php:74
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:432
getRequest()
Get the WebRequest being used for this instance.
A special page that lists protected pages.
const NS_USER_TALK
Definition: Defines.php:72
static element($element, $attribs=[], $contents= '')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
Definition: Html.php:230
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:2338
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:847
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:310