MediaWiki REL1_33
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() .
44 Html::rawElement(
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
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
237 $html .= Html::rawElement(
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
264 $html .= Html::openElement(
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
315 $html .= Html::rawElement(
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
497 $html .= Html::rawElement(
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' )->getLocalURL(
618 [ 'page' => $title->getPrefixedText() ]
619 ),
620 'id' => 't-pagelog'
621 ];
622 }
623 $pileOfTools['more'] = [
624 'text' => $this->getMsg( 'timeless-more' )->text(),
625 'id' => 'ca-more',
626 'class' => 'dropdown-toggle'
627 ];
628
629 // Only appears in mobile
630 if ( $this->data['language_urls'] !== false ) {
631 $pileOfTools['languages'] = [
632 'text' => $this->getMsg( 'timeless-languages' )->escaped(),
633 'id' => 'ca-languages',
634 'class' => 'dropdown-toggle'
635 ];
636 }
637
638 // This is really dumb, and you're an idiot for doing it this way.
639 // Obviously if you're not the idiot who did this, I don't mean you.
640 foreach ( $pileOfEditTools as $navKey => $navBlock ) {
641 $currentSet = null;
642
643 if ( in_array( $navKey, [
644 'watch',
645 'unwatch'
646 ] ) ) {
647 $currentSet = 'namespaces';
648 } elseif ( in_array( $navKey, [
649 'edit',
650 'view',
651 'history',
652 'addsection',
653 'viewsource'
654 ] ) ) {
655 $currentSet = 'page-primary';
656 } elseif ( in_array( $navKey, [
657 'delete',
658 'rename',
659 'protect',
660 'unprotect',
661 'move'
662 ] ) ) {
663 $currentSet = 'page-secondary';
664 } else {
665 // Catch random extension ones?
666 $currentSet = 'page-primary';
667 }
668 $sortedPileOfTools[$currentSet][$navKey] = $navBlock;
669 }
670 foreach ( $pileOfTools as $navKey => $navBlock ) {
671 $currentSet = null;
672
673 if ( $navKey === 'contributions' ) {
674 $currentSet = 'page-primary';
675 } elseif ( in_array( $navKey, [
676 'blockip',
677 'userrights',
678 'log'
679 ] ) ) {
680 $currentSet = 'user';
681 } elseif ( in_array( $navKey, [
682 'whatlinkshere',
683 'print',
684 'info',
685 'pagelog',
686 'recentchangeslinked',
687 'permalink'
688 ] ) ) {
689 $currentSet = 'page-tertiary';
690 } elseif ( in_array( $navKey, [
691 'more',
692 'languages'
693 ] ) ) {
694 $currentSet = 'more';
695 } else {
696 $currentSet = 'general';
697 }
698 $sortedPileOfTools[$currentSet][$navKey] = $navBlock;
699 }
700
701 return $sortedPileOfTools;
702 }
703
712 protected function getCategories() {
713 $skin = $this->getSkin();
714 $catList = '';
715 $html = '';
716
717 $allCats = $skin->getOutput()->getCategoryLinks();
718 if ( !empty( $allCats ) ) {
719 if ( !empty( $allCats['normal'] ) ) {
720 $catHeader = 'categories';
721 $catList .= $this->getCatList(
722 $allCats['normal'],
723 'normal-catlinks',
724 'mw-normal-catlinks',
725 'categories'
726 );
727 } else {
728 $catHeader = 'hidden-categories';
729 }
730
731 if ( isset( $allCats['hidden'] ) ) {
732 $hiddenCatClass = [ 'mw-hidden-catlinks' ];
733 if ( $skin->getUser()->getBoolOption( 'showhiddencats' ) ) {
734 $hiddenCatClass[] = 'mw-hidden-cats-user-shown';
735 } elseif ( $skin->getTitle()->getNamespace() == NS_CATEGORY ) {
736 $hiddenCatClass[] = 'mw-hidden-cats-ns-shown';
737 } else {
738 $hiddenCatClass[] = 'mw-hidden-cats-hidden';
739 }
740 $catList .= $this->getCatList(
741 $allCats['hidden'],
742 'hidden-catlinks',
743 $hiddenCatClass,
744 [ 'hidden-categories', count( $allCats['hidden'] ) ]
745 );
746 }
747 }
748
749 if ( $catList !== '' ) {
750 $html = $this->getSidebarChunk( 'catlinks-sidebar', $catHeader, $catList );
751 }
752
753 return $html;
754 }
755
766 protected function getCatList( $list, $id, $class, $message ) {
767 $html = Html::openElement( 'div', [ 'id' => "sidebar-{$id}", 'class' => $class ] );
768
769 $makeLinkItem = function ( $linkHtml ) {
770 return Html::rawElement( 'li', [], $linkHtml );
771 };
772
773 $categoryItems = array_map( $makeLinkItem, $list );
774
775 $categoriesHtml = Html::rawElement( 'ul',
776 [],
777 implode( '', $categoryItems )
778 );
779
780 $html .= $this->getPortlet( $id, $categoriesHtml, $message );
781
782 $html .= Html::closeElement( 'div' );
783
784 return $html;
785 }
786
792 protected function getInterlanguageLinks() {
793 $html = '';
794
795 if ( isset( $this->data['variant_urls'] ) && $this->data['variant_urls'] !== false ) {
796 $variants = $this->getPortlet( 'variants', $this->data['variant_urls'], true );
797 } else {
798 $variants = '';
799 }
800 if ( $this->data['language_urls'] !== false ) {
801 $html .= $this->getSidebarChunk(
802 'other-languages',
803 'timeless-languages',
804 $variants .
805 $this->getPortlet(
806 'lang',
807 $this->data['language_urls'] ?: [],
808 'otherlanguages'
809 )
810 );
811 }
812
813 return $html;
814 }
815}
This list may contain false positives That usually means there is additional text with links below the first Each row contains links to the first and second as well as the first line of the second redirect text
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
getContext()
New base template for a skin's template extended from QuickTemplate this class features helper method...
makeSearchButton( $mode, $attrs=[])
getToolbox()
Create an array of common toolbox items from the data in the quicktemplate stored by SkinTemplate.
getSidebar( $options=[])
getPersonalTools()
Create an array of personal tools items from the data in the quicktemplate stored by SkinTemplate.
makeListItem( $key, $item, $options=[])
Generates a list item for a navigation, portlet, portal, sidebar... list.
getMsg( $name)
Get a Message object with its context set.
getIndicators()
Get the suggested HTML for page status indicators: icons (or short text snippets) usually displayed i...
makeSearchInput( $attrs=[])
getFooter( $iconStyle='icononly', $linkStyle='flat')
Renderer for getFooterIcons and getFooterLinks.
getClear()
Get a div with the core visualClear class, for clearing floats.
getAfterPortlet( $name)
Allows extensions to hook into known portlets and add stuff to them.
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:1965
static tooltipAndAccesskeyAttribs( $name, array $msgParams=[], $options=null)
Returns the attributes for the tooltip and access key.
Definition Linker.php:2130
getSkin()
Get the Skin object related to this object.
BaseTemplate class for the Timeless skin.
getLogo( $id='p-logo', $part='both')
The logo and (optionally) site title.
getHeaderHack()
The colour bars Split this out so we don't have to look at it/can easily kill it later.
getSiteNotices()
Notices that may appear above the firstHeading.
getContentSub()
Links and information that may appear below the firstHeading.
getPageTools()
Generate pile of all the tools.
getMainNavigation()
Left sidebar navigation, usually.
getSidebarChunk( $id, $headerMessage, $content)
Sidebar chunk containing one or more portlets.
getInterlanguageLinks()
Interlanguage links block, also with variants.
getCategories()
Categories for the sidebar.
getPageToolSidebar()
Page tools in sidebar.
getUserLinks()
Personal/user links portlet for header.
getSearch()
The search box at the top.
getAfterContent()
The data after content, catlinks, and potential other stuff that may appear within the content block ...
execute()
Outputs the entire contents of the page.
getCatList( $list, $id, $class, $message)
List of categories.
getPortlet( $name, $content, $msg=null)
Generates a block of navigation links with a header.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not it can be in the form of< username >< more info > e g for bot passwords intended to be added to log contexts Fields it might only if the login was with a bot password 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:822
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:181
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:2011
Allows to change the fields on the form that will be generated $name
Definition hooks.txt:271
const NS_CATEGORY
Definition Defines.php:87
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))
$content