MediaWiki  1.32.5
TimelessTemplate.php
Go to the documentation of this file.
1 <?php
8 
10  protected $pileOfTools;
11 
15  public function execute() {
16  $this->pileOfTools = $this->getPageTools();
17  $userLinks = $this->getUserLinks();
18 
19  // Open html, body elements, etc
20  $html = $this->get( 'headelement' );
21 
22  $html .= Html::openElement( 'div', [ 'id' => 'mw-wrapper', 'class' => $userLinks['class'] ] );
23 
24  $html .= Html::rawElement( 'div', [ 'id' => 'mw-header-container', 'class' => 'ts-container' ],
25  Html::rawElement( 'div', [ 'id' => 'mw-header', 'class' => 'ts-inner' ],
26  $userLinks['html'] .
27  $this->getLogo( 'p-logo-text', 'text' ) .
28  $this->getSearch()
29  ) .
30  $this->getClear()
31  );
32  $html .= $this->getHeaderHack();
33 
34  // For mobile
35  $html .= Html::element( 'div', [ 'id' => 'menus-cover' ] );
36 
37  $html .= Html::rawElement( 'div', [ 'id' => 'mw-content-container', 'class' => 'ts-container' ],
38  Html::rawElement( 'div', [ 'id' => 'mw-content-block', 'class' => 'ts-inner' ],
39  Html::rawElement( 'div', [ 'id' => 'mw-content-wrapper' ],
40  Html::rawElement( 'div', [ 'id' => 'mw-content' ],
41  Html::rawElement( 'div', [ 'id' => 'content', 'class' => 'mw-body', 'role' => 'main' ],
42  $this->getSiteNotices() .
43  $this->getIndicators() .
45  'h1',
46  [
47  'id' => 'firstHeading',
48  'class' => 'firstHeading',
49  'lang' => $this->get( 'pageLanguage' )
50  ],
51  $this->get( 'title' )
52  ) .
53  Html::rawElement( 'div', [ 'id' => 'siteSub' ], $this->getMsg( 'tagline' )->parse() ) .
54  Html::rawElement( 'div', [ 'id' => 'mw-page-header-links' ],
55  $this->getPortlet(
56  'namespaces',
57  $this->pileOfTools['namespaces'],
58  'timeless-namespaces'
59  ) .
60  $this->getPortlet(
61  'more',
62  $this->pileOfTools['more'],
63  'timeless-more'
64  ) .
65  $this->getPortlet(
66  'views',
67  $this->pileOfTools['page-primary'],
68  'timeless-pagetools'
69  )
70  ) .
71  $this->getClear() .
72  Html::rawElement( 'div', [ 'class' => 'mw-body-content', 'id' => 'bodyContent' ],
73  $this->getContentSub() .
74  $this->get( 'bodytext' ) .
75  $this->getClear()
76  )
77  )
78  ) .
79  $this->getAfterContent()
80  ) .
81  Html::rawElement( 'div', [ 'id' => 'mw-site-navigation' ],
82  $this->getLogo( 'p-logo', 'image' ) .
83  $this->getMainNavigation() .
84  $this->getSidebarChunk(
85  'site-tools',
86  'timeless-sitetools',
87  $this->getPortlet(
88  'tb',
89  $this->pileOfTools['general'],
90  'timeless-sitetools'
91  )
92  )
93  ) .
94  Html::rawElement( 'div', [ 'id' => 'mw-related-navigation' ],
95  $this->getPageToolSidebar() .
96  $this->getInterlanguageLinks() .
97  $this->getCategories()
98  ) .
99  $this->getClear()
100  )
101  );
102 
103  $html .= Html::rawElement( 'div', [ 'id' => 'mw-footer-container', 'class' => 'ts-container' ],
104  Html::rawElement( 'div', [ 'id' => 'mw-footer', 'class' => 'ts-inner' ],
105  $this->getFooter()
106  )
107  );
108 
109  $html .= Html::closeElement( 'div' );
110 
111  // BaseTemplate::printTrail() stuff (has no get version)
112  // Required for RL to run
113  $html .= MWDebug::getDebugHTML( $this->getSkin()->getContext() );
114  $html .= $this->get( 'bottomscripts' );
115  $html .= $this->get( 'reporttime' );
116 
117  $html .= Html::closeElement( 'body' );
118  $html .= Html::closeElement( 'html' );
119 
120  // The unholy echo
121  echo $html;
122  }
123 
145  protected function getPortlet( $name, $content, $msg = null ) {
146  if ( $msg === null ) {
147  $msg = $name;
148  } elseif ( is_array( $msg ) ) {
149  $msgString = array_shift( $msg );
150  $msgParams = $msg;
151  $msg = $msgString;
152  }
153  $msgObj = $this->getMsg( $msg );
154  if ( $msgObj->exists() ) {
155  if ( isset( $msgParams ) && !empty( $msgParams ) ) {
156  $msgObj->params( $msgParams );
157  }
158  $msgString = $msgObj->parse();
159  } else {
160  $msgString = htmlspecialchars( $msg );
161  }
162 
163  // HACK: Compatibility with extensions still using SkinTemplateToolboxEnd
164  $hookContents = '';
165  if ( $name == 'tb' ) {
166  if ( isset( $boxes['TOOLBOX'] ) ) {
167  ob_start();
168  // We pass an extra 'true' at the end so extensions using BaseTemplateToolbox
169  // can abort and avoid outputting double toolbox links
170  // Avoid PHP 7.1 warning from passing $this by reference
171  $template = $this;
172  Hooks::run( 'SkinTemplateToolboxEnd', [ &$template, true ] );
173  $hookContents = ob_get_contents();
174  ob_end_clean();
175  if ( !trim( $hookContents ) ) {
176  $hookContents = '';
177  }
178  }
179  }
180  // END hack
181 
182  $labelId = Sanitizer::escapeId( "p-$name-label" );
183 
184  if ( is_array( $content ) ) {
185  $contentText = Html::openElement( 'ul' );
186  if ( $content !== [] ) {
187  foreach ( $content as $key => $item ) {
188  $contentText .= $this->makeListItem(
189  $key,
190  $item,
191  [ 'text-wrapper' => [ 'tag' => 'span' ] ]
192  );
193  }
194  }
195  // Add in SkinTemplateToolboxEnd, if any
196  $contentText .= $hookContents;
197  $contentText .= Html::closeElement( 'ul' );
198  } else {
199  $contentText = $content;
200  }
201 
202  $html = Html::rawElement( 'div', [
203  'role' => 'navigation',
204  'class' => [ 'mw-portlet', 'emptyPortlet' => !$content ],
205  'id' => Sanitizer::escapeId( 'p-' . $name ),
206  'title' => Linker::titleAttrib( 'p-' . $name ),
207  'aria-labelledby' => $labelId
208  ],
209  Html::rawElement( 'h3', [
210  'id' => $labelId,
211  'lang' => $this->get( 'userlang' ),
212  'dir' => $this->get( 'dir' )
213  ],
214  $msgString
215  ) .
216  Html::rawElement( 'div', [ 'class' => 'mw-portlet-body' ],
217  $contentText .
218  $this->getAfterPortlet( $name )
219  )
220  );
221 
222  return $html;
223  }
224 
234  protected function getSidebarChunk( $id, $headerMessage, $content ) {
235  $html = '';
236 
238  'div',
239  [ 'id' => Sanitizer::escapeId( $id ), 'class' => 'sidebar-chunk' ],
240  Html::rawElement( 'h2', [],
241  Html::element( 'span', [],
242  $this->getMsg( $headerMessage )->text()
243  ) .
244  Html::element( 'div', [ 'class' => 'pokey' ] )
245  ) .
246  Html::rawElement( 'div', [ 'class' => 'sidebar-inner' ], $content )
247  );
248 
249  return $html;
250  }
251 
260  protected function getLogo( $id = 'p-logo', $part = 'both' ) {
261  $html = '';
262  $language = $this->getSkin()->getLanguage();
263 
265  'div',
266  [
267  'id' => Sanitizer::escapeId( $id ),
268  'class' => 'mw-portlet',
269  'role' => 'banner'
270  ]
271  );
272  if ( $part !== 'image' ) {
273  $titleClass = '';
274  if ( $language->hasVariants() ) {
275  $siteTitle = $language->convert( $this->getMsg( 'timeless-sitetitle' )->escaped() );
276  } else {
277  $siteTitle = $this->getMsg( 'timeless-sitetitle' )->escaped();
278  }
279  // width is 11em; 13 characters will probably fit?
280  if ( mb_strlen( $siteTitle ) > 13 ) {
281  $titleClass = 'long';
282  }
283  $html .= Html::rawElement( 'a', [
284  'id' => 'p-banner',
285  'class' => [ 'mw-wiki-title', $titleClass ],
286  'href' => $this->data['nav_urls']['mainpage']['href']
287  ],
288  $siteTitle
289  );
290  }
291  if ( $part !== 'text' ) {
292  $html .= Html::element( 'a', array_merge(
293  [
294  'class' => 'mw-wiki-logo',
295  'href' => $this->data['nav_urls']['mainpage']['href']
296  ],
298  ) );
299  }
300  $html .= Html::closeElement( 'div' );
301 
302  return $html;
303  }
304 
310  protected function getSearch() {
311  $html = '';
312 
313  $html .= Html::openElement( 'div', [ 'class' => 'mw-portlet', 'id' => 'p-search' ] );
314 
316  'h3',
317  [ 'lang' => $this->get( 'userlang' ), 'dir' => $this->get( 'dir' ) ],
318  Html::rawElement( 'label', [ 'for' => 'searchInput' ], $this->getMsg( 'search' )->escaped() )
319  );
320 
321  $html .= Html::rawElement( 'form', [ 'action' => $this->get( 'wgScript' ), 'id' => 'searchform' ],
322  Html::rawElement( 'div', [ 'id' => 'simpleSearch' ],
323  Html::rawElement( 'div', [ 'id' => 'searchInput-container' ],
324  $this->makeSearchInput( [
325  'id' => 'searchInput'
326  ] )
327  ) .
328  Html::hidden( 'title', $this->get( 'searchtitle' ) ) .
329  $this->makeSearchButton(
330  'fulltext',
331  [ 'id' => 'mw-searchButton', 'class' => 'searchButton mw-fallbackSearchButton' ]
332  ) .
333  $this->makeSearchButton(
334  'go',
335  [ 'id' => 'searchButton', 'class' => 'searchButton' ]
336  )
337  )
338  );
339 
340  $html .= Html::closeElement( 'div' );
341 
342  return $html;
343  }
344 
350  protected function getMainNavigation() {
351  $sidebar = $this->getSidebar();
352  $html = '';
353 
354  // Already hardcoded into header
355  $sidebar['SEARCH'] = false;
356  // Parsed as part of pageTools
357  $sidebar['TOOLBOX'] = false;
358  // Forcibly removed to separate chunk
359  $sidebar['LANGUAGES'] = false;
360 
361  foreach ( $sidebar as $name => $content ) {
362  if ( $content === false ) {
363  continue;
364  }
365  // Numeric strings gets an integer when set as key, cast back - T73639
366  $name = (string)$name;
367  $html .= $this->getPortlet( $name, $content['content'] );
368  }
369 
370  $html = $this->getSidebarChunk( 'site-navigation', 'navigation', $html );
371 
372  return $html;
373  }
374 
381  protected function getHeaderHack() {
382  $html = '';
383 
384  // These are almost exactly the same and this is stupid.
385  $html .= Html::rawElement( 'div', [ 'id' => 'mw-header-hack', 'class' => 'color-bar' ],
386  Html::rawElement( 'div', [ 'class' => 'color-middle-container' ],
387  Html::element( 'div', [ 'class' => 'color-middle' ] )
388  ) .
389  Html::element( 'div', [ 'class' => 'color-left' ] ) .
390  Html::element( 'div', [ 'class' => 'color-right' ] )
391  );
392  $html .= Html::rawElement( 'div', [ 'id' => 'mw-header-nav-hack' ],
393  Html::rawElement( 'div', [ 'class' => 'color-bar' ],
394  Html::rawElement( 'div', [ 'class' => 'color-middle-container' ],
395  Html::element( 'div', [ 'class' => 'color-middle' ] )
396  ) .
397  Html::element( 'div', [ 'class' => 'color-left' ] ) .
398  Html::element( 'div', [ 'class' => 'color-right' ] )
399  )
400  );
401 
402  return $html;
403  }
404 
410  protected function getPageToolSidebar() {
411  $pageTools = '';
412  $pageTools .= $this->getPortlet(
413  'cactions',
414  $this->pileOfTools['page-secondary'],
415  'timeless-pageactions'
416  );
417  $pageTools .= $this->getPortlet(
418  'userpagetools',
419  $this->pileOfTools['user'],
420  'timeless-userpagetools'
421  );
422  $pageTools .= $this->getPortlet(
423  'pagemisc',
424  $this->pileOfTools['page-tertiary'],
425  'timeless-pagemisc'
426  );
427 
428  return $this->getSidebarChunk( 'page-tools', 'timeless-pageactions', $pageTools );
429  }
430 
437  protected function getUserLinks() {
438  $user = $this->getSkin()->getUser();
439  $personalTools = $this->getPersonalTools();
440 
441  $html = '';
442  $extraTools = [];
443 
444  // Remove Echo badges
445  if ( isset( $personalTools['notifications-alert'] ) ) {
446  $extraTools['notifications-alert'] = $personalTools['notifications-alert'];
447  unset( $personalTools['notifications-alert'] );
448  }
449  if ( isset( $personalTools['notifications-notice'] ) ) {
450  $extraTools['notifications-notice'] = $personalTools['notifications-notice'];
451  unset( $personalTools['notifications-notice'] );
452  }
453  $class = empty( $extraTools ) ? '' : 'extension-icons';
454 
455  // Re-label some messages
456  if ( isset( $personalTools['userpage'] ) ) {
457  $personalTools['userpage']['links'][0]['text'] = $this->getMsg( 'timeless-userpage' )->text();
458  }
459  if ( isset( $personalTools['mytalk'] ) ) {
460  $personalTools['mytalk']['links'][0]['text'] = $this->getMsg( 'timeless-talkpage' )->text();
461  }
462 
463  // Labels
464  if ( $user->isLoggedIn() ) {
465  $userName = $user->getName();
466  // Make sure it fits first (numbers slightly made up, may need adjusting)
467  $fit = empty( $extraTools ) ? 13 : 9;
468  if ( mb_strlen( $userName ) < $fit ) {
469  $dropdownHeader = $userName;
470  } else {
471  $dropdownHeader = $this->getMsg( 'timeless-loggedin' )->text();
472  }
473  $headerMsg = [ 'timeless-loggedinas', $user->getName() ];
474  } else {
475  $dropdownHeader = $this->getMsg( 'timeless-anonymous' )->text();
476  $headerMsg = 'timeless-notloggedin';
477  }
478  $html .= Html::openElement( 'div', [ 'id' => 'user-tools' ] );
479 
480  $html .= Html::rawElement( 'div', [ 'id' => 'personal' ],
481  Html::rawElement( 'h2', [],
482  Html::element( 'span', [], $dropdownHeader ) .
483  Html::element( 'div', [ 'class' => 'pokey' ] )
484  ) .
485  Html::rawElement( 'div', [ 'id' => 'personal-inner', 'class' => 'dropdown' ],
486  $this->getPortlet( 'personal', $personalTools, $headerMsg )
487  )
488  );
489 
490  // Extra icon stuff (echo etc)
491  if ( !empty( $extraTools ) ) {
492  $iconList = '';
493  foreach ( $extraTools as $key => $item ) {
494  $iconList .= $this->makeListItem( $key, $item );
495  }
496 
498  'div',
499  [ 'id' => 'personal-extra', 'class' => 'p-body' ],
500  Html::rawElement( 'ul', [], $iconList )
501  );
502  }
503 
504  $html .= Html::closeElement( 'div' );
505 
506  return [
507  'html' => $html,
508  'class' => $class
509  ];
510  }
511 
517  protected function getSiteNotices() {
518  $html = '';
519 
520  if ( $this->data['sitenotice'] ) {
521  $html .= Html::rawElement( 'div', [ 'id' => 'siteNotice' ], $this->get( 'sitenotice' ) );
522  }
523  if ( $this->data['newtalk'] ) {
524  $html .= Html::rawElement( 'div', [ 'class' => 'usermessage' ], $this->get( 'newtalk' ) );
525  }
526 
527  return $html;
528  }
529 
535  protected function getContentSub() {
536  $html = '';
537 
538  $html .= Html::openElement( 'div', [ 'id' => 'contentSub' ] );
539  if ( $this->data['subtitle'] ) {
540  $html .= $this->get( 'subtitle' );
541  }
542  if ( $this->data['undelete'] ) {
543  $html .= $this->get( 'undelete' );
544  }
545  $html .= Html::closeElement( 'div' );
546 
547  return $html;
548  }
549 
556  protected function getAfterContent() {
557  $html = '';
558 
559  if ( $this->data['catlinks'] || $this->data['dataAfterContent'] ) {
560  $html .= Html::openElement( 'div', [ 'id' => 'content-bottom-stuff' ] );
561  if ( $this->data['catlinks'] ) {
562  $html .= $this->get( 'catlinks' );
563  }
564  if ( $this->data['dataAfterContent'] ) {
565  $html .= $this->get( 'dataAfterContent' );
566  }
567  $html .= Html::closeElement( 'div' );
568  }
569 
570  return $html;
571  }
572 
582  protected function getPageTools() {
583  $title = $this->getSkin()->getTitle();
584  $namespace = $title->getNamespace();
585 
586  $sortedPileOfTools = [
587  'namespaces' => [],
588  'page-primary' => [],
589  'page-secondary' => [],
590  'user' => [],
591  'page-tertiary' => [],
592  'more' => [],
593  'general' => []
594  ];
595 
596  // Tools specific to the page
597  $pileOfEditTools = [];
598  foreach ( $this->data['content_navigation'] as $navKey => $navBlock ) {
599  // Just use namespaces items as they are
600  if ( $navKey == 'namespaces' ) {
601  if ( $namespace < 0 ) {
602  // Put special page ns_pages in the more pile so they're not so lonely
603  $sortedPileOfTools['page-tertiary'] = $navBlock;
604  } else {
605  $sortedPileOfTools['namespaces'] = $navBlock;
606  }
607  } else {
608  $pileOfEditTools = array_merge( $pileOfEditTools, $navBlock );
609  }
610  }
611 
612  // Tools that may be general or page-related (typically the toolbox)
613  $pileOfTools = $this->getToolbox();
614  if ( $namespace >= 0 ) {
615  $pileOfTools['pagelog'] = [
616  'text' => $this->getMsg( 'timeless-pagelog' )->text(),
617  'href' => SpecialPage::getTitleFor( 'Log', $title->getPrefixedText() )->getLocalURL(),
618  'id' => 't-pagelog'
619  ];
620  }
621  $pileOfTools['more'] = [
622  'text' => $this->getMsg( 'timeless-more' )->text(),
623  'id' => 'ca-more',
624  'class' => 'dropdown-toggle'
625  ];
626 
627  // Only appears in mobile
628  if ( $this->data['language_urls'] !== false ) {
629  $pileOfTools['languages'] = [
630  'text' => $this->getMsg( 'timeless-languages' )->escaped(),
631  'id' => 'ca-languages',
632  'class' => 'dropdown-toggle'
633  ];
634  }
635 
636  // This is really dumb, and you're an idiot for doing it this way.
637  // Obviously if you're not the idiot who did this, I don't mean you.
638  foreach ( $pileOfEditTools as $navKey => $navBlock ) {
639  $currentSet = null;
640 
641  if ( in_array( $navKey, [
642  'watch',
643  'unwatch'
644  ] ) ) {
645  $currentSet = 'namespaces';
646  } elseif ( in_array( $navKey, [
647  'edit',
648  'view',
649  'history',
650  'addsection',
651  'viewsource'
652  ] ) ) {
653  $currentSet = 'page-primary';
654  } elseif ( in_array( $navKey, [
655  'delete',
656  'rename',
657  'protect',
658  'unprotect',
659  'move'
660  ] ) ) {
661  $currentSet = 'page-secondary';
662  } else {
663  // Catch random extension ones?
664  $currentSet = 'page-primary';
665  }
666  $sortedPileOfTools[$currentSet][$navKey] = $navBlock;
667  }
668  foreach ( $pileOfTools as $navKey => $navBlock ) {
669  $currentSet = null;
670 
671  if ( $navKey === 'contributions' ) {
672  $currentSet = 'page-primary';
673  } elseif ( in_array( $navKey, [
674  'blockip',
675  'userrights',
676  'log'
677  ] ) ) {
678  $currentSet = 'user';
679  } elseif ( in_array( $navKey, [
680  'whatlinkshere',
681  'print',
682  'info',
683  'pagelog',
684  'recentchangeslinked',
685  'permalink'
686  ] ) ) {
687  $currentSet = 'page-tertiary';
688  } elseif ( in_array( $navKey, [
689  'more',
690  'languages'
691  ] ) ) {
692  $currentSet = 'more';
693  } else {
694  $currentSet = 'general';
695  }
696  $sortedPileOfTools[$currentSet][$navKey] = $navBlock;
697  }
698 
699  return $sortedPileOfTools;
700  }
701 
710  protected function getCategories() {
711  $skin = $this->getSkin();
712  $catList = '';
713  $html = '';
714 
715  $allCats = $skin->getOutput()->getCategoryLinks();
716  if ( !empty( $allCats ) ) {
717  if ( !empty( $allCats['normal'] ) ) {
718  $catHeader = 'categories';
719  $catList .= $this->getCatList(
720  $allCats['normal'],
721  'normal-catlinks',
722  'mw-normal-catlinks',
723  'categories'
724  );
725  } else {
726  $catHeader = 'hidden-categories';
727  }
728 
729  if ( isset( $allCats['hidden'] ) ) {
730  $hiddenCatClass = [ 'mw-hidden-catlinks' ];
731  if ( $skin->getUser()->getBoolOption( 'showhiddencats' ) ) {
732  $hiddenCatClass[] = 'mw-hidden-cats-user-shown';
733  } elseif ( $skin->getTitle()->getNamespace() == NS_CATEGORY ) {
734  $hiddenCatClass[] = 'mw-hidden-cats-ns-shown';
735  } else {
736  $hiddenCatClass[] = 'mw-hidden-cats-hidden';
737  }
738  $catList .= $this->getCatList(
739  $allCats['hidden'],
740  'hidden-catlinks',
741  $hiddenCatClass,
742  [ 'hidden-categories', count( $allCats['hidden'] ) ]
743  );
744  }
745  }
746 
747  if ( $catList !== '' ) {
748  $html = $this->getSidebarChunk( 'catlinks-sidebar', $catHeader, $catList );
749  }
750 
751  return $html;
752  }
753 
764  protected function getCatList( $list, $id, $class, $message ) {
765  $html = Html::openElement( 'div', [ 'id' => "sidebar-{$id}", 'class' => $class ] );
766 
767  $makeLinkItem = function ( $linkHtml ) {
768  return Html::rawElement( 'li', [], $linkHtml );
769  };
770 
771  $categoryItems = array_map( $makeLinkItem, $list );
772 
773  $categoriesHtml = Html::rawElement( 'ul',
774  [],
775  implode( '', $categoryItems )
776  );
777 
778  $html .= $this->getPortlet( $id, $categoriesHtml, $message );
779 
780  $html .= Html::closeElement( 'div' );
781 
782  return $html;
783  }
784 
790  protected function getInterlanguageLinks() {
791  $html = '';
792 
793  if ( isset( $this->data['variant_urls'] ) && $this->data['variant_urls'] !== false ) {
794  $variants = $this->getPortlet( 'variants', $this->data['variant_urls'], true );
795  } else {
796  $variants = '';
797  }
798  if ( $this->data['language_urls'] !== false ) {
799  $html .= $this->getSidebarChunk(
800  'other-languages',
801  'timeless-languages',
802  $variants .
803  $this->getPortlet(
804  'lang',
805  $this->data['language_urls'] ?: [],
806  'otherlanguages'
807  )
808  );
809  }
810 
811  return $html;
812  }
813 }
BaseTemplate\getPersonalTools
getPersonalTools()
Create an array of personal tools items from the data in the quicktemplate stored by SkinTemplate.
Definition: BaseTemplate.php:135
TimelessTemplate\getSidebarChunk
getSidebarChunk( $id, $headerMessage, $content)
Sidebar chunk containing one or more portlets.
Definition: TimelessTemplate.php:234
$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
$template
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 $template
Definition: hooks.txt:813
MWDebug\getDebugHTML
static getDebugHTML(IContextSource $context)
Returns the HTML to add to the page for the toolbar.
Definition: MWDebug.php:422
TimelessTemplate\getPortlet
getPortlet( $name, $content, $msg=null)
Generates a block of navigation links with a header.
Definition: TimelessTemplate.php:145
BaseTemplate\makeSearchButton
makeSearchButton( $mode, $attrs=[])
Definition: BaseTemplate.php:539
captcha-old.count
count
Definition: captcha-old.py:249
BaseTemplate\getClear
getClear()
Get a div with the core visualClear class, for clearing floats.
Definition: BaseTemplate.php:714
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
TimelessTemplate\getContentSub
getContentSub()
Links and information that may appear below the firstHeading.
Definition: TimelessTemplate.php:535
TimelessTemplate\getPageToolSidebar
getPageToolSidebar()
Page tools in sidebar.
Definition: TimelessTemplate.php:410
data
and how to run hooks for an and one after Each event has a preferably in CamelCase For ArticleDelete hook A clump of code and data that should be run when an event happens This can be either a function and a chunk of data
Definition: hooks.txt:6
getContext
getContext()
QuickTemplate\getSkin
getSkin()
Get the Skin object related to this object.
Definition: QuickTemplate.php:178
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
Linker\tooltipAndAccesskeyAttribs
static tooltipAndAccesskeyAttribs( $name, array $msgParams=[], $options=null)
Returns the attributes for the tooltip and access key.
Definition: Linker.php:2133
TimelessTemplate\getSearch
getSearch()
The search box at the top.
Definition: TimelessTemplate.php:310
Html\closeElement
static closeElement( $element)
Returns "</$element>".
Definition: Html.php:310
TimelessTemplate
BaseTemplate class for the Timeless skin.
Definition: TimelessTemplate.php:7
$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:2044
$title
namespace and then decline to actually register it file or subcat img or subcat $title
Definition: hooks.txt:964
BaseTemplate\getAfterPortlet
getAfterPortlet( $name)
Allows extensions to hook into known portlets and add stuff to them.
Definition: BaseTemplate.php:305
BaseTemplate\makeListItem
makeListItem( $key, $item, $options=[])
Generates a list item for a navigation, portlet, portal, sidebar...
Definition: BaseTemplate.php:482
BaseTemplate\getIndicators
getIndicators()
Get the suggested HTML for page status indicators: icons (or short text snippets) usually displayed i...
Definition: BaseTemplate.php:733
TimelessTemplate\getHeaderHack
getHeaderHack()
The colour bars Split this out so we don't have to look at it/can easily kill it later.
Definition: TimelessTemplate.php:381
NS_CATEGORY
const NS_CATEGORY
Definition: Defines.php:78
array
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))
string
This code would result in ircNotify being run twice when an article is and once for brion Hooks can return three possible true was required This is the default since MediaWiki *some string
Definition: hooks.txt:175
$name
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:302
BaseTemplate\getFooter
getFooter( $iconStyle='icononly', $linkStyle='flat')
Renderer for getFooterIcons and getFooterLinks.
Definition: BaseTemplate.php:664
Html\hidden
static hidden( $name, $value, array $attribs=[])
Convenience function to produce an input element with type=hidden.
Definition: Html.php:795
QuickTemplate\text
text( $str)
Definition: QuickTemplate.php:107
BaseTemplate\getMsg
getMsg( $name)
Get a Message object with its context set.
Definition: BaseTemplate.php:38
TimelessTemplate\getSiteNotices
getSiteNotices()
Notices that may appear above the firstHeading.
Definition: TimelessTemplate.php:517
BaseTemplate\makeSearchInput
makeSearchInput( $attrs=[])
Definition: BaseTemplate.php:529
TimelessTemplate\getLogo
getLogo( $id='p-logo', $part='both')
The logo and (optionally) site title.
Definition: TimelessTemplate.php:260
Linker\titleAttrib
static titleAttrib( $name, $options=null, array $msgParams=[])
Given the id of an interface element, constructs the appropriate title attribute from the system mess...
Definition: Linker.php:1967
TimelessTemplate\getMainNavigation
getMainNavigation()
Left sidebar navigation, usually.
Definition: TimelessTemplate.php:350
BaseTemplate\getToolbox
getToolbox()
Create an array of common toolbox items from the data in the quicktemplate stored by SkinTemplate.
Definition: BaseTemplate.php:69
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
Html\openElement
static openElement( $element, $attribs=[])
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
Definition: Html.php:252
Html\rawElement
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
Definition: Html.php:210
$skin
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 $skin
Definition: hooks.txt:2044
TimelessTemplate\getInterlanguageLinks
getInterlanguageLinks()
Interlanguage links block, also with variants.
Definition: TimelessTemplate.php:790
$content
$content
Definition: pageupdater.txt:72
TimelessTemplate\getPageTools
getPageTools()
Generate pile of all the tools.
Definition: TimelessTemplate.php:582
TimelessTemplate\getCatList
getCatList( $list, $id, $class, $message)
List of categories.
Definition: TimelessTemplate.php:764
TimelessTemplate\getAfterContent
getAfterContent()
The data after content, catlinks, and potential other stuff that may appear within the content block ...
Definition: TimelessTemplate.php:556
Html\element
static element( $element, $attribs=[], $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
Definition: Html.php:232
Hooks\run
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Definition: Hooks.php:200
BaseTemplate
New base template for a skin's template extended from QuickTemplate this class features helper method...
Definition: BaseTemplate.php:29
TimelessTemplate\getUserLinks
getUserLinks()
Personal/user links portlet for header.
Definition: TimelessTemplate.php:437
TimelessTemplate\execute
execute()
Outputs the entire contents of the page.
Definition: TimelessTemplate.php:15
TimelessTemplate\$pileOfTools
array $pileOfTools
Definition: TimelessTemplate.php:10
BaseTemplate\getSidebar
getSidebar( $options=[])
Definition: BaseTemplate.php:160
TimelessTemplate\getCategories
getCategories()
Categories for the sidebar.
Definition: TimelessTemplate.php:710