MediaWiki  1.32.0
SpecialWhatlinkshere.php
Go to the documentation of this file.
1 <?php
25 
33  protected $opts;
34 
35  protected $selfTitle;
36 
38  protected $target;
39 
40  protected $limits = [ 20, 50, 100, 250, 500 ];
41 
42  public function __construct() {
43  parent::__construct( 'Whatlinkshere' );
44  }
45 
46  function execute( $par ) {
47  $out = $this->getOutput();
48 
49  $this->setHeaders();
50  $this->outputHeader();
51  $this->addHelpLink( 'Help:What links here' );
52 
53  $opts = new FormOptions();
54 
55  $opts->add( 'target', '' );
56  $opts->add( 'namespace', '', FormOptions::INTNULL );
57  $opts->add( 'limit', $this->getConfig()->get( 'QueryPageDefaultLimit' ) );
58  $opts->add( 'from', 0 );
59  $opts->add( 'back', 0 );
60  $opts->add( 'hideredirs', false );
61  $opts->add( 'hidetrans', false );
62  $opts->add( 'hidelinks', false );
63  $opts->add( 'hideimages', false );
64  $opts->add( 'invert', false );
65 
67  $opts->validateIntBounds( 'limit', 0, 5000 );
68 
69  // Give precedence to subpage syntax
70  if ( $par !== null ) {
71  $opts->setValue( 'target', $par );
72  }
73 
74  // Bind to member variable
75  $this->opts = $opts;
76 
77  $this->target = Title::newFromText( $opts->getValue( 'target' ) );
78  if ( !$this->target ) {
79  if ( !$this->including() ) {
80  $out->addHTML( $this->whatlinkshereForm() );
81  }
82 
83  return;
84  }
85 
86  $this->getSkin()->setRelevantTitle( $this->target );
87 
88  $this->selfTitle = $this->getPageTitle( $this->target->getPrefixedDBkey() );
89 
90  $out->setPageTitle( $this->msg( 'whatlinkshere-title', $this->target->getPrefixedText() ) );
91  $out->addBacklinkSubtitle( $this->target );
92  $this->showIndirectLinks(
93  0,
94  $this->target,
95  $opts->getValue( 'limit' ),
96  $opts->getValue( 'from' ),
97  $opts->getValue( 'back' )
98  );
99  }
100 
108  function showIndirectLinks( $level, $target, $limit, $from = 0, $back = 0 ) {
109  $out = $this->getOutput();
110  $dbr = wfGetDB( DB_REPLICA );
111 
112  $hidelinks = $this->opts->getValue( 'hidelinks' );
113  $hideredirs = $this->opts->getValue( 'hideredirs' );
114  $hidetrans = $this->opts->getValue( 'hidetrans' );
115  $hideimages = $target->getNamespace() != NS_FILE || $this->opts->getValue( 'hideimages' );
116 
117  $fetchlinks = ( !$hidelinks || !$hideredirs );
118 
119  // Build query conds in concert for all three tables...
120  $conds['pagelinks'] = [
121  'pl_namespace' => $target->getNamespace(),
122  'pl_title' => $target->getDBkey(),
123  ];
124  $conds['templatelinks'] = [
125  'tl_namespace' => $target->getNamespace(),
126  'tl_title' => $target->getDBkey(),
127  ];
128  $conds['imagelinks'] = [
129  'il_to' => $target->getDBkey(),
130  ];
131 
132  $namespace = $this->opts->getValue( 'namespace' );
133  $invert = $this->opts->getValue( 'invert' );
134  $nsComparison = ( $invert ? '!= ' : '= ' ) . $dbr->addQuotes( $namespace );
135  if ( is_int( $namespace ) ) {
136  $conds['pagelinks'][] = "pl_from_namespace $nsComparison";
137  $conds['templatelinks'][] = "tl_from_namespace $nsComparison";
138  $conds['imagelinks'][] = "il_from_namespace $nsComparison";
139  }
140 
141  if ( $from ) {
142  $conds['templatelinks'][] = "tl_from >= $from";
143  $conds['pagelinks'][] = "pl_from >= $from";
144  $conds['imagelinks'][] = "il_from >= $from";
145  }
146 
147  if ( $hideredirs ) {
148  $conds['pagelinks']['rd_from'] = null;
149  } elseif ( $hidelinks ) {
150  $conds['pagelinks'][] = 'rd_from is NOT NULL';
151  }
152 
153  $queryFunc = function ( IDatabase $dbr, $table, $fromCol ) use (
154  $conds, $target, $limit
155  ) {
156  // Read an extra row as an at-end check
157  $queryLimit = $limit + 1;
158  $on = [
159  "rd_from = $fromCol",
160  'rd_title' => $target->getDBkey(),
161  'rd_interwiki = ' . $dbr->addQuotes( '' ) . ' OR rd_interwiki IS NULL'
162  ];
163  $on['rd_namespace'] = $target->getNamespace();
164  // Inner LIMIT is 2X in case of stale backlinks with wrong namespaces
165  $subQuery = $dbr->buildSelectSubquery(
166  [ $table, 'redirect', 'page' ],
167  [ $fromCol, 'rd_from' ],
168  $conds[$table],
169  __CLASS__ . '::showIndirectLinks',
170  // Force JOIN order per T106682 to avoid large filesorts
171  [ 'ORDER BY' => $fromCol, 'LIMIT' => 2 * $queryLimit, 'STRAIGHT_JOIN' ],
172  [
173  'page' => [ 'INNER JOIN', "$fromCol = page_id" ],
174  'redirect' => [ 'LEFT JOIN', $on ]
175  ]
176  );
177  return $dbr->select(
178  [ 'page', 'temp_backlink_range' => $subQuery ],
179  [ 'page_id', 'page_namespace', 'page_title', 'rd_from', 'page_is_redirect' ],
180  [],
181  __CLASS__ . '::showIndirectLinks',
182  [ 'ORDER BY' => 'page_id', 'LIMIT' => $queryLimit ],
183  [ 'page' => [ 'INNER JOIN', "$fromCol = page_id" ] ]
184  );
185  };
186 
187  if ( $fetchlinks ) {
188  $plRes = $queryFunc( $dbr, 'pagelinks', 'pl_from' );
189  }
190 
191  if ( !$hidetrans ) {
192  $tlRes = $queryFunc( $dbr, 'templatelinks', 'tl_from' );
193  }
194 
195  if ( !$hideimages ) {
196  $ilRes = $queryFunc( $dbr, 'imagelinks', 'il_from' );
197  }
198 
199  if ( ( !$fetchlinks || !$plRes->numRows() )
200  && ( $hidetrans || !$tlRes->numRows() )
201  && ( $hideimages || !$ilRes->numRows() )
202  ) {
203  if ( 0 == $level ) {
204  if ( !$this->including() ) {
205  $out->addHTML( $this->whatlinkshereForm() );
206 
207  // Show filters only if there are links
208  if ( $hidelinks || $hidetrans || $hideredirs || $hideimages ) {
209  $out->addHTML( $this->getFilterPanel() );
210  }
211  $msgKey = is_int( $namespace ) ? 'nolinkshere-ns' : 'nolinkshere';
212  $link = $this->getLinkRenderer()->makeLink(
213  $this->target,
214  null,
215  [],
216  $this->target->isRedirect() ? [ 'redirect' => 'no' ] : []
217  );
218 
219  $errMsg = $this->msg( $msgKey )
220  ->params( $this->target->getPrefixedText() )
221  ->rawParams( $link )
222  ->parseAsBlock();
223  $out->addHTML( $errMsg );
224  $out->setStatusCode( 404 );
225  }
226  }
227 
228  return;
229  }
230 
231  // Read the rows into an array and remove duplicates
232  // templatelinks comes second so that the templatelinks row overwrites the
233  // pagelinks row, so we get (inclusion) rather than nothing
234  if ( $fetchlinks ) {
235  foreach ( $plRes as $row ) {
236  $row->is_template = 0;
237  $row->is_image = 0;
238  $rows[$row->page_id] = $row;
239  }
240  }
241  if ( !$hidetrans ) {
242  foreach ( $tlRes as $row ) {
243  $row->is_template = 1;
244  $row->is_image = 0;
245  $rows[$row->page_id] = $row;
246  }
247  }
248  if ( !$hideimages ) {
249  foreach ( $ilRes as $row ) {
250  $row->is_template = 0;
251  $row->is_image = 1;
252  $rows[$row->page_id] = $row;
253  }
254  }
255 
256  // Sort by key and then change the keys to 0-based indices
257  ksort( $rows );
258  $rows = array_values( $rows );
259 
260  $numRows = count( $rows );
261 
262  // Work out the start and end IDs, for prev/next links
263  if ( $numRows > $limit ) {
264  // More rows available after these ones
265  // Get the ID from the last row in the result set
266  $nextId = $rows[$limit]->page_id;
267  // Remove undisplayed rows
268  $rows = array_slice( $rows, 0, $limit );
269  } else {
270  // No more rows after
271  $nextId = false;
272  }
273  $prevId = $from;
274 
275  // use LinkBatch to make sure, that all required data (associated with Titles)
276  // is loaded in one query
277  $lb = new LinkBatch();
278  foreach ( $rows as $row ) {
279  $lb->add( $row->page_namespace, $row->page_title );
280  }
281  $lb->execute();
282 
283  if ( $level == 0 ) {
284  if ( !$this->including() ) {
285  $out->addHTML( $this->whatlinkshereForm() );
286  $out->addHTML( $this->getFilterPanel() );
287 
288  $link = $this->getLinkRenderer()->makeLink(
289  $this->target,
290  null,
291  [],
292  $this->target->isRedirect() ? [ 'redirect' => 'no' ] : []
293  );
294 
295  $msg = $this->msg( 'linkshere' )
296  ->params( $this->target->getPrefixedText() )
297  ->rawParams( $link )
298  ->parseAsBlock();
299  $out->addHTML( $msg );
300 
301  $prevnext = $this->getPrevNext( $prevId, $nextId );
302  $out->addHTML( $prevnext );
303  }
304  }
305  $out->addHTML( $this->listStart( $level ) );
306  foreach ( $rows as $row ) {
307  $nt = Title::makeTitle( $row->page_namespace, $row->page_title );
308 
309  if ( $row->rd_from && $level < 2 ) {
310  $out->addHTML( $this->listItem( $row, $nt, $target, true ) );
311  $this->showIndirectLinks(
312  $level + 1,
313  $nt,
314  $this->getConfig()->get( 'MaxRedirectLinksRetrieved' )
315  );
316  $out->addHTML( Xml::closeElement( 'li' ) );
317  } else {
318  $out->addHTML( $this->listItem( $row, $nt, $target ) );
319  }
320  }
321 
322  $out->addHTML( $this->listEnd() );
323 
324  if ( $level == 0 ) {
325  if ( !$this->including() ) {
326  $out->addHTML( $prevnext );
327  }
328  }
329  }
330 
331  protected function listStart( $level ) {
332  return Xml::openElement( 'ul', ( $level ? [] : [ 'id' => 'mw-whatlinkshere-list' ] ) );
333  }
334 
335  protected function listItem( $row, $nt, $target, $notClose = false ) {
336  $dirmark = $this->getLanguage()->getDirMark();
337 
338  # local message cache
339  static $msgcache = null;
340  if ( $msgcache === null ) {
341  static $msgs = [ 'isredirect', 'istemplate', 'semicolon-separator',
342  'whatlinkshere-links', 'isimage', 'editlink' ];
343  $msgcache = [];
344  foreach ( $msgs as $msg ) {
345  $msgcache[$msg] = $this->msg( $msg )->escaped();
346  }
347  }
348 
349  if ( $row->rd_from ) {
350  $query = [ 'redirect' => 'no' ];
351  } else {
352  $query = [];
353  }
354 
355  $link = $this->getLinkRenderer()->makeKnownLink(
356  $nt,
357  null,
358  $row->page_is_redirect ? [ 'class' => 'mw-redirect' ] : [],
359  $query
360  );
361 
362  // Display properties (redirect or template)
363  $propsText = '';
364  $props = [];
365  if ( $row->rd_from ) {
366  $props[] = $msgcache['isredirect'];
367  }
368  if ( $row->is_template ) {
369  $props[] = $msgcache['istemplate'];
370  }
371  if ( $row->is_image ) {
372  $props[] = $msgcache['isimage'];
373  }
374 
375  Hooks::run( 'WhatLinksHereProps', [ $row, $nt, $target, &$props ] );
376 
377  if ( count( $props ) ) {
378  $propsText = $this->msg( 'parentheses' )
379  ->rawParams( implode( $msgcache['semicolon-separator'], $props ) )->escaped();
380  }
381 
382  # Space for utilities links, with a what-links-here link provided
383  $wlhLink = $this->wlhLink( $nt, $msgcache['whatlinkshere-links'], $msgcache['editlink'] );
384  $wlh = Xml::wrapClass(
385  $this->msg( 'parentheses' )->rawParams( $wlhLink )->escaped(),
386  'mw-whatlinkshere-tools'
387  );
388 
389  return $notClose ?
390  Xml::openElement( 'li' ) . "$link $propsText $dirmark $wlh\n" :
391  Xml::tags( 'li', null, "$link $propsText $dirmark $wlh" ) . "\n";
392  }
393 
394  protected function listEnd() {
395  return Xml::closeElement( 'ul' );
396  }
397 
398  protected function wlhLink( Title $target, $text, $editText ) {
399  static $title = null;
400  if ( $title === null ) {
401  $title = $this->getPageTitle();
402  }
403 
404  $linkRenderer = $this->getLinkRenderer();
405 
406  if ( $text !== null ) {
407  $text = new HtmlArmor( $text );
408  }
409 
410  // always show a "<- Links" link
411  $links = [
412  'links' => $linkRenderer->makeKnownLink(
413  $title,
414  $text,
415  [],
416  [ 'target' => $target->getPrefixedText() ]
417  ),
418  ];
419 
420  // if the page is editable, add an edit link
421  if (
422  // check user permissions
423  $this->getUser()->isAllowed( 'edit' ) &&
424  // check, if the content model is editable through action=edit
425  ContentHandler::getForTitle( $target )->supportsDirectEditing()
426  ) {
427  if ( $editText !== null ) {
428  $editText = new HtmlArmor( $editText );
429  }
430 
431  $links['edit'] = $linkRenderer->makeKnownLink(
432  $target,
433  $editText,
434  [],
435  [ 'action' => 'edit' ]
436  );
437  }
438 
439  // build the links html
440  return $this->getLanguage()->pipeList( $links );
441  }
442 
443  function makeSelfLink( $text, $query ) {
444  if ( $text !== null ) {
445  $text = new HtmlArmor( $text );
446  }
447 
448  return $this->getLinkRenderer()->makeKnownLink(
449  $this->selfTitle,
450  $text,
451  [],
452  $query
453  );
454  }
455 
456  function getPrevNext( $prevId, $nextId ) {
457  $currentLimit = $this->opts->getValue( 'limit' );
458  $prev = $this->msg( 'whatlinkshere-prev' )->numParams( $currentLimit )->escaped();
459  $next = $this->msg( 'whatlinkshere-next' )->numParams( $currentLimit )->escaped();
460 
461  $changed = $this->opts->getChangedValues();
462  unset( $changed['target'] ); // Already in the request title
463 
464  if ( 0 != $prevId ) {
465  $overrides = [ 'from' => $this->opts->getValue( 'back' ) ];
466  $prev = $this->makeSelfLink( $prev, array_merge( $changed, $overrides ) );
467  }
468  if ( 0 != $nextId ) {
469  $overrides = [ 'from' => $nextId, 'back' => $prevId ];
470  $next = $this->makeSelfLink( $next, array_merge( $changed, $overrides ) );
471  }
472 
473  $limitLinks = [];
474  $lang = $this->getLanguage();
475  foreach ( $this->limits as $limit ) {
476  $prettyLimit = htmlspecialchars( $lang->formatNum( $limit ) );
477  $overrides = [ 'limit' => $limit ];
478  $limitLinks[] = $this->makeSelfLink( $prettyLimit, array_merge( $changed, $overrides ) );
479  }
480 
481  $nums = $lang->pipeList( $limitLinks );
482 
483  return $this->msg( 'viewprevnext' )->rawParams( $prev, $next, $nums )->escaped();
484  }
485 
486  function whatlinkshereForm() {
487  // We get nicer value from the title object
488  $this->opts->consumeValue( 'target' );
489  // Reset these for new requests
490  $this->opts->consumeValues( [ 'back', 'from' ] );
491 
492  $target = $this->target ? $this->target->getPrefixedText() : '';
493  $namespace = $this->opts->consumeValue( 'namespace' );
494  $nsinvert = $this->opts->consumeValue( 'invert' );
495 
496  # Build up the form
497  $f = Xml::openElement( 'form', [ 'action' => wfScript() ] );
498 
499  # Values that should not be forgotten
500  $f .= Html::hidden( 'title', $this->getPageTitle()->getPrefixedText() );
501  foreach ( $this->opts->getUnconsumedValues() as $name => $value ) {
502  $f .= Html::hidden( $name, $value );
503  }
504 
505  $f .= Xml::fieldset( $this->msg( 'whatlinkshere' )->text() );
506 
507  # Target input (.mw-searchInput enables suggestions)
508  $f .= Xml::inputLabel( $this->msg( 'whatlinkshere-page' )->text(), 'target',
509  'mw-whatlinkshere-target', 40, $target, [ 'class' => 'mw-searchInput' ] );
510 
511  $f .= ' ';
512 
513  # Namespace selector
515  [
516  'selected' => $namespace,
517  'all' => '',
518  'label' => $this->msg( 'namespace' )->text()
519  ], [
520  'name' => 'namespace',
521  'id' => 'namespace',
522  'class' => 'namespaceselector',
523  ]
524  );
525 
526  $f .= "\u{00A0}" .
528  $this->msg( 'invert' )->text(),
529  'invert',
530  'nsinvert',
531  $nsinvert,
532  [ 'title' => $this->msg( 'tooltip-whatlinkshere-invert' )->text() ]
533  );
534 
535  $f .= ' ';
536 
537  # Submit
538  $f .= Xml::submitButton( $this->msg( 'whatlinkshere-submit' )->text() );
539 
540  # Close
541  $f .= Xml::closeElement( 'fieldset' ) . Xml::closeElement( 'form' ) . "\n";
542 
543  return $f;
544  }
545 
551  function getFilterPanel() {
552  $show = $this->msg( 'show' )->escaped();
553  $hide = $this->msg( 'hide' )->escaped();
554 
555  $changed = $this->opts->getChangedValues();
556  unset( $changed['target'] ); // Already in the request title
557 
558  $links = [];
559  $types = [ 'hidetrans', 'hidelinks', 'hideredirs' ];
560  if ( $this->target->getNamespace() == NS_FILE ) {
561  $types[] = 'hideimages';
562  }
563 
564  // Combined message keys: 'whatlinkshere-hideredirs', 'whatlinkshere-hidetrans',
565  // 'whatlinkshere-hidelinks', 'whatlinkshere-hideimages'
566  // To be sure they will be found by grep
567  foreach ( $types as $type ) {
568  $chosen = $this->opts->getValue( $type );
569  $msg = $chosen ? $show : $hide;
570  $overrides = [ $type => !$chosen ];
571  $links[] = $this->msg( "whatlinkshere-{$type}" )->rawParams(
572  $this->makeSelfLink( $msg, array_merge( $changed, $overrides ) ) )->escaped();
573  }
574 
575  return Xml::fieldset(
576  $this->msg( 'whatlinkshere-filters' )->text(),
577  $this->getLanguage()->pipeList( $links )
578  );
579  }
580 
589  public function prefixSearchSubpages( $search, $limit, $offset ) {
590  return $this->prefixSearchString( $search, $limit, $offset );
591  }
592 
593  protected function getGroupName() {
594  return 'pagetools';
595  }
596 }
SpecialPage\getPageTitle
getPageTitle( $subpage=false)
Get a self-referential title object.
Definition: SpecialPage.php:678
SpecialWhatLinksHere\__construct
__construct()
Definition: SpecialWhatlinkshere.php:42
Title\newFromText
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Definition: Title.php:280
HtmlArmor
Marks HTML that shouldn't be escaped.
Definition: HtmlArmor.php:28
SpecialPage\msg
msg( $key)
Wrapper around wfMessage that sets the current context.
Definition: SpecialPage.php:796
SpecialWhatLinksHere\$limits
$limits
Definition: SpecialWhatlinkshere.php:40
LinkBatch
Class representing a list of titles The execute() method checks them all for existence and adds them ...
Definition: LinkBatch.php:34
SpecialWhatLinksHere\listEnd
listEnd()
Definition: SpecialWhatlinkshere.php:394
SpecialPage\getOutput
getOutput()
Get the OutputPage being used for this instance.
Definition: SpecialPage.php:725
$lang
if(!isset( $args[0])) $lang
Definition: testCompression.php:33
FormOptions\getValue
getValue( $name)
Get the value for the given option name.
Definition: FormOptions.php:180
captcha-old.count
count
Definition: captcha-old.py:249
FormOptions\INTNULL
const INTNULL
Integer type or null, maps to WebRequest::getIntOrNull() This is useful for the namespace selector.
Definition: FormOptions.php:54
Title\getPrefixedText
getPrefixedText()
Get the prefixed title with spaces.
Definition: Title.php:1694
NS_FILE
const NS_FILE
Definition: Defines.php:70
ContentHandler\getForTitle
static getForTitle(Title $title)
Returns the appropriate ContentHandler singleton for the given title.
Definition: ContentHandler.php:244
SpecialWhatLinksHere\whatlinkshereForm
whatlinkshereForm()
Definition: SpecialWhatlinkshere.php:486
SpecialPage\getSkin
getSkin()
Shortcut to get the skin being used for this instance.
Definition: SpecialPage.php:745
SpecialWhatLinksHere\prefixSearchSubpages
prefixSearchSubpages( $search, $limit, $offset)
Return an array of subpages beginning with $search that this special page will accept.
Definition: SpecialWhatlinkshere.php:589
IncludableSpecialPage
Shortcut to construct an includable special page.
Definition: IncludableSpecialPage.php:29
FormOptions\validateIntBounds
validateIntBounds( $name, $min, $max)
Definition: FormOptions.php:253
SpecialPage\getLanguage
getLanguage()
Shortcut to get user's language.
Definition: SpecialPage.php:755
FormOptions\fetchValuesFromRequest
fetchValuesFromRequest(WebRequest $r, $optionKeys=null)
Fetch values for all options (or selected options) from the given WebRequest, making them available f...
Definition: FormOptions.php:344
Xml\openElement
static openElement( $element, $attribs=null)
This opens an XML element.
Definition: Xml.php:110
php
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
Wikimedia\Rdbms\IDatabase
Basic database interface for live and lazy-loaded relation database handles.
Definition: IDatabase.php:38
$dbr
$dbr
Definition: testCompression.php:50
Xml\fieldset
static fieldset( $legend=false, $content=false, $attribs=[])
Shortcut for creating fieldsets.
Definition: Xml.php:611
FormOptions\add
add( $name, $default, $type=self::AUTO)
Add an option to be handled by this FormOptions instance.
Definition: FormOptions.php:81
$query
null for the 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
Definition: hooks.txt:1627
SpecialPage\addHelpLink
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
Definition: SpecialPage.php:832
SpecialPage\prefixSearchString
prefixSearchString( $search, $limit, $offset)
Perform a regular substring search for prefixSearchSubpages.
Definition: SpecialPage.php:495
Xml\wrapClass
static wrapClass( $text, $class, $tag='span', $attribs=[])
Shortcut to make a specific element with a class attribute.
Definition: Xml.php:264
Title\getDBkey
getDBkey()
Get the main part with underscores.
Definition: Title.php:951
SpecialPage\getConfig
getConfig()
Shortcut to get main config object.
Definition: SpecialPage.php:764
$title
namespace and then decline to actually register it file or subcat img or subcat $title
Definition: hooks.txt:964
wfScript
wfScript( $script='index')
Get the path to a specified script file, respecting file extensions; this is a wrapper around $wgScri...
Definition: GlobalFunctions.php:2771
Title\getNamespace
getNamespace()
Get the namespace index, i.e.
Definition: Title.php:974
SpecialWhatLinksHere\getPrevNext
getPrevNext( $prevId, $nextId)
Definition: SpecialWhatlinkshere.php:456
SpecialWhatLinksHere\wlhLink
wlhLink(Title $target, $text, $editText)
Definition: SpecialWhatlinkshere.php:398
wfGetDB
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
Definition: GlobalFunctions.php:2693
SpecialWhatLinksHere\showIndirectLinks
showIndirectLinks( $level, $target, $limit, $from=0, $back=0)
Definition: SpecialWhatlinkshere.php:108
SpecialWhatLinksHere
Implements Special:Whatlinkshere.
Definition: SpecialWhatlinkshere.php:31
use
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
Definition: MIT-LICENSE.txt:10
SpecialPage\setHeaders
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
Definition: SpecialPage.php:531
SpecialPage\getUser
getUser()
Shortcut to get the User executing this instance.
Definition: SpecialPage.php:735
Title\makeTitle
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:545
DB_REPLICA
const DB_REPLICA
Definition: defines.php:25
FormOptions\setValue
setValue( $name, $value, $force=false)
Use to set the value of an option.
Definition: FormOptions.php:163
$name
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:302
Html\hidden
static hidden( $name, $value, array $attribs=[])
Convenience function to produce an input element with type=hidden.
Definition: Html.php:795
captcha-old.opts
opts
Definition: captcha-old.py:227
$value
$value
Definition: styleTest.css.php:49
Html\namespaceSelector
static namespaceSelector(array $params=[], array $selectAttribs=[])
Build a drop-down box for selecting a namespace.
Definition: Html.php:883
Xml\tags
static tags( $element, $attribs, $contents)
Same as Xml::element(), but does not escape contents.
Definition: Xml.php:132
SpecialWhatLinksHere\execute
execute( $par)
Default execute method Checks user permissions.
Definition: SpecialWhatlinkshere.php:46
SpecialPage\getRequest
getRequest()
Get the WebRequest being used for this instance.
Definition: SpecialPage.php:715
SpecialWhatLinksHere\makeSelfLink
makeSelfLink( $text, $query)
Definition: SpecialWhatlinkshere.php:443
SpecialWhatLinksHere\$selfTitle
$selfTitle
Definition: SpecialWhatlinkshere.php:35
SpecialWhatLinksHere\listItem
listItem( $row, $nt, $target, $notClose=false)
Definition: SpecialWhatlinkshere.php:335
SpecialWhatLinksHere\$target
Title $target
Definition: SpecialWhatlinkshere.php:38
SpecialPage\getLinkRenderer
getLinkRenderer()
Definition: SpecialPage.php:908
text
This list may contain false positives That usually means there is additional text with links below the first Each row contains links to the first and second as well as the first line of the second redirect text
Definition: All_system_messages.txt:1267
Title
Represents a title within MediaWiki.
Definition: Title.php:39
SpecialWhatLinksHere\listStart
listStart( $level)
Definition: SpecialWhatlinkshere.php:331
Xml\closeElement
static closeElement( $element)
Shortcut to close an XML element.
Definition: Xml.php:119
$rows
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 $rows
Definition: hooks.txt:2675
as
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
SpecialWhatLinksHere\getFilterPanel
getFilterPanel()
Create filter panel.
Definition: SpecialWhatlinkshere.php:551
$link
usually copyright or history_copyright This message must be in HTML not wikitext & $link
Definition: hooks.txt:3090
FormOptions
Helper class to keep track of options when mixing links and form elements.
Definition: FormOptions.php:35
SpecialPage\$linkRenderer
MediaWiki Linker LinkRenderer null $linkRenderer
Definition: SpecialPage.php:66
Hooks\run
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Definition: Hooks.php:200
Xml\inputLabel
static inputLabel( $label, $name, $id, $size=false, $value=false, $attribs=[])
Convenience function to build an HTML text input field with a label.
Definition: Xml.php:382
SpecialWhatLinksHere\getGroupName
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
Definition: SpecialWhatlinkshere.php:593
SpecialPage\outputHeader
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
Definition: SpecialPage.php:633
SpecialPage\including
including( $x=null)
Whether the special page is being evaluated via transclusion.
Definition: SpecialPage.php:228
SpecialWhatLinksHere\$opts
FormOptions $opts
Definition: SpecialWhatlinkshere.php:33
Xml\submitButton
static submitButton( $value, $attribs=[])
Convenience function to build an HTML submit button When $wgUseMediaWikiUIEverywhere is true it will ...
Definition: Xml.php:461
Xml\checkLabel
static checkLabel( $label, $name, $id, $checked=false, $attribs=[])
Convenience function to build an HTML checkbox with a label.
Definition: Xml.php:421
$out
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
Definition: hooks.txt:813
$type
$type
Definition: testCompression.php:48