20 $html = $this->
get(
'headelement' );
22 $html .= Html::openElement(
'div', [
'id' =>
'mw-wrapper',
'class' => $userLinks[
'class'] ] );
24 $html .= Html::rawElement(
'div', [
'id' =>
'mw-header-container',
'class' =>
'ts-container' ],
25 Html::rawElement(
'div', [
'id' =>
'mw-header',
'class' =>
'ts-inner' ],
27 $this->
getLogo(
'p-logo-text',
'text' ) .
35 $html .= Html::element(
'div', [
'id' =>
'menus-cover' ] );
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' ],
47 'id' =>
'firstHeading',
48 'class' =>
'firstHeading',
49 'lang' => $this->
get(
'pageLanguage' )
53 Html::rawElement(
'div', [
'id' =>
'siteSub' ], $this->
getMsg(
'tagline' )->parse() ) .
54 Html::rawElement(
'div', [
'id' =>
'mw-page-header-links' ],
57 $this->pileOfTools[
'namespaces'],
62 $this->pileOfTools[
'more'],
67 $this->pileOfTools[
'page-primary'],
72 Html::rawElement(
'div', [
'class' =>
'mw-body-content',
'id' =>
'bodyContent' ],
74 $this->
get(
'bodytext' ) .
81 Html::rawElement(
'div', [
'id' =>
'mw-site-navigation' ],
82 $this->
getLogo(
'p-logo',
'image' ) .
89 $this->pileOfTools[
'general'],
94 Html::rawElement(
'div', [
'id' =>
'mw-related-navigation' ],
103 $html .= Html::rawElement(
'div', [
'id' =>
'mw-footer-container',
'class' =>
'ts-container' ],
104 Html::rawElement(
'div', [
'id' =>
'mw-footer',
'class' =>
'ts-inner' ],
109 $html .= Html::closeElement(
'div' );
114 $html .= $this->
get(
'bottomscripts' );
115 $html .= $this->
get(
'reporttime' );
117 $html .= Html::closeElement(
'body' );
118 $html .= Html::closeElement(
'html' );
146 if ( $msg ===
null ) {
148 } elseif ( is_array( $msg ) ) {
149 $msgString = array_shift( $msg );
153 $msgObj = $this->
getMsg( $msg );
154 if ( $msgObj->exists() ) {
155 if ( isset( $msgParams ) && !empty( $msgParams ) ) {
156 $msgObj->params( $msgParams );
158 $msgString = $msgObj->parse();
160 $msgString = htmlspecialchars( $msg );
165 if ( $name ==
'tb' ) {
166 if ( isset( $boxes[
'TOOLBOX'] ) ) {
172 Hooks::run(
'SkinTemplateToolboxEnd', [ &
$template,
true ] );
173 $hookContents = ob_get_contents();
175 if ( !trim( $hookContents ) ) {
182 $labelId = Sanitizer::escapeId(
"p-$name-label" );
185 $contentText = Html::openElement(
'ul' );
187 foreach (
$content as $key => $item ) {
191 [
'text-wrapper' => [
'tag' =>
'span' ] ]
196 $contentText .= $hookContents;
197 $contentText .= Html::closeElement(
'ul' );
202 $html = Html::rawElement(
'div', [
203 'role' =>
'navigation',
204 'class' => [
'mw-portlet',
'emptyPortlet' => !
$content ],
205 'id' => Sanitizer::escapeId(
'p-' . $name ),
207 'aria-labelledby' => $labelId
209 Html::rawElement(
'h3', [
211 'lang' => $this->
get(
'userlang' ),
212 'dir' => $this->
get(
'dir' )
216 Html::rawElement(
'div', [
'class' =>
'mw-portlet-body' ],
237 $html .= Html::rawElement(
239 [
'id' => Sanitizer::escapeId( $id ),
'class' =>
'sidebar-chunk' ],
240 Html::rawElement(
'h2', [],
241 Html::element(
'span', [],
244 Html::element(
'div', [
'class' =>
'pokey' ] )
246 Html::rawElement(
'div', [
'class' =>
'sidebar-inner' ],
$content )
260 protected function getLogo( $id =
'p-logo', $part =
'both' ) {
262 $language = $this->
getSkin()->getLanguage();
264 $html .= Html::openElement(
267 'id' => Sanitizer::escapeId( $id ),
268 'class' =>
'mw-portlet',
272 if ( $part !==
'image' ) {
274 if ( $language->hasVariants() ) {
275 $siteTitle = $language->convert( $this->
getMsg(
'timeless-sitetitle' )->escaped() );
277 $siteTitle = $this->
getMsg(
'timeless-sitetitle' )->escaped();
280 if ( mb_strlen( $siteTitle ) > 13 ) {
281 $titleClass =
'long';
283 $html .= Html::rawElement(
'a', [
285 'class' => [
'mw-wiki-title', $titleClass ],
286 'href' => $this->data[
'nav_urls'][
'mainpage'][
'href']
291 if ( $part !==
'text' ) {
292 $html .= Html::element(
'a', array_merge(
294 'class' =>
'mw-wiki-logo',
295 'href' => $this->data[
'nav_urls'][
'mainpage'][
'href']
300 $html .= Html::closeElement(
'div' );
313 $html .= Html::openElement(
'div', [
'class' =>
'mw-portlet',
'id' =>
'p-search' ] );
315 $html .= Html::rawElement(
317 [
'lang' => $this->
get(
'userlang' ),
'dir' => $this->
get(
'dir' ) ],
318 Html::rawElement(
'label', [
'for' =>
'searchInput' ], $this->
getMsg(
'search' )->escaped() )
321 $html .= Html::rawElement(
'form', [
'action' => $this->
get(
'wgScript' ),
'id' =>
'searchform' ],
322 Html::rawElement(
'div', [
'id' =>
'simpleSearch' ],
323 Html::rawElement(
'div', [
'id' =>
'searchInput-container' ],
325 'id' =>
'searchInput'
328 Html::hidden(
'title', $this->
get(
'searchtitle' ) ) .
331 [
'id' =>
'mw-searchButton',
'class' =>
'searchButton mw-fallbackSearchButton' ]
335 [
'id' =>
'searchButton',
'class' =>
'searchButton' ]
340 $html .= Html::closeElement(
'div' );
355 $sidebar[
'SEARCH'] =
false;
357 $sidebar[
'TOOLBOX'] =
false;
359 $sidebar[
'LANGUAGES'] =
false;
361 foreach ( $sidebar as $name =>
$content ) {
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' ] )
389 Html::element(
'div', [
'class' =>
'color-left' ] ) .
390 Html::element(
'div', [
'class' =>
'color-right' ] )
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' ] )
397 Html::element(
'div', [
'class' =>
'color-left' ] ) .
398 Html::element(
'div', [
'class' =>
'color-right' ] )
414 $this->pileOfTools[
'page-secondary'],
415 'timeless-pageactions'
419 $this->pileOfTools[
'user'],
420 'timeless-userpagetools'
424 $this->pileOfTools[
'page-tertiary'],
428 return $this->
getSidebarChunk(
'page-tools',
'timeless-pageactions', $pageTools );
438 $user = $this->
getSkin()->getUser();
445 if ( isset( $personalTools[
'notifications-alert'] ) ) {
446 $extraTools[
'notifications-alert'] = $personalTools[
'notifications-alert'];
447 unset( $personalTools[
'notifications-alert'] );
449 if ( isset( $personalTools[
'notifications-notice'] ) ) {
450 $extraTools[
'notifications-notice'] = $personalTools[
'notifications-notice'];
451 unset( $personalTools[
'notifications-notice'] );
453 $class = empty( $extraTools ) ?
'' :
'extension-icons';
456 if ( isset( $personalTools[
'userpage'] ) ) {
457 $personalTools[
'userpage'][
'links'][0][
'text'] = $this->
getMsg(
'timeless-userpage' )->text();
459 if ( isset( $personalTools[
'mytalk'] ) ) {
460 $personalTools[
'mytalk'][
'links'][0][
'text'] = $this->
getMsg(
'timeless-talkpage' )->text();
464 if ( $user->isLoggedIn() ) {
465 $userName = $user->getName();
467 $fit = empty( $extraTools ) ? 13 : 9;
468 if ( mb_strlen( $userName ) < $fit ) {
469 $dropdownHeader = $userName;
471 $dropdownHeader = $this->
getMsg(
'timeless-loggedin' )->text();
473 $headerMsg = [
'timeless-loggedinas', $user->getName() ];
475 $dropdownHeader = $this->
getMsg(
'timeless-anonymous' )->text();
476 $headerMsg =
'timeless-notloggedin';
478 $html .= Html::openElement(
'div', [
'id' =>
'user-tools' ] );
480 $html .= Html::rawElement(
'div', [
'id' =>
'personal' ],
481 Html::rawElement(
'h2', [],
482 Html::element(
'span', [], $dropdownHeader ) .
483 Html::element(
'div', [
'class' =>
'pokey' ] )
485 Html::rawElement(
'div', [
'id' =>
'personal-inner',
'class' =>
'dropdown' ],
486 $this->
getPortlet(
'personal', $personalTools, $headerMsg )
491 if ( !empty( $extraTools ) ) {
493 foreach ( $extraTools as $key => $item ) {
497 $html .= Html::rawElement(
499 [
'id' =>
'personal-extra',
'class' =>
'p-body' ],
500 Html::rawElement(
'ul', [], $iconList )
504 $html .= Html::closeElement(
'div' );
520 if ( $this->data[
'sitenotice'] ) {
521 $html .= Html::rawElement(
'div', [
'id' =>
'siteNotice' ], $this->
get(
'sitenotice' ) );
523 if ( $this->data[
'newtalk'] ) {
524 $html .= Html::rawElement(
'div', [
'class' =>
'usermessage' ], $this->
get(
'newtalk' ) );
538 $html .= Html::openElement(
'div', [
'id' =>
'contentSub' ] );
539 if ( $this->data[
'subtitle'] ) {
540 $html .= $this->
get(
'subtitle' );
542 if ( $this->data[
'undelete'] ) {
543 $html .= $this->
get(
'undelete' );
545 $html .= Html::closeElement(
'div' );
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' );
564 if ( $this->data[
'dataAfterContent'] ) {
565 $html .= $this->
get(
'dataAfterContent' );
567 $html .= Html::closeElement(
'div' );
583 $title = $this->
getSkin()->getTitle();
584 $namespace = $title->getNamespace();
586 $sortedPileOfTools = [
588 'page-primary' => [],
589 'page-secondary' => [],
591 'page-tertiary' => [],
597 $pileOfEditTools = [];
598 foreach ( $this->data[
'content_navigation'] as $navKey => $navBlock ) {
600 if ( $navKey ==
'namespaces' ) {
601 if ( $namespace < 0 ) {
603 $sortedPileOfTools[
'page-tertiary'] = $navBlock;
605 $sortedPileOfTools[
'namespaces'] = $navBlock;
608 $pileOfEditTools = array_merge( $pileOfEditTools, $navBlock );
614 if ( $namespace >= 0 ) {
616 'text' => $this->
getMsg(
'timeless-pagelog' )->text(),
617 'href' => SpecialPage::getTitleFor(
'Log', $title->getPrefixedText() )->getLocalURL(),
622 'text' => $this->
getMsg(
'timeless-more' )->text(),
624 'class' =>
'dropdown-toggle'
628 if ( $this->data[
'language_urls'] !==
false ) {
630 'text' => $this->
getMsg(
'timeless-languages' )->escaped(),
631 'id' =>
'ca-languages',
632 'class' =>
'dropdown-toggle'
638 foreach ( $pileOfEditTools as $navKey => $navBlock ) {
641 if ( in_array( $navKey, [
645 $currentSet =
'namespaces';
646 } elseif ( in_array( $navKey, [
653 $currentSet =
'page-primary';
654 } elseif ( in_array( $navKey, [
661 $currentSet =
'page-secondary';
664 $currentSet =
'page-primary';
666 $sortedPileOfTools[$currentSet][$navKey] = $navBlock;
671 if ( $navKey ===
'contributions' ) {
672 $currentSet =
'page-primary';
673 } elseif ( in_array( $navKey, [
678 $currentSet =
'user';
679 } elseif ( in_array( $navKey, [
684 'recentchangeslinked',
687 $currentSet =
'page-tertiary';
688 } elseif ( in_array( $navKey, [
692 $currentSet =
'more';
694 $currentSet =
'general';
696 $sortedPileOfTools[$currentSet][$navKey] = $navBlock;
699 return $sortedPileOfTools;
715 $allCats = $skin->getOutput()->getCategoryLinks();
716 if ( !empty( $allCats ) ) {
717 if ( !empty( $allCats[
'normal'] ) ) {
718 $catHeader =
'categories';
722 'mw-normal-catlinks',
726 $catHeader =
'hidden-categories';
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';
736 $hiddenCatClass[] =
'mw-hidden-cats-hidden';
742 [
'hidden-categories', count( $allCats[
'hidden'] ) ]
747 if ( $catList !==
'' ) {
764 protected function getCatList( $list, $id, $class, $message ) {
765 $html = Html::openElement(
'div', [
'id' =>
"sidebar-{$id}",
'class' => $class ] );
767 $makeLinkItem =
function ( $linkHtml ) {
768 return Html::rawElement(
'li', [], $linkHtml );
771 $categoryItems = array_map( $makeLinkItem, $list );
773 $categoriesHtml = Html::rawElement(
'ul',
775 implode(
'', $categoryItems )
780 $html .= Html::closeElement(
'div' );
793 if ( isset( $this->data[
'variant_urls'] ) && $this->data[
'variant_urls'] !==
false ) {
794 $variants = $this->
getPortlet(
'variants', $this->data[
'variant_urls'],
true );
798 if ( $this->data[
'language_urls'] !==
false ) {
801 'timeless-languages',
805 $this->data[
'language_urls'] ?: [],
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
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.
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...
static tooltipAndAccesskeyAttribs( $name, array $msgParams=[], $options=null)
Returns the attributes for the tooltip and access key.
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 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
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
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
Allows to change the fields on the form that will be generated $name
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))