MediaWiki  1.30.0
SkinTemplate.php
Go to the documentation of this file.
1 <?php
23 
38 class SkinTemplate extends Skin {
43  public $skinname = 'monobook';
44 
49  public $template = 'QuickTemplate';
50 
51  public $thispage;
52  public $titletxt;
53  public $userpage;
54  public $thisquery;
55  public $loggedin;
56  public $username;
58 
64  public function setupSkinUserCss( OutputPage $out ) {
65  $moduleStyles = [
66  'mediawiki.legacy.shared',
67  'mediawiki.legacy.commonPrint',
68  'mediawiki.sectionAnchor'
69  ];
70  if ( $out->isSyndicated() ) {
71  $moduleStyles[] = 'mediawiki.feedlink';
72  }
73 
74  // Deprecated since 1.26: Unconditional loading of mediawiki.ui.button
75  // on every page is deprecated. Express a dependency instead.
76  if ( strpos( $out->getHTML(), 'mw-ui-button' ) !== false ) {
77  $moduleStyles[] = 'mediawiki.ui.button';
78  }
79 
80  $out->addModuleStyles( $moduleStyles );
81  }
82 
94  function setupTemplate( $classname, $repository = false, $cache_dir = false ) {
95  return new $classname( $this->getConfig() );
96  }
97 
103  public function getLanguages() {
105  if ( $wgHideInterlanguageLinks ) {
106  return [];
107  }
108 
109  $userLang = $this->getLanguage();
110  $languageLinks = [];
111 
112  foreach ( $this->getOutput()->getLanguageLinks() as $languageLinkText ) {
113  $class = 'interlanguage-link interwiki-' . explode( ':', $languageLinkText, 2 )[0];
114 
115  $languageLinkTitle = Title::newFromText( $languageLinkText );
116  if ( $languageLinkTitle ) {
117  $ilInterwikiCode = $languageLinkTitle->getInterwiki();
118  $ilLangName = Language::fetchLanguageName( $ilInterwikiCode );
119 
120  if ( strval( $ilLangName ) === '' ) {
121  $ilDisplayTextMsg = wfMessage( "interlanguage-link-$ilInterwikiCode" );
122  if ( !$ilDisplayTextMsg->isDisabled() ) {
123  // Use custom MW message for the display text
124  $ilLangName = $ilDisplayTextMsg->text();
125  } else {
126  // Last resort: fallback to the language link target
127  $ilLangName = $languageLinkText;
128  }
129  } else {
130  // Use the language autonym as display text
131  $ilLangName = $this->formatLanguageName( $ilLangName );
132  }
133 
134  // CLDR extension or similar is required to localize the language name;
135  // otherwise we'll end up with the autonym again.
136  $ilLangLocalName = Language::fetchLanguageName(
137  $ilInterwikiCode,
138  $userLang->getCode()
139  );
140 
141  $languageLinkTitleText = $languageLinkTitle->getText();
142  if ( $ilLangLocalName === '' ) {
143  $ilFriendlySiteName = wfMessage( "interlanguage-link-sitename-$ilInterwikiCode" );
144  if ( !$ilFriendlySiteName->isDisabled() ) {
145  if ( $languageLinkTitleText === '' ) {
146  $ilTitle = wfMessage(
147  'interlanguage-link-title-nonlangonly',
148  $ilFriendlySiteName->text()
149  )->text();
150  } else {
151  $ilTitle = wfMessage(
152  'interlanguage-link-title-nonlang',
153  $languageLinkTitleText,
154  $ilFriendlySiteName->text()
155  )->text();
156  }
157  } else {
158  // we have nothing friendly to put in the title, so fall back to
159  // displaying the interlanguage link itself in the title text
160  // (similar to what is done in page content)
161  $ilTitle = $languageLinkTitle->getInterwiki() .
162  ":$languageLinkTitleText";
163  }
164  } elseif ( $languageLinkTitleText === '' ) {
165  $ilTitle = wfMessage(
166  'interlanguage-link-title-langonly',
167  $ilLangLocalName
168  )->text();
169  } else {
170  $ilTitle = wfMessage(
171  'interlanguage-link-title',
172  $languageLinkTitleText,
173  $ilLangLocalName
174  )->text();
175  }
176 
177  $ilInterwikiCodeBCP47 = wfBCP47( $ilInterwikiCode );
178  $languageLink = [
179  'href' => $languageLinkTitle->getFullURL(),
180  'text' => $ilLangName,
181  'title' => $ilTitle,
182  'class' => $class,
183  'link-class' => 'interlanguage-link-target',
184  'lang' => $ilInterwikiCodeBCP47,
185  'hreflang' => $ilInterwikiCodeBCP47,
186  ];
187  Hooks::run(
188  'SkinTemplateGetLanguageLink',
189  [ &$languageLink, $languageLinkTitle, $this->getTitle(), $this->getOutput() ]
190  );
191  $languageLinks[] = $languageLink;
192  }
193  }
194 
195  return $languageLinks;
196  }
197 
198  protected function setupTemplateForOutput() {
199  $request = $this->getRequest();
200  $user = $this->getUser();
201  $title = $this->getTitle();
202 
203  $tpl = $this->setupTemplate( $this->template, 'skins' );
204 
205  $this->thispage = $title->getPrefixedDBkey();
206  $this->titletxt = $title->getPrefixedText();
207  $this->userpage = $user->getUserPage()->getPrefixedText();
208  $query = [];
209  if ( !$request->wasPosted() ) {
210  $query = $request->getValues();
211  unset( $query['title'] );
212  unset( $query['returnto'] );
213  unset( $query['returntoquery'] );
214  }
215  $this->thisquery = wfArrayToCgi( $query );
216  $this->loggedin = $user->isLoggedIn();
217  $this->username = $user->getName();
218 
219  if ( $this->loggedin ) {
220  $this->userpageUrlDetails = self::makeUrlDetails( $this->userpage );
221  } else {
222  # This won't be used in the standard skins, but we define it to preserve the interface
223  # To save time, we check for existence
224  $this->userpageUrlDetails = self::makeKnownUrlDetails( $this->userpage );
225  }
226 
227  return $tpl;
228  }
229 
235  function outputPage( OutputPage $out = null ) {
236  Profiler::instance()->setTemplated( true );
237 
238  $oldContext = null;
239  if ( $out !== null ) {
240  // Deprecated since 1.20, note added in 1.25
241  wfDeprecated( __METHOD__, '1.25' );
242  $oldContext = $this->getContext();
243  $this->setContext( $out->getContext() );
244  }
245 
246  $out = $this->getOutput();
247 
248  $this->initPage( $out );
249  $tpl = $this->prepareQuickTemplate();
250  // execute template
251  $res = $tpl->execute();
252 
253  // result may be an error
254  $this->printOrError( $res );
255 
256  if ( $oldContext ) {
257  $this->setContext( $oldContext );
258  }
259  }
260 
268  protected function wrapHTML( $title, $html ) {
269  # An ID that includes the actual body text; without categories, contentSub, ...
270  $realBodyAttribs = [ 'id' => 'mw-content-text' ];
271 
272  # Add a mw-content-ltr/rtl class to be able to style based on text
273  # direction when the content is different from the UI language (only
274  # when viewing)
275  # Most information on special pages and file pages is in user language,
276  # rather than content language, so those will not get this
277  if ( Action::getActionName( $this ) === 'view' &&
278  ( !$title->inNamespaces( NS_SPECIAL, NS_FILE ) || $title->isRedirect() ) ) {
279  $pageLang = $title->getPageViewLanguage();
280  $realBodyAttribs['lang'] = $pageLang->getHtmlCode();
281  $realBodyAttribs['dir'] = $pageLang->getDir();
282  $realBodyAttribs['class'] = 'mw-content-' . $pageLang->getDir();
283  }
284 
285  return Html::rawElement( 'div', $realBodyAttribs, $html );
286  }
287 
294  protected function prepareQuickTemplate() {
299 
300  $title = $this->getTitle();
301  $request = $this->getRequest();
302  $out = $this->getOutput();
303  $tpl = $this->setupTemplateForOutput();
304 
305  $tpl->set( 'title', $out->getPageTitle() );
306  $tpl->set( 'pagetitle', $out->getHTMLTitle() );
307  $tpl->set( 'displaytitle', $out->mPageLinkTitle );
308 
309  $tpl->set( 'thispage', $this->thispage );
310  $tpl->set( 'titleprefixeddbkey', $this->thispage );
311  $tpl->set( 'titletext', $title->getText() );
312  $tpl->set( 'articleid', $title->getArticleID() );
313 
314  $tpl->set( 'isarticle', $out->isArticle() );
315 
316  $subpagestr = $this->subPageSubtitle();
317  if ( $subpagestr !== '' ) {
318  $subpagestr = '<span class="subpages">' . $subpagestr . '</span>';
319  }
320  $tpl->set( 'subtitle', $subpagestr . $out->getSubtitle() );
321 
322  $undelete = $this->getUndeleteLink();
323  if ( $undelete === '' ) {
324  $tpl->set( 'undelete', '' );
325  } else {
326  $tpl->set( 'undelete', '<span class="subpages">' . $undelete . '</span>' );
327  }
328 
329  $tpl->set( 'catlinks', $this->getCategories() );
330  if ( $out->isSyndicated() ) {
331  $feeds = [];
332  foreach ( $out->getSyndicationLinks() as $format => $link ) {
333  $feeds[$format] = [
334  // Messages: feed-atom, feed-rss
335  'text' => $this->msg( "feed-$format" )->text(),
336  'href' => $link
337  ];
338  }
339  $tpl->set( 'feeds', $feeds );
340  } else {
341  $tpl->set( 'feeds', false );
342  }
343 
344  $tpl->set( 'mimetype', $wgMimeType );
345  $tpl->set( 'jsmimetype', $wgJsMimeType );
346  $tpl->set( 'charset', 'UTF-8' );
347  $tpl->set( 'wgScript', $wgScript );
348  $tpl->set( 'skinname', $this->skinname );
349  $tpl->set( 'skinclass', static::class );
350  $tpl->set( 'skin', $this );
351  $tpl->set( 'stylename', $this->stylename );
352  $tpl->set( 'printable', $out->isPrintable() );
353  $tpl->set( 'handheld', $request->getBool( 'handheld' ) );
354  $tpl->set( 'loggedin', $this->loggedin );
355  $tpl->set( 'notspecialpage', !$title->isSpecialPage() );
356  $tpl->set( 'searchaction', $this->escapeSearchLink() );
357  $tpl->set( 'searchtitle', SpecialPage::getTitleFor( 'Search' )->getPrefixedDBkey() );
358  $tpl->set( 'search', trim( $request->getVal( 'search' ) ) );
359  $tpl->set( 'stylepath', $wgStylePath );
360  $tpl->set( 'articlepath', $wgArticlePath );
361  $tpl->set( 'scriptpath', $wgScriptPath );
362  $tpl->set( 'serverurl', $wgServer );
363  $tpl->set( 'logopath', $wgLogo );
364  $tpl->set( 'sitename', $wgSitename );
365 
366  $userLang = $this->getLanguage();
367  $userLangCode = $userLang->getHtmlCode();
368  $userLangDir = $userLang->getDir();
369 
370  $tpl->set( 'lang', $userLangCode );
371  $tpl->set( 'dir', $userLangDir );
372  $tpl->set( 'rtl', $userLang->isRTL() );
373 
374  $tpl->set( 'capitalizeallnouns', $userLang->capitalizeAllNouns() ? ' capitalize-all-nouns' : '' );
375  $tpl->set( 'showjumplinks', true ); // showjumplinks preference has been removed
376  $tpl->set( 'username', $this->loggedin ? $this->username : null );
377  $tpl->set( 'userpage', $this->userpage );
378  $tpl->set( 'userpageurl', $this->userpageUrlDetails['href'] );
379  $tpl->set( 'userlang', $userLangCode );
380 
381  // Users can have their language set differently than the
382  // content of the wiki. For these users, tell the web browser
383  // that interface elements are in a different language.
384  $tpl->set( 'userlangattributes', '' );
385  $tpl->set( 'specialpageattributes', '' ); # obsolete
386  // Used by VectorBeta to insert HTML before content but after the
387  // heading for the page title. Defaults to empty string.
388  $tpl->set( 'prebodyhtml', '' );
389 
390  if ( $userLangCode !== $wgContLang->getHtmlCode() || $userLangDir !== $wgContLang->getDir() ) {
391  $escUserlang = htmlspecialchars( $userLangCode );
392  $escUserdir = htmlspecialchars( $userLangDir );
393  // Attributes must be in double quotes because htmlspecialchars() doesn't
394  // escape single quotes
395  $attrs = " lang=\"$escUserlang\" dir=\"$escUserdir\"";
396  $tpl->set( 'userlangattributes', $attrs );
397  }
398 
399  $tpl->set( 'newtalk', $this->getNewtalks() );
400  $tpl->set( 'logo', $this->logoText() );
401 
402  $tpl->set( 'copyright', false );
403  // No longer used
404  $tpl->set( 'viewcount', false );
405  $tpl->set( 'lastmod', false );
406  $tpl->set( 'credits', false );
407  $tpl->set( 'numberofwatchingusers', false );
408  if ( $out->isArticle() && $title->exists() ) {
409  if ( $this->isRevisionCurrent() ) {
410  if ( $wgMaxCredits != 0 ) {
411  $tpl->set( 'credits', Action::factory( 'credits', $this->getWikiPage(),
412  $this->getContext() )->getCredits( $wgMaxCredits, $wgShowCreditsIfMax ) );
413  } else {
414  $tpl->set( 'lastmod', $this->lastModified() );
415  }
416  }
417  $tpl->set( 'copyright', $this->getCopyright() );
418  }
419 
420  $tpl->set( 'copyrightico', $this->getCopyrightIcon() );
421  $tpl->set( 'poweredbyico', $this->getPoweredBy() );
422  $tpl->set( 'disclaimer', $this->disclaimerLink() );
423  $tpl->set( 'privacy', $this->privacyLink() );
424  $tpl->set( 'about', $this->aboutLink() );
425 
426  $tpl->set( 'footerlinks', [
427  'info' => [
428  'lastmod',
429  'numberofwatchingusers',
430  'credits',
431  'copyright',
432  ],
433  'places' => [
434  'privacy',
435  'about',
436  'disclaimer',
437  ],
438  ] );
439 
441  $tpl->set( 'footericons', $wgFooterIcons );
442  foreach ( $tpl->data['footericons'] as $footerIconsKey => &$footerIconsBlock ) {
443  if ( count( $footerIconsBlock ) > 0 ) {
444  foreach ( $footerIconsBlock as &$footerIcon ) {
445  if ( isset( $footerIcon['src'] ) ) {
446  if ( !isset( $footerIcon['width'] ) ) {
447  $footerIcon['width'] = 88;
448  }
449  if ( !isset( $footerIcon['height'] ) ) {
450  $footerIcon['height'] = 31;
451  }
452  }
453  }
454  } else {
455  unset( $tpl->data['footericons'][$footerIconsKey] );
456  }
457  }
458 
459  $tpl->set( 'indicators', $out->getIndicators() );
460 
461  $tpl->set( 'sitenotice', $this->getSiteNotice() );
462  $tpl->set( 'printfooter', $this->printSource() );
463  // Wrap the bodyText with #mw-content-text element
464  $out->mBodytext = $this->wrapHTML( $title, $out->mBodytext );
465  $tpl->set( 'bodytext', $out->mBodytext );
466 
467  $language_urls = $this->getLanguages();
468  if ( count( $language_urls ) ) {
469  $tpl->set( 'language_urls', $language_urls );
470  } else {
471  $tpl->set( 'language_urls', false );
472  }
473 
474  # Personal toolbar
475  $tpl->set( 'personal_urls', $this->buildPersonalUrls() );
476  $content_navigation = $this->buildContentNavigationUrls();
477  $content_actions = $this->buildContentActionUrls( $content_navigation );
478  $tpl->set( 'content_navigation', $content_navigation );
479  $tpl->set( 'content_actions', $content_actions );
480 
481  $tpl->set( 'sidebar', $this->buildSidebar() );
482  $tpl->set( 'nav_urls', $this->buildNavUrls() );
483 
484  // Do this last in case hooks above add bottom scripts
485  $tpl->set( 'bottomscripts', $this->bottomScripts() );
486 
487  // Set the head scripts near the end, in case the above actions resulted in added scripts
488  $tpl->set( 'headelement', $out->headElement( $this ) );
489 
490  $tpl->set( 'debug', '' );
491  $tpl->set( 'debughtml', $this->generateDebugHTML() );
492  $tpl->set( 'reporttime', wfReportTime() );
493 
494  // Avoid PHP 7.1 warning of passing $this by reference
495  $skinTemplate = $this;
496  // original version by hansm
497  if ( !Hooks::run( 'SkinTemplateOutputPageBeforeExec', [ &$skinTemplate, &$tpl ] ) ) {
498  wfDebug( __METHOD__ . ": Hook SkinTemplateOutputPageBeforeExec broke outputPage execution!\n" );
499  }
500 
501  // Set the bodytext to another key so that skins can just output it on its own
502  // and output printfooter and debughtml separately
503  $tpl->set( 'bodycontent', $tpl->data['bodytext'] );
504 
505  // Append printfooter and debughtml onto bodytext so that skins that
506  // were already using bodytext before they were split out don't suddenly
507  // start not outputting information.
508  $tpl->data['bodytext'] .= Html::rawElement(
509  'div',
510  [ 'class' => 'printfooter' ],
511  "\n{$tpl->data['printfooter']}"
512  ) . "\n";
513  $tpl->data['bodytext'] .= $tpl->data['debughtml'];
514 
515  // allow extensions adding stuff after the page content.
516  // See Skin::afterContentHook() for further documentation.
517  $tpl->set( 'dataAfterContent', $this->afterContentHook() );
518 
519  return $tpl;
520  }
521 
526  public function getPersonalToolsList() {
527  $tpl = $this->setupTemplateForOutput();
528  $tpl->set( 'personal_urls', $this->buildPersonalUrls() );
529  $html = '';
530  foreach ( $tpl->getPersonalTools() as $key => $item ) {
531  $html .= $tpl->makeListItem( $key, $item );
532  }
533  return $html;
534  }
535 
544  function formatLanguageName( $name ) {
545  return $this->getLanguage()->ucfirst( $name );
546  }
547 
556  function printOrError( $str ) {
557  echo $str;
558  }
559 
569  function useCombinedLoginLink() {
572  }
573 
578  protected function buildPersonalUrls() {
579  $title = $this->getTitle();
580  $request = $this->getRequest();
581  $pageurl = $title->getLocalURL();
582  $authManager = AuthManager::singleton();
583 
584  /* set up the default links for the personal toolbar */
585  $personal_urls = [];
586 
587  # Due to T34276, if a user does not have read permissions,
588  # $this->getTitle() will just give Special:Badtitle, which is
589  # not especially useful as a returnto parameter. Use the title
590  # from the request instead, if there was one.
591  if ( $this->getUser()->isAllowed( 'read' ) ) {
592  $page = $this->getTitle();
593  } else {
594  $page = Title::newFromText( $request->getVal( 'title', '' ) );
595  }
596  $page = $request->getVal( 'returnto', $page );
597  $a = [];
598  if ( strval( $page ) !== '' ) {
599  $a['returnto'] = $page;
600  $query = $request->getVal( 'returntoquery', $this->thisquery );
601  if ( $query != '' ) {
602  $a['returntoquery'] = $query;
603  }
604  }
605 
606  $returnto = wfArrayToCgi( $a );
607  if ( $this->loggedin ) {
608  $personal_urls['userpage'] = [
609  'text' => $this->username,
610  'href' => &$this->userpageUrlDetails['href'],
611  'class' => $this->userpageUrlDetails['exists'] ? false : 'new',
612  'active' => ( $this->userpageUrlDetails['href'] == $pageurl ),
613  'dir' => 'auto'
614  ];
615  $usertalkUrlDetails = $this->makeTalkUrlDetails( $this->userpage );
616  $personal_urls['mytalk'] = [
617  'text' => $this->msg( 'mytalk' )->text(),
618  'href' => &$usertalkUrlDetails['href'],
619  'class' => $usertalkUrlDetails['exists'] ? false : 'new',
620  'active' => ( $usertalkUrlDetails['href'] == $pageurl )
621  ];
622  $href = self::makeSpecialUrl( 'Preferences' );
623  $personal_urls['preferences'] = [
624  'text' => $this->msg( 'mypreferences' )->text(),
625  'href' => $href,
626  'active' => ( $href == $pageurl )
627  ];
628 
629  if ( $this->getUser()->isAllowed( 'viewmywatchlist' ) ) {
630  $href = self::makeSpecialUrl( 'Watchlist' );
631  $personal_urls['watchlist'] = [
632  'text' => $this->msg( 'mywatchlist' )->text(),
633  'href' => $href,
634  'active' => ( $href == $pageurl )
635  ];
636  }
637 
638  # We need to do an explicit check for Special:Contributions, as we
639  # have to match both the title, and the target, which could come
640  # from request values (Special:Contributions?target=Jimbo_Wales)
641  # or be specified in "sub page" form
642  # (Special:Contributions/Jimbo_Wales). The plot
643  # thickens, because the Title object is altered for special pages,
644  # so it doesn't contain the original alias-with-subpage.
645  $origTitle = Title::newFromText( $request->getText( 'title' ) );
646  if ( $origTitle instanceof Title && $origTitle->isSpecialPage() ) {
647  list( $spName, $spPar ) = SpecialPageFactory::resolveAlias( $origTitle->getText() );
648  $active = $spName == 'Contributions'
649  && ( ( $spPar && $spPar == $this->username )
650  || $request->getText( 'target' ) == $this->username );
651  } else {
652  $active = false;
653  }
654 
655  $href = self::makeSpecialUrlSubpage( 'Contributions', $this->username );
656  $personal_urls['mycontris'] = [
657  'text' => $this->msg( 'mycontris' )->text(),
658  'href' => $href,
659  'active' => $active
660  ];
661 
662  // if we can't set the user, we can't unset it either
663  if ( $request->getSession()->canSetUser() ) {
664  $personal_urls['logout'] = [
665  'text' => $this->msg( 'pt-userlogout' )->text(),
666  'href' => self::makeSpecialUrl( 'Userlogout',
667  // userlogout link must always contain an & character, otherwise we might not be able
668  // to detect a buggy precaching proxy (T19790)
669  $title->isSpecial( 'Preferences' ) ? 'noreturnto' : $returnto ),
670  'active' => false
671  ];
672  }
673  } else {
674  $useCombinedLoginLink = $this->useCombinedLoginLink();
675  if ( !$authManager->canCreateAccounts() || !$authManager->canAuthenticateNow() ) {
676  // don't show combined login/signup link if one of those is actually not available
677  $useCombinedLoginLink = false;
678  }
679 
680  $loginlink = $this->getUser()->isAllowed( 'createaccount' ) && $useCombinedLoginLink
681  ? 'nav-login-createaccount'
682  : 'pt-login';
683 
684  $login_url = [
685  'text' => $this->msg( $loginlink )->text(),
686  'href' => self::makeSpecialUrl( 'Userlogin', $returnto ),
687  'active' => $title->isSpecial( 'Userlogin' )
688  || $title->isSpecial( 'CreateAccount' ) && $useCombinedLoginLink,
689  ];
690  $createaccount_url = [
691  'text' => $this->msg( 'pt-createaccount' )->text(),
692  'href' => self::makeSpecialUrl( 'CreateAccount', $returnto ),
693  'active' => $title->isSpecial( 'CreateAccount' ),
694  ];
695 
696  // No need to show Talk and Contributions to anons if they can't contribute!
697  if ( User::groupHasPermission( '*', 'edit' ) ) {
698  // Because of caching, we can't link directly to the IP talk and
699  // contributions pages. Instead we use the special page shortcuts
700  // (which work correctly regardless of caching). This means we can't
701  // determine whether these links are active or not, but since major
702  // skins (MonoBook, Vector) don't use this information, it's not a
703  // huge loss.
704  $personal_urls['anontalk'] = [
705  'text' => $this->msg( 'anontalk' )->text(),
706  'href' => self::makeSpecialUrlSubpage( 'Mytalk', false ),
707  'active' => false
708  ];
709  $personal_urls['anoncontribs'] = [
710  'text' => $this->msg( 'anoncontribs' )->text(),
711  'href' => self::makeSpecialUrlSubpage( 'Mycontributions', false ),
712  'active' => false
713  ];
714  }
715 
716  if (
717  $authManager->canCreateAccounts()
718  && $this->getUser()->isAllowed( 'createaccount' )
719  && !$useCombinedLoginLink
720  ) {
721  $personal_urls['createaccount'] = $createaccount_url;
722  }
723 
724  if ( $authManager->canAuthenticateNow() ) {
725  $key = User::groupHasPermission( '*', 'read' )
726  ? 'login'
727  : 'login-private';
728  $personal_urls[$key] = $login_url;
729  }
730  }
731 
732  Hooks::run( 'PersonalUrls', [ &$personal_urls, &$title, $this ] );
733  return $personal_urls;
734  }
735 
747  function tabAction( $title, $message, $selected, $query = '', $checkEdit = false ) {
748  $classes = [];
749  if ( $selected ) {
750  $classes[] = 'selected';
751  }
752  if ( $checkEdit && !$title->isKnown() ) {
753  $classes[] = 'new';
754  if ( $query !== '' ) {
755  $query = 'action=edit&redlink=1&' . $query;
756  } else {
757  $query = 'action=edit&redlink=1';
758  }
759  }
760 
761  $linkClass = MediaWikiServices::getInstance()->getLinkRenderer()->getLinkClasses( $title );
762 
763  // wfMessageFallback will nicely accept $message as an array of fallbacks
764  // or just a single key
765  $msg = wfMessageFallback( $message )->setContext( $this->getContext() );
766  if ( is_array( $message ) ) {
767  // for hook compatibility just keep the last message name
768  $message = end( $message );
769  }
770  if ( $msg->exists() ) {
771  $text = $msg->text();
772  } else {
774  $text = $wgContLang->getConverter()->convertNamespace(
775  MWNamespace::getSubject( $title->getNamespace() ) );
776  }
777 
778  // Avoid PHP 7.1 warning of passing $this by reference
779  $skinTemplate = $this;
780  $result = [];
781  if ( !Hooks::run( 'SkinTemplateTabAction', [ &$skinTemplate,
782  $title, $message, $selected, $checkEdit,
783  &$classes, &$query, &$text, &$result ] ) ) {
784  return $result;
785  }
786 
787  $result = [
788  'class' => implode( ' ', $classes ),
789  'text' => $text,
790  'href' => $title->getLocalURL( $query ),
791  'primary' => true ];
792  if ( $linkClass !== '' ) {
793  $result['link-class'] = $linkClass;
794  }
795 
796  return $result;
797  }
798 
799  function makeTalkUrlDetails( $name, $urlaction = '' ) {
801  if ( !is_object( $title ) ) {
802  throw new MWException( __METHOD__ . " given invalid pagename $name" );
803  }
804  $title = $title->getTalkPage();
806  return [
807  'href' => $title->getLocalURL( $urlaction ),
808  'exists' => $title->isKnown(),
809  ];
810  }
811 
818  function makeArticleUrlDetails( $name, $urlaction = '' ) {
820  $title = $title->getSubjectPage();
822  return [
823  'href' => $title->getLocalURL( $urlaction ),
824  'exists' => $title->exists(),
825  ];
826  }
827 
862  protected function buildContentNavigationUrls() {
864 
865  // Display tabs for the relevant title rather than always the title itself
866  $title = $this->getRelevantTitle();
867  $onPage = $title->equals( $this->getTitle() );
868 
869  $out = $this->getOutput();
870  $request = $this->getRequest();
871  $user = $this->getUser();
872 
873  $content_navigation = [
874  'namespaces' => [],
875  'views' => [],
876  'actions' => [],
877  'variants' => []
878  ];
879 
880  // parameters
881  $action = $request->getVal( 'action', 'view' );
882 
883  $userCanRead = $title->quickUserCan( 'read', $user );
884 
885  // Avoid PHP 7.1 warning of passing $this by reference
886  $skinTemplate = $this;
887  $preventActiveTabs = false;
888  Hooks::run( 'SkinTemplatePreventOtherActiveTabs', [ &$skinTemplate, &$preventActiveTabs ] );
889 
890  // Checks if page is some kind of content
891  if ( $title->canExist() ) {
892  // Gets page objects for the related namespaces
893  $subjectPage = $title->getSubjectPage();
894  $talkPage = $title->getTalkPage();
895 
896  // Determines if this is a talk page
897  $isTalk = $title->isTalkPage();
898 
899  // Generates XML IDs from namespace names
900  $subjectId = $title->getNamespaceKey( '' );
901 
902  if ( $subjectId == 'main' ) {
903  $talkId = 'talk';
904  } else {
905  $talkId = "{$subjectId}_talk";
906  }
907 
908  $skname = $this->skinname;
909 
910  // Adds namespace links
911  $subjectMsg = [ "nstab-$subjectId" ];
912  if ( $subjectPage->isMainPage() ) {
913  array_unshift( $subjectMsg, 'mainpage-nstab' );
914  }
915  $content_navigation['namespaces'][$subjectId] = $this->tabAction(
916  $subjectPage, $subjectMsg, !$isTalk && !$preventActiveTabs, '', $userCanRead
917  );
918  $content_navigation['namespaces'][$subjectId]['context'] = 'subject';
919  $content_navigation['namespaces'][$talkId] = $this->tabAction(
920  $talkPage, [ "nstab-$talkId", 'talk' ], $isTalk && !$preventActiveTabs, '', $userCanRead
921  );
922  $content_navigation['namespaces'][$talkId]['context'] = 'talk';
923 
924  if ( $userCanRead ) {
925  // Adds "view" view link
926  if ( $title->isKnown() ) {
927  $content_navigation['views']['view'] = $this->tabAction(
928  $isTalk ? $talkPage : $subjectPage,
929  [ "$skname-view-view", 'view' ],
930  ( $onPage && ( $action == 'view' || $action == 'purge' ) ), '', true
931  );
932  // signal to hide this from simple content_actions
933  $content_navigation['views']['view']['redundant'] = true;
934  }
935 
936  $page = $this->canUseWikiPage() ? $this->getWikiPage() : false;
937  $isRemoteContent = $page && !$page->isLocal();
938 
939  // If it is a non-local file, show a link to the file in its own repository
940  // @todo abstract this for remote content that isn't a file
941  if ( $isRemoteContent ) {
942  $content_navigation['views']['view-foreign'] = [
943  'class' => '',
944  'text' => wfMessageFallback( "$skname-view-foreign", 'view-foreign' )->
945  setContext( $this->getContext() )->
946  params( $page->getWikiDisplayName() )->text(),
947  'href' => $page->getSourceURL(),
948  'primary' => false,
949  ];
950  }
951 
952  // Checks if user can edit the current page if it exists or create it otherwise
953  if ( $title->quickUserCan( 'edit', $user )
954  && ( $title->exists() || $title->quickUserCan( 'create', $user ) )
955  ) {
956  // Builds CSS class for talk page links
957  $isTalkClass = $isTalk ? ' istalk' : '';
958  // Whether the user is editing the page
959  $isEditing = $onPage && ( $action == 'edit' || $action == 'submit' );
960  // Whether to show the "Add a new section" tab
961  // Checks if this is a current rev of talk page and is not forced to be hidden
962  $showNewSection = !$out->forceHideNewSectionLink()
963  && ( ( $isTalk && $this->isRevisionCurrent() ) || $out->showNewSectionLink() );
964  $section = $request->getVal( 'section' );
965 
966  if ( $title->exists()
967  || ( $title->getNamespace() == NS_MEDIAWIKI
968  && $title->getDefaultMessageText() !== false
969  )
970  ) {
971  $msgKey = $isRemoteContent ? 'edit-local' : 'edit';
972  } else {
973  $msgKey = $isRemoteContent ? 'create-local' : 'create';
974  }
975  $content_navigation['views']['edit'] = [
976  'class' => ( $isEditing && ( $section !== 'new' || !$showNewSection )
977  ? 'selected'
978  : ''
979  ) . $isTalkClass,
980  'text' => wfMessageFallback( "$skname-view-$msgKey", $msgKey )
981  ->setContext( $this->getContext() )->text(),
982  'href' => $title->getLocalURL( $this->editUrlOptions() ),
983  'primary' => !$isRemoteContent, // don't collapse this in vector
984  ];
985 
986  // section link
987  if ( $showNewSection ) {
988  // Adds new section link
989  // $content_navigation['actions']['addsection']
990  $content_navigation['views']['addsection'] = [
991  'class' => ( $isEditing && $section == 'new' ) ? 'selected' : false,
992  'text' => wfMessageFallback( "$skname-action-addsection", 'addsection' )
993  ->setContext( $this->getContext() )->text(),
994  'href' => $title->getLocalURL( 'action=edit&section=new' )
995  ];
996  }
997  // Checks if the page has some kind of viewable source content
998  } elseif ( $title->hasSourceText() ) {
999  // Adds view source view link
1000  $content_navigation['views']['viewsource'] = [
1001  'class' => ( $onPage && $action == 'edit' ) ? 'selected' : false,
1002  'text' => wfMessageFallback( "$skname-action-viewsource", 'viewsource' )
1003  ->setContext( $this->getContext() )->text(),
1004  'href' => $title->getLocalURL( $this->editUrlOptions() ),
1005  'primary' => true, // don't collapse this in vector
1006  ];
1007  }
1008 
1009  // Checks if the page exists
1010  if ( $title->exists() ) {
1011  // Adds history view link
1012  $content_navigation['views']['history'] = [
1013  'class' => ( $onPage && $action == 'history' ) ? 'selected' : false,
1014  'text' => wfMessageFallback( "$skname-view-history", 'history_short' )
1015  ->setContext( $this->getContext() )->text(),
1016  'href' => $title->getLocalURL( 'action=history' ),
1017  ];
1018 
1019  if ( $title->quickUserCan( 'delete', $user ) ) {
1020  $content_navigation['actions']['delete'] = [
1021  'class' => ( $onPage && $action == 'delete' ) ? 'selected' : false,
1022  'text' => wfMessageFallback( "$skname-action-delete", 'delete' )
1023  ->setContext( $this->getContext() )->text(),
1024  'href' => $title->getLocalURL( 'action=delete' )
1025  ];
1026  }
1027 
1028  if ( $title->quickUserCan( 'move', $user ) ) {
1029  $moveTitle = SpecialPage::getTitleFor( 'Movepage', $title->getPrefixedDBkey() );
1030  $content_navigation['actions']['move'] = [
1031  'class' => $this->getTitle()->isSpecial( 'Movepage' ) ? 'selected' : false,
1032  'text' => wfMessageFallback( "$skname-action-move", 'move' )
1033  ->setContext( $this->getContext() )->text(),
1034  'href' => $moveTitle->getLocalURL()
1035  ];
1036  }
1037  } else {
1038  // article doesn't exist or is deleted
1039  if ( $user->isAllowed( 'deletedhistory' ) ) {
1040  $n = $title->isDeleted();
1041  if ( $n ) {
1042  $undelTitle = SpecialPage::getTitleFor( 'Undelete', $title->getPrefixedDBkey() );
1043  // If the user can't undelete but can view deleted
1044  // history show them a "View .. deleted" tab instead.
1045  $msgKey = $user->isAllowed( 'undelete' ) ? 'undelete' : 'viewdeleted';
1046  $content_navigation['actions']['undelete'] = [
1047  'class' => $this->getTitle()->isSpecial( 'Undelete' ) ? 'selected' : false,
1048  'text' => wfMessageFallback( "$skname-action-$msgKey", "{$msgKey}_short" )
1049  ->setContext( $this->getContext() )->numParams( $n )->text(),
1050  'href' => $undelTitle->getLocalURL()
1051  ];
1052  }
1053  }
1054  }
1055 
1056  if ( $title->quickUserCan( 'protect', $user ) && $title->getRestrictionTypes() &&
1057  MWNamespace::getRestrictionLevels( $title->getNamespace(), $user ) !== [ '' ]
1058  ) {
1059  $mode = $title->isProtected() ? 'unprotect' : 'protect';
1060  $content_navigation['actions'][$mode] = [
1061  'class' => ( $onPage && $action == $mode ) ? 'selected' : false,
1062  'text' => wfMessageFallback( "$skname-action-$mode", $mode )
1063  ->setContext( $this->getContext() )->text(),
1064  'href' => $title->getLocalURL( "action=$mode" )
1065  ];
1066  }
1067 
1068  // Checks if the user is logged in
1069  if ( $this->loggedin && $user->isAllowedAll( 'viewmywatchlist', 'editmywatchlist' ) ) {
1079  $mode = $user->isWatched( $title ) ? 'unwatch' : 'watch';
1080  $content_navigation['actions'][$mode] = [
1081  'class' => 'mw-watchlink ' . (
1082  $onPage && ( $action == 'watch' || $action == 'unwatch' ) ? 'selected' : ''
1083  ),
1084  // uses 'watch' or 'unwatch' message
1085  'text' => $this->msg( $mode )->text(),
1086  'href' => $title->getLocalURL( [ 'action' => $mode ] ),
1087  // Set a data-mw=interface attribute, which the mediawiki.page.ajax
1088  // module will look for to make sure it's a trusted link
1089  'data' => [
1090  'mw' => 'interface',
1091  ],
1092  ];
1093  }
1094  }
1095 
1096  // Avoid PHP 7.1 warning of passing $this by reference
1097  $skinTemplate = $this;
1098  Hooks::run( 'SkinTemplateNavigation', [ &$skinTemplate, &$content_navigation ] );
1099 
1100  if ( $userCanRead && !$wgDisableLangConversion ) {
1101  $pageLang = $title->getPageLanguage();
1102  // Gets list of language variants
1103  $variants = $pageLang->getVariants();
1104  // Checks that language conversion is enabled and variants exist
1105  // And if it is not in the special namespace
1106  if ( count( $variants ) > 1 ) {
1107  // Gets preferred variant (note that user preference is
1108  // only possible for wiki content language variant)
1109  $preferred = $pageLang->getPreferredVariant();
1110  if ( Action::getActionName( $this ) === 'view' ) {
1111  $params = $request->getQueryValues();
1112  unset( $params['title'] );
1113  } else {
1114  $params = [];
1115  }
1116  // Loops over each variant
1117  foreach ( $variants as $code ) {
1118  // Gets variant name from language code
1119  $varname = $pageLang->getVariantname( $code );
1120  // Appends variant link
1121  $content_navigation['variants'][] = [
1122  'class' => ( $code == $preferred ) ? 'selected' : false,
1123  'text' => $varname,
1124  'href' => $title->getLocalURL( [ 'variant' => $code ] + $params ),
1125  'lang' => wfBCP47( $code ),
1126  'hreflang' => wfBCP47( $code ),
1127  ];
1128  }
1129  }
1130  }
1131  } else {
1132  // If it's not content, it's got to be a special page
1133  $content_navigation['namespaces']['special'] = [
1134  'class' => 'selected',
1135  'text' => $this->msg( 'nstab-special' )->text(),
1136  'href' => $request->getRequestURL(), // @see: T4457, T4510
1137  'context' => 'subject'
1138  ];
1139 
1140  // Avoid PHP 7.1 warning of passing $this by reference
1141  $skinTemplate = $this;
1142  Hooks::run( 'SkinTemplateNavigation::SpecialPage',
1143  [ &$skinTemplate, &$content_navigation ] );
1144  }
1145 
1146  // Avoid PHP 7.1 warning of passing $this by reference
1147  $skinTemplate = $this;
1148  // Equiv to SkinTemplateContentActions
1149  Hooks::run( 'SkinTemplateNavigation::Universal', [ &$skinTemplate, &$content_navigation ] );
1150 
1151  // Setup xml ids and tooltip info
1152  foreach ( $content_navigation as $section => &$links ) {
1153  foreach ( $links as $key => &$link ) {
1154  $xmlID = $key;
1155  if ( isset( $link['context'] ) && $link['context'] == 'subject' ) {
1156  $xmlID = 'ca-nstab-' . $xmlID;
1157  } elseif ( isset( $link['context'] ) && $link['context'] == 'talk' ) {
1158  $xmlID = 'ca-talk';
1159  $link['rel'] = 'discussion';
1160  } elseif ( $section == 'variants' ) {
1161  $xmlID = 'ca-varlang-' . $xmlID;
1162  } else {
1163  $xmlID = 'ca-' . $xmlID;
1164  }
1165  $link['id'] = $xmlID;
1166  }
1167  }
1168 
1169  # We don't want to give the watch tab an accesskey if the
1170  # page is being edited, because that conflicts with the
1171  # accesskey on the watch checkbox. We also don't want to
1172  # give the edit tab an accesskey, because that's fairly
1173  # superfluous and conflicts with an accesskey (Ctrl-E) often
1174  # used for editing in Safari.
1175  if ( in_array( $action, [ 'edit', 'submit' ] ) ) {
1176  if ( isset( $content_navigation['views']['edit'] ) ) {
1177  $content_navigation['views']['edit']['tooltiponly'] = true;
1178  }
1179  if ( isset( $content_navigation['actions']['watch'] ) ) {
1180  $content_navigation['actions']['watch']['tooltiponly'] = true;
1181  }
1182  if ( isset( $content_navigation['actions']['unwatch'] ) ) {
1183  $content_navigation['actions']['unwatch']['tooltiponly'] = true;
1184  }
1185  }
1186 
1187  return $content_navigation;
1188  }
1189 
1195  private function buildContentActionUrls( $content_navigation ) {
1196  // content_actions has been replaced with content_navigation for backwards
1197  // compatibility and also for skins that just want simple tabs content_actions
1198  // is now built by flattening the content_navigation arrays into one
1199 
1200  $content_actions = [];
1201 
1202  foreach ( $content_navigation as $links ) {
1203  foreach ( $links as $key => $value ) {
1204  if ( isset( $value['redundant'] ) && $value['redundant'] ) {
1205  // Redundant tabs are dropped from content_actions
1206  continue;
1207  }
1208 
1209  // content_actions used to have ids built using the "ca-$key" pattern
1210  // so the xmlID based id is much closer to the actual $key that we want
1211  // for that reason we'll just strip out the ca- if present and use
1212  // the latter potion of the "id" as the $key
1213  if ( isset( $value['id'] ) && substr( $value['id'], 0, 3 ) == 'ca-' ) {
1214  $key = substr( $value['id'], 3 );
1215  }
1216 
1217  if ( isset( $content_actions[$key] ) ) {
1218  wfDebug( __METHOD__ . ": Found a duplicate key for $key while flattening " .
1219  "content_navigation into content_actions.\n" );
1220  continue;
1221  }
1222 
1223  $content_actions[$key] = $value;
1224  }
1225  }
1226 
1227  return $content_actions;
1228  }
1229 
1234  protected function buildNavUrls() {
1236 
1237  $out = $this->getOutput();
1238  $request = $this->getRequest();
1239 
1240  $nav_urls = [];
1241  $nav_urls['mainpage'] = [ 'href' => self::makeMainPageUrl() ];
1242  if ( $wgUploadNavigationUrl ) {
1243  $nav_urls['upload'] = [ 'href' => $wgUploadNavigationUrl ];
1244  } elseif ( UploadBase::isEnabled() && UploadBase::isAllowed( $this->getUser() ) === true ) {
1245  $nav_urls['upload'] = [ 'href' => self::makeSpecialUrl( 'Upload' ) ];
1246  } else {
1247  $nav_urls['upload'] = false;
1248  }
1249  $nav_urls['specialpages'] = [ 'href' => self::makeSpecialUrl( 'Specialpages' ) ];
1250 
1251  $nav_urls['print'] = false;
1252  $nav_urls['permalink'] = false;
1253  $nav_urls['info'] = false;
1254  $nav_urls['whatlinkshere'] = false;
1255  $nav_urls['recentchangeslinked'] = false;
1256  $nav_urls['contributions'] = false;
1257  $nav_urls['log'] = false;
1258  $nav_urls['blockip'] = false;
1259  $nav_urls['emailuser'] = false;
1260  $nav_urls['userrights'] = false;
1261 
1262  // A print stylesheet is attached to all pages, but nobody ever
1263  // figures that out. :) Add a link...
1264  if ( !$out->isPrintable() && ( $out->isArticle() || $this->getTitle()->isSpecialPage() ) ) {
1265  $nav_urls['print'] = [
1266  'text' => $this->msg( 'printableversion' )->text(),
1267  'href' => $this->getTitle()->getLocalURL(
1268  $request->appendQueryValue( 'printable', 'yes' ) )
1269  ];
1270  }
1271 
1272  if ( $out->isArticle() ) {
1273  // Also add a "permalink" while we're at it
1274  $revid = $this->getRevisionId();
1275  if ( $revid ) {
1276  $nav_urls['permalink'] = [
1277  'text' => $this->msg( 'permalink' )->text(),
1278  'href' => $this->getTitle()->getLocalURL( "oldid=$revid" )
1279  ];
1280  }
1281 
1282  // Avoid PHP 7.1 warning of passing $this by reference
1283  $skinTemplate = $this;
1284  // Use the copy of revision ID in case this undocumented, shady hook tries to mess with internals
1285  Hooks::run( 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink',
1286  [ &$skinTemplate, &$nav_urls, &$revid, &$revid ] );
1287  }
1288 
1289  if ( $out->isArticleRelated() ) {
1290  $nav_urls['whatlinkshere'] = [
1291  'href' => SpecialPage::getTitleFor( 'Whatlinkshere', $this->thispage )->getLocalURL()
1292  ];
1293 
1294  $nav_urls['info'] = [
1295  'text' => $this->msg( 'pageinfo-toolboxlink' )->text(),
1296  'href' => $this->getTitle()->getLocalURL( "action=info" )
1297  ];
1298 
1299  if ( $this->getTitle()->exists() || $this->getTitle()->inNamespace( NS_CATEGORY ) ) {
1300  $nav_urls['recentchangeslinked'] = [
1301  'href' => SpecialPage::getTitleFor( 'Recentchangeslinked', $this->thispage )->getLocalURL()
1302  ];
1303  }
1304  }
1305 
1306  $user = $this->getRelevantUser();
1307  if ( $user ) {
1308  $rootUser = $user->getName();
1309 
1310  $nav_urls['contributions'] = [
1311  'text' => $this->msg( 'contributions', $rootUser )->text(),
1312  'href' => self::makeSpecialUrlSubpage( 'Contributions', $rootUser ),
1313  'tooltip-params' => [ $rootUser ],
1314  ];
1315 
1316  $nav_urls['log'] = [
1317  'href' => self::makeSpecialUrlSubpage( 'Log', $rootUser )
1318  ];
1319 
1320  if ( $this->getUser()->isAllowed( 'block' ) ) {
1321  $nav_urls['blockip'] = [
1322  'text' => $this->msg( 'blockip', $rootUser )->text(),
1323  'href' => self::makeSpecialUrlSubpage( 'Block', $rootUser )
1324  ];
1325  }
1326 
1327  if ( $this->showEmailUser( $user ) ) {
1328  $nav_urls['emailuser'] = [
1329  'text' => $this->msg( 'tool-link-emailuser', $rootUser )->text(),
1330  'href' => self::makeSpecialUrlSubpage( 'Emailuser', $rootUser ),
1331  'tooltip-params' => [ $rootUser ],
1332  ];
1333  }
1334 
1335  if ( !$user->isAnon() ) {
1336  $sur = new UserrightsPage;
1337  $sur->setContext( $this->getContext() );
1338  $canChange = $sur->userCanChangeRights( $user );
1339  $nav_urls['userrights'] = [
1340  'text' => $this->msg(
1341  $canChange ? 'tool-link-userrights' : 'tool-link-userrights-readonly',
1342  $rootUser
1343  )->text(),
1344  'href' => self::makeSpecialUrlSubpage( 'Userrights', $rootUser )
1345  ];
1346  }
1347  }
1348 
1349  return $nav_urls;
1350  }
1351 
1356  protected function getNameSpaceKey() {
1357  return $this->getTitle()->getNamespaceKey();
1358  }
1359 }
Action\getActionName
static getActionName(IContextSource $context)
Get the action that will be executed, not necessarily the one passed passed through the "action" requ...
Definition: Action.php:122
$wgJsMimeType
$wgJsMimeType
Previously used as content type in HTML script tags.
Definition: DefaultSettings.php:3163
ContextSource\getConfig
getConfig()
Get the Config object.
Definition: ContextSource.php:68
SkinTemplate\useCombinedLoginLink
useCombinedLoginLink()
Output a boolean indicating if buildPersonalUrls should output separate login and create account link...
Definition: SkinTemplate.php:569
$user
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
Definition: hooks.txt:244
Skin\editUrlOptions
editUrlOptions()
Return URL options for the 'edit page' link.
Definition: Skin.php:1039
Skin\showEmailUser
showEmailUser( $id)
Definition: Skin.php:1053
SkinTemplate\setupTemplateForOutput
setupTemplateForOutput()
Definition: SkinTemplate.php:198
$wgMaxCredits
$wgMaxCredits
Set this to the number of authors that you want to be credited below an article text.
Definition: DefaultSettings.php:7054
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:268
Skin\makeUrlDetails
static makeUrlDetails( $name, $urlaction='')
these return an array with the 'href' and boolean 'exists'
Definition: Skin.php:1189
ContextSource\getContext
getContext()
Get the base IContextSource object.
Definition: ContextSource.php:41
Skin\getSiteNotice
getSiteNotice()
Get the site notice.
Definition: Skin.php:1537
wfBCP47
wfBCP47( $code)
Get the normalised IETF language tag See unit test for examples.
Definition: GlobalFunctions.php:3167
false
processing should stop and the error should be shown to the user * false
Definition: hooks.txt:187
$wgMimeType
$wgMimeType
The default Content-Type header.
Definition: DefaultSettings.php:3154
SkinTemplate\buildContentNavigationUrls
buildContentNavigationUrls()
a structured array of links usually used for the tabs in a skin
Definition: SkinTemplate.php:862
Skin\getPoweredBy
getPoweredBy()
Gets the powered by MediaWiki icon.
Definition: Skin.php:860
Profiler\instance
static instance()
Singleton.
Definition: Profiler.php:62
captcha-old.count
count
Definition: captcha-old.py:249
text
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
$wgScript
$wgScript
The URL path to index.php.
Definition: DefaultSettings.php:202
ContextSource\msg
msg( $key)
Get a Message object with context set Parameters are the same as wfMessage()
Definition: ContextSource.php:189
$wgHideInterlanguageLinks
$wgHideInterlanguageLinks
Hide interlanguage links from the sidebar.
Definition: DefaultSettings.php:2888
Skin\lastModified
lastModified()
Get the timestamp of the latest revision, formatted in user language.
Definition: Skin.php:884
$result
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:Array with elements of the form "language:title" in the order that they will be output. & $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:1963
$wgShowCreditsIfMax
$wgShowCreditsIfMax
If there are more than $wgMaxCredits authors, show $wgMaxCredits of them.
Definition: DefaultSettings.php:7060
Skin\checkTitle
static checkTitle(&$title, $name)
make sure we have some title to operate on
Definition: Skin.php:1221
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
SkinTemplate\$userpageUrlDetails
$userpageUrlDetails
Definition: SkinTemplate.php:57
Skin\makeSpecialUrl
static makeSpecialUrl( $name, $urlaction='', $proto=null)
Make a URL for a Special Page using the given query and protocol.
Definition: Skin.php:1112
Skin\aboutLink
aboutLink()
Gets the link to the wiki's about page.
Definition: Skin.php:1020
NS_FILE
const NS_FILE
Definition: Defines.php:71
SkinTemplate\$titletxt
$titletxt
Definition: SkinTemplate.php:52
$params
$params
Definition: styleTest.css.php:40
Skin\makeSpecialUrlSubpage
static makeSpecialUrlSubpage( $name, $subpage, $urlaction='')
Definition: Skin.php:1127
SkinTemplate\$thispage
$thispage
Definition: SkinTemplate.php:51
SpecialPage\getTitleFor
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
Definition: SpecialPage.php:82
ContextSource\canUseWikiPage
canUseWikiPage()
Check whether a WikiPage object can be get with getWikiPage().
Definition: ContextSource.php:100
$res
$res
Definition: database.txt:21
$name
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:302
ContextSource\getRequest
getRequest()
Get the WebRequest object.
Definition: ContextSource.php:78
SkinTemplate\setupSkinUserCss
setupSkinUserCss(OutputPage $out)
Add specific styles for this skin.
Definition: SkinTemplate.php:64
SkinTemplate\wrapHTML
wrapHTML( $title, $html)
Wrap the body text with language information and identifiable element.
Definition: SkinTemplate.php:268
User\groupHasPermission
static groupHasPermission( $group, $role)
Check, if the given group has the given permission.
Definition: User.php:4791
ContextSource\getUser
getUser()
Get the User object.
Definition: ContextSource.php:133
ContextSource\getTitle
getTitle()
Get the Title object.
Definition: ContextSource.php:88
wfMessageFallback
wfMessageFallback()
This function accepts multiple message keys and returns a message instance for the first message whic...
Definition: GlobalFunctions.php:1442
$wgLogo
$wgLogo
The URL path of the wiki logo.
Definition: DefaultSettings.php:278
$wgStylePath
$wgStylePath
The URL path of the skins directory.
Definition: DefaultSettings.php:217
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
Skin\bottomScripts
bottomScripts()
This gets called shortly before the "</body>" tag.
Definition: Skin.php:640
SkinTemplate\$userpage
$userpage
Definition: SkinTemplate.php:53
Skin\afterContentHook
afterContentHook()
This runs a hook to allow extensions placing their stuff after content and article metadata (e....
Definition: Skin.php:605
ContextSource\getLanguage
getLanguage()
Get the Language object.
Definition: ContextSource.php:143
$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:1581
NS_SPECIAL
const NS_SPECIAL
Definition: Defines.php:54
UserrightsPage
Special page to allow managing user group membership.
Definition: SpecialUserrights.php:29
SkinTemplate\getPersonalToolsList
getPersonalToolsList()
Get the HTML for the p-personal list.
Definition: SkinTemplate.php:526
$html
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 & $html
Definition: hooks.txt:1965
MWException
MediaWiki exception.
Definition: MWException.php:26
$title
namespace and then decline to actually register it file or subcat img or subcat $title
Definition: hooks.txt:932
SkinTemplate\$skinname
string $skinname
Name of our skin, it probably needs to be all lower case.
Definition: SkinTemplate.php:43
Skin\buildSidebar
buildSidebar()
Build an array that represents the sidebar(s), the navigation bar among them.
Definition: Skin.php:1251
wfDeprecated
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
Definition: GlobalFunctions.php:1176
Skin\privacyLink
privacyLink()
Gets the link to the wiki's privacy policy page.
Definition: Skin.php:1012
SkinTemplate\buildNavUrls
buildNavUrls()
build array of common navigation links
Definition: SkinTemplate.php:1234
$wgFooterIcons
$wgFooterIcons
Abstract list of footer icons for skins in place of old copyrightico and poweredbyico code You can ad...
Definition: DefaultSettings.php:3436
Skin\generateDebugHTML
generateDebugHTML()
Generate debug data HTML for displaying at the bottom of the main content area.
Definition: Skin.php:631
SkinTemplate\tabAction
tabAction( $title, $message, $selected, $query='', $checkEdit=false)
Builds an array with tab definition.
Definition: SkinTemplate.php:747
SkinTemplate\formatLanguageName
formatLanguageName( $name)
Format language name for use in sidebar interlanguage links list.
Definition: SkinTemplate.php:544
Skin\getCategories
getCategories()
Definition: Skin.php:570
SkinTemplate\buildContentActionUrls
buildContentActionUrls( $content_navigation)
an array of edit links by default used for the tabs
Definition: SkinTemplate.php:1195
ContextSource\getOutput
getOutput()
Get the OutputPage object.
Definition: ContextSource.php:123
ContextSource\getWikiPage
getWikiPage()
Get the WikiPage object.
Definition: ContextSource.php:113
SkinTemplate\$username
$username
Definition: SkinTemplate.php:56
Skin\isRevisionCurrent
isRevisionCurrent()
Whether the revision displayed is the latest revision of the page.
Definition: Skin.php:285
SkinTemplate\$loggedin
$loggedin
Definition: SkinTemplate.php:55
$wgUseCombinedLoginLink
$wgUseCombinedLoginLink
Login / create account link behavior when it's possible for anonymous users to create an account.
Definition: DefaultSettings.php:3458
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
NS_CATEGORY
const NS_CATEGORY
Definition: Defines.php:79
Skin\disclaimerLink
disclaimerLink()
Gets the link to the wiki's general disclaimers page.
Definition: Skin.php:1028
MWNamespace\getRestrictionLevels
static getRestrictionLevels( $index, User $user=null)
Determine which restriction levels it makes sense to use in a namespace, optionally filtered by a use...
Definition: MWNamespace.php:465
wfDebug
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
Definition: GlobalFunctions.php:1047
$wgDisableLangConversion
$wgDisableLangConversion
Whether to enable language variant conversion.
Definition: DefaultSettings.php:3032
ContextSource\setContext
setContext(IContextSource $context)
Set the IContextSource object.
Definition: ContextSource.php:58
OutputPage
This class should be covered by a general architecture document which does not exist as of January 20...
Definition: OutputPage.php:44
list
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
Definition: deferred.txt:11
SkinTemplate\$thisquery
$thisquery
Definition: SkinTemplate.php:54
$request
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 you ll probably need to make sure the header is varied on $request
Definition: hooks.txt:2581
SkinTemplate\prepareQuickTemplate
prepareQuickTemplate()
initialize various variables and generate the template
Definition: SkinTemplate.php:294
Skin\getRelevantTitle
getRelevantTitle()
Return the "relevant" title.
Definition: Skin.php:309
$value
$value
Definition: styleTest.css.php:45
SkinTemplate\$template
string $template
For QuickTemplate, the name of the subclass which will actually fill the template.
Definition: SkinTemplate.php:49
$wgServer
$wgServer
URL of the server.
Definition: DefaultSettings.php:109
$wgSitename
$wgSitename
Name of the site.
Definition: DefaultSettings.php:83
Skin\printSource
printSource()
Text with the permalink to the source page, usually shown on the footer of a printed page.
Definition: Skin.php:656
SkinTemplate\makeArticleUrlDetails
makeArticleUrlDetails( $name, $urlaction='')
Definition: SkinTemplate.php:818
SpecialPageFactory\resolveAlias
static resolveAlias( $alias)
Given a special page name with a possible subpage, return an array where the first element is the spe...
Definition: SpecialPageFactory.php:338
Language\fetchLanguageName
static fetchLanguageName( $code, $inLanguage=null, $include='all')
Definition: Language.php:896
SkinTemplate\makeTalkUrlDetails
makeTalkUrlDetails( $name, $urlaction='')
Definition: SkinTemplate.php:799
$wgUploadNavigationUrl
$wgUploadNavigationUrl
Point the upload navigation link to an external URL Useful if you want to use a shared repository by ...
Definition: DefaultSettings.php:800
MediaWiki\Auth\AuthManager
This serves as the entry point to the authentication system.
Definition: AuthManager.php:82
wfReportTime
wfReportTime()
Returns a script tag that stores the amount of time it took MediaWiki to handle the request in millis...
Definition: GlobalFunctions.php:1521
Skin\logoText
logoText( $align='')
Definition: Skin.php:911
SkinTemplate\getLanguages
getLanguages()
Generates array of language links for the current page.
Definition: SkinTemplate.php:103
Skin\getNewtalks
getNewtalks()
Gets new talk page messages for the current user and returns an appropriate alert message (or an empt...
Definition: Skin.php:1394
$wgArticlePath
$wgArticlePath
Definition: img_auth.php:45
SkinTemplate\getNameSpaceKey
getNameSpaceKey()
Generate strings used for xml 'id' names.
Definition: SkinTemplate.php:1356
Title
Represents a title within MediaWiki.
Definition: Title.php:39
Skin\escapeSearchLink
escapeSearchLink()
Definition: Skin.php:776
$code
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 modifiable & $code
Definition: hooks.txt:781
$section
usually copyright or history_copyright This message must be in HTML not wikitext if the section is included from a template $section
Definition: hooks.txt:2981
Title\isSpecialPage
isSpecialPage()
Returns true if this is a special page.
Definition: Title.php:1122
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
Skin\getCopyright
getCopyright( $type='detect')
Definition: Skin.php:784
SkinTemplate\outputPage
outputPage(OutputPage $out=null)
initialize various variables and generate the template
Definition: SkinTemplate.php:235
Html\rawElement
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
Definition: Html.php:209
SpecialPage\setContext
setContext( $context)
Sets the context this SpecialPage is executed in.
Definition: SpecialPage.php:638
Skin\getRelevantUser
getRelevantUser()
Return the "relevant" user.
Definition: Skin.php:333
Skin\subPageSubtitle
subPageSubtitle( $out=null)
Definition: Skin.php:703
$link
usually copyright or history_copyright This message must be in HTML not wikitext & $link
Definition: hooks.txt:2981
true
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 true
Definition: hooks.txt:1965
Skin\getUndeleteLink
getUndeleteLink()
Definition: Skin.php:674
Skin\makeKnownUrlDetails
static makeKnownUrlDetails( $name, $urlaction='')
Make URL details where the article exists (or at least it's convenient to think so)
Definition: Skin.php:1205
wfMessage
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "&lt
Skin\makeMainPageUrl
static makeMainPageUrl( $urlaction='')
Definition: Skin.php:1094
NS_MEDIAWIKI
const NS_MEDIAWIKI
Definition: Defines.php:73
class
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class
Definition: maintenance.txt:52
Skin\getCopyrightIcon
getCopyrightIcon()
Definition: Skin.php:830
MediaWikiServices
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 MediaWikiServices
Definition: injection.txt:23
Skin
The main skin class which provides methods and properties for all other skins.
Definition: Skin.php:36
MWNamespace\getSubject
static getSubject( $index)
Get the subject namespace index for a given namespace Special namespaces (NS_MEDIA,...
Definition: MWNamespace.php:121
Skin\initPage
initPage(OutputPage $out)
Definition: Skin.php:146
$wgScriptPath
$wgScriptPath
The path we should point to.
Definition: DefaultSettings.php:141
Hooks\run
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Definition: Hooks.php:203
Skin\getRevisionId
getRevisionId()
Get the current revision ID.
Definition: Skin.php:276
SkinTemplate
Base class for template-based skins.
Definition: SkinTemplate.php:38
Action\factory
static factory( $action, Page $page, IContextSource $context=null)
Get an appropriate Action subclass for the given action.
Definition: Action.php:95
SkinTemplate\printOrError
printOrError( $str)
Output the string, or print error message if it's an error object of the appropriate type.
Definition: SkinTemplate.php:556
$wgContLang
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the content language as $wgContLang
Definition: design.txt:56
SkinTemplate\setupTemplate
setupTemplate( $classname, $repository=false, $cache_dir=false)
Create the template engine object; we feed it a bunch of data and eventually it spits out some HTML.
Definition: SkinTemplate.php:94
wfArrayToCgi
wfArrayToCgi( $array1, $array2=null, $prefix='')
This function takes one or two arrays as input, and returns a CGI-style string, e....
Definition: GlobalFunctions.php:442
$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:781
SkinTemplate\buildPersonalUrls
buildPersonalUrls()
build array of urls for personal toolbar
Definition: SkinTemplate.php:578