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 ) {
153 $msgObj = $this->
getMsg( $msg );
154 if ( $msgObj->exists() ) {
155 if (
isset( $msgParams ) && !empty( $msgParams ) ) {
156 $msgObj->params( $msgParams );
158 $msgString = $msgObj->parse();
165 if ( $name ==
'tb' ) {
166 if (
isset( $boxes[
'TOOLBOX'] ) ) {
172 Hooks::run(
'SkinTemplateToolboxEnd', [ &
$template,
true ] );
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' ] ]
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();
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' ) {
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;
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' )->getLocalURL(
618 [
'page' => $title->getPrefixedText() ]
624 'text' => $this->
getMsg(
'timeless-more' )->text(),
626 'class' =>
'dropdown-toggle'
630 if ( $this->data[
'language_urls'] !==
false ) {
632 'text' => $this->
getMsg(
'timeless-languages' )->escaped(),
633 'id' =>
'ca-languages',
634 'class' =>
'dropdown-toggle'
640 foreach ( $pileOfEditTools as $navKey => $navBlock ) {
647 $currentSet =
'namespaces';
655 $currentSet =
'page-primary';
663 $currentSet =
'page-secondary';
666 $currentSet =
'page-primary';
673 if ( $navKey ===
'contributions' ) {
674 $currentSet =
'page-primary';
680 $currentSet =
'user';
686 'recentchangeslinked',
689 $currentSet =
'page-tertiary';
694 $currentSet =
'more';
696 $currentSet =
'general';
717 $allCats = $skin->getOutput()->getCategoryLinks();
718 if ( !empty( $allCats ) ) {
719 if ( !empty( $allCats[
'normal'] ) ) {
720 $catHeader =
'categories';
724 'mw-normal-catlinks',
728 $catHeader =
'hidden-categories';
731 if (
isset( $allCats[
'hidden'] ) ) {
732 $hiddenCatClass = [
'mw-hidden-catlinks' ];
733 if ( $skin->getUser()->getBoolOption(
'showhiddencats' ) ) {
734 $hiddenCatClass[] =
'mw-hidden-cats-user-shown';
736 $hiddenCatClass[] =
'mw-hidden-cats-ns-shown';
738 $hiddenCatClass[] =
'mw-hidden-cats-hidden';
744 [
'hidden-categories', count( $allCats[
'hidden'] ) ]
749 if ( $catList !==
'' ) {
766 protected function getCatList( $list, $id, $class, $message ) {
767 $html = Html::openElement(
'div', [
'id' =>
"sidebar-{$id}",
'class' => $class ] );
770 return Html::rawElement(
'li', [], $linkHtml );
773 $categoryItems =
array_map( $makeLinkItem, $list );
775 $categoriesHtml = Html::rawElement(
'ul',
777 implode(
'', $categoryItems )
782 $html .= Html::closeElement(
'div' );
795 if (
isset( $this->data[
'variant_urls'] ) && $this->data[
'variant_urls'] !==
false ) {
796 $variants = $this->
getPortlet(
'variants', $this->data[
'variant_urls'],
true );
800 if ( $this->data[
'language_urls'] !==
false ) {
803 'timeless-languages',
807 $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
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
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 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
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
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))