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-site-navigation' ],
40 $this->
getLogo(
'p-logo',
'image' ) .
47 $this->pileOfTools[
'general'],
52 Html::rawElement(
'div', [
'id' =>
'mw-related-navigation' ],
57 Html::rawElement(
'div', [
'id' =>
'mw-content' ],
58 Html::rawElement(
'div', [
'id' =>
'content',
'class' =>
'mw-body',
'role' =>
'main' ],
64 'id' =>
'firstHeading',
65 'class' =>
'firstHeading',
66 'lang' => $this->
get(
'pageLanguage' )
70 Html::rawElement(
'div', [
'id' =>
'mw-page-header-links' ],
73 $this->pileOfTools[
'namespaces'],
78 $this->pileOfTools[
'page-primary'],
83 Html::rawElement(
'div', [
'class' =>
'mw-body-content',
'id' =>
'bodyContent' ],
85 $this->
get(
'bodytext' ) .
95 $html .= Html::rawElement(
'div', [
'id' =>
'mw-footer-container',
'class' =>
'ts-container' ],
96 Html::rawElement(
'div', [
'id' =>
'mw-footer',
'class' =>
'ts-inner' ],
101 $html .= Html::closeElement(
'div' );
106 $html .= $this->
get(
'bottomscripts' );
107 $html .= $this->
get(
'reporttime' );
109 $html .= Html::closeElement(
'body' );
110 $html .= Html::closeElement(
'html' );
137 protected function getPortlet( $name, $content, $msg =
null ) {
138 if ( $msg ===
null ) {
140 } elseif ( is_array( $msg ) ) {
141 $msgString = array_shift( $msg );
146 if ( $msgObj->exists() ) {
147 if ( isset( $msgParams ) && !empty( $msgParams ) ) {
148 $msgString = $this->
getMsg( $msg, $msgParams )->parse();
150 $msgString = $msgObj->parse();
153 $msgString = htmlspecialchars( $msg );
158 if ( $name ==
'tb' ) {
159 if ( isset( $boxes[
'TOOLBOX'] ) ) {
165 Hooks::run(
'SkinTemplateToolboxEnd', [ &
$template,
true ] );
166 $hookContents = ob_get_contents();
168 if ( !trim( $hookContents ) ) {
175 $labelId = Sanitizer::escapeId(
"p-$name-label" );
177 if ( is_array( $content ) ) {
178 $contentText = Html::openElement(
'ul' );
179 if ( $content !== [] ) {
180 foreach ( $content as $key => $item ) {
184 [
'text-wrapper' => [
'tag' =>
'span' ] ]
189 $contentText .= $hookContents;
190 $contentText .= Html::closeElement(
'ul' );
192 $contentText = $content;
195 $html = Html::rawElement(
'div', [
196 'role' =>
'navigation',
197 'class' => [
'mw-portlet',
'emptyPortlet' => !$content ],
198 'id' => Sanitizer::escapeId(
'p-' . $name ),
200 'aria-labelledby' => $labelId
202 Html::rawElement(
'h3', [
204 'lang' => $this->
get(
'userlang' ),
205 'dir' => $this->
get(
'dir' )
209 Html::rawElement(
'div', [
'class' =>
'mw-portlet-body' ],
230 $html .= Html::rawElement(
232 [
'id' => Sanitizer::escapeId( $id ),
'class' =>
'sidebar-chunk' ],
233 Html::rawElement(
'h2', [],
234 Html::element(
'span', [],
237 Html::element(
'div', [
'class' =>
'pokey' ] )
239 Html::rawElement(
'div', [
'class' =>
'sidebar-inner' ], $content )
253 protected function getLogo( $id =
'p-logo', $part =
'both' ) {
255 $language = $this->
getSkin()->getLanguage();
257 $html .= Html::openElement(
260 'id' => Sanitizer::escapeId( $id ),
261 'class' =>
'mw-portlet',
265 if ( $part !==
'image' ) {
267 if ( $language->hasVariants() ) {
268 $siteTitle = $language->convert( $this->
getMsg(
'timeless-sitetitle' )->
text() );
270 $siteTitle = $this->
getMsg(
'timeless-sitetitle' )->text();
273 if ( mb_strlen( $siteTitle ) > 13 ) {
274 $titleClass =
'long';
276 $html .= Html::element(
'a', [
278 'class' => [
'mw-wiki-title', $titleClass ],
279 'href' => $this->data[
'nav_urls'][
'mainpage'][
'href']
284 if ( $part !==
'text' ) {
285 $html .= Html::element(
'a', array_merge(
287 'class' =>
'mw-wiki-logo',
288 'href' => $this->data[
'nav_urls'][
'mainpage'][
'href']
293 $html .= Html::closeElement(
'div' );
306 $html .= Html::openElement(
'div', [
'class' =>
'mw-portlet',
'id' =>
'p-search' ] );
308 $html .= Html::rawElement(
310 [
'lang' => $this->
get(
'userlang' ),
'dir' => $this->
get(
'dir' ) ],
311 Html::rawElement(
'label', [
'for' =>
'searchInput' ], $this->
getMsg(
'search' )->
text() )
314 $html .= Html::rawElement(
'form', [
'action' => $this->
get(
'wgScript' ),
'id' =>
'searchform' ],
315 Html::rawElement(
'div', [
'id' =>
'simpleSearch' ],
316 Html::rawElement(
'div', [
'id' =>
'searchInput-container' ],
318 'id' =>
'searchInput',
319 'placeholder' => $this->
getMsg(
'timeless-search-placeholder' )->
text(),
322 Html::hidden(
'title', $this->
get(
'searchtitle' ) ) .
325 [
'id' =>
'mw-searchButton',
'class' =>
'searchButton mw-fallbackSearchButton' ]
329 [
'id' =>
'searchButton',
'class' =>
'searchButton' ]
334 $html .= Html::closeElement(
'div' );
349 $sidebar[
'SEARCH'] =
false;
351 $sidebar[
'TOOLBOX'] =
false;
353 $sidebar[
'LANGUAGES'] =
false;
355 foreach ( $sidebar as $name => $content ) {
356 if ( $content ===
false ) {
379 $html .= Html::rawElement(
'div', [
'id' =>
'mw-header-hack',
'class' =>
'color-bar' ],
380 Html::rawElement(
'div', [
'class' =>
'color-middle-container' ],
381 Html::element(
'div', [
'class' =>
'color-middle' ] )
383 Html::element(
'div', [
'class' =>
'color-left' ] ) .
384 Html::element(
'div', [
'class' =>
'color-right' ] )
386 $html .= Html::rawElement(
'div', [
'id' =>
'mw-header-nav-hack' ],
387 Html::rawElement(
'div', [
'class' =>
'color-bar' ],
388 Html::rawElement(
'div', [
'class' =>
'color-middle-container' ],
389 Html::element(
'div', [
'class' =>
'color-middle' ] )
391 Html::element(
'div', [
'class' =>
'color-left' ] ) .
392 Html::element(
'div', [
'class' =>
'color-right' ] )
408 $this->pileOfTools[
'page-secondary'],
409 'timeless-pageactions'
413 $this->pileOfTools[
'user'],
414 'timeless-userpagetools'
418 $this->pileOfTools[
'page-tertiary'],
422 return $this->
getSidebarChunk(
'page-tools',
'timeless-pageactions', $pageTools );
432 $user = $this->
getSkin()->getUser();
439 if ( isset( $personalTools[
'notifications-alert'] ) ) {
440 $extraTools[
'notifications-alert'] = $personalTools[
'notifications-alert'];
441 unset( $personalTools[
'notifications-alert'] );
443 if ( isset( $personalTools[
'notifications-notice'] ) ) {
444 $extraTools[
'notifications-notice'] = $personalTools[
'notifications-notice'];
445 unset( $personalTools[
'notifications-notice'] );
447 $class = empty( $extraTools ) ?
'' :
'extension-icons';
450 if ( isset( $personalTools[
'userpage'] ) ) {
451 $personalTools[
'userpage'][
'links'][0][
'text'] = $this->
getMsg(
'timeless-userpage' )->text();
453 if ( isset( $personalTools[
'mytalk'] ) ) {
454 $personalTools[
'mytalk'][
'links'][0][
'text'] = $this->
getMsg(
'timeless-talkpage' )->text();
458 if ( $user->isLoggedIn() ) {
459 $userName = $user->getName();
461 $fit = empty( $extraTools ) ? 13 : 9;
462 if ( mb_strlen( $userName ) < $fit ) {
463 $dropdownHeader = $userName;
465 $dropdownHeader =
wfMessage(
'timeless-loggedin' )->text();
467 $headerMsg = [
'timeless-loggedinas', $user->getName() ];
469 $dropdownHeader =
wfMessage(
'timeless-anonymous' )->text();
470 $headerMsg =
'timeless-notloggedin';
472 $html .= Html::openElement(
'div', [
'id' =>
'user-tools' ] );
474 $html .= Html::rawElement(
'div', [
'id' =>
'personal' ],
475 Html::rawElement(
'h2', [],
476 Html::element(
'span', [], $dropdownHeader ) .
477 Html::element(
'div', [
'class' =>
'pokey' ] )
479 Html::rawElement(
'div', [
'id' =>
'personal-inner',
'class' =>
'dropdown' ],
480 $this->
getPortlet(
'personal', $personalTools, $headerMsg )
485 if ( !empty( $extraTools ) ) {
487 foreach ( $extraTools as $key => $item ) {
491 $html .= Html::rawElement(
493 [
'id' =>
'personal-extra',
'class' =>
'p-body' ],
494 Html::rawElement(
'ul', [], $iconList )
498 $html .= Html::closeElement(
'div' );
514 if ( $this->data[
'sitenotice'] ) {
515 $html .= Html::rawElement(
'div', [
'id' =>
'siteNotice' ], $this->
get(
'sitenotice' ) );
517 if ( $this->data[
'newtalk'] ) {
518 $html .= Html::rawElement(
'div', [
'class' =>
'usermessage' ], $this->
get(
'newtalk' ) );
532 $html .= Html::openElement(
'div', [
'id' =>
'contentSub' ] );
533 if ( $this->data[
'subtitle'] ) {
534 $html .= $this->
get(
'subtitle' );
536 if ( $this->data[
'undelete'] ) {
537 $html .= $this->
get(
'undelete' );
539 $html .= Html::closeElement(
'div' );
553 if ( $this->data[
'catlinks'] || $this->data[
'dataAfterContent'] ) {
554 $html .= Html::openElement(
'div', [
'id' =>
'content-bottom-stuff' ] );
555 if ( $this->data[
'catlinks'] ) {
556 $html .= $this->
get(
'catlinks' );
558 if ( $this->data[
'dataAfterContent'] ) {
559 $html .= $this->
get(
'dataAfterContent' );
561 $html .= Html::closeElement(
'div' );
577 $title = $this->
getSkin()->getTitle();
578 $namespace = $title->getNamespace();
580 $sortedPileOfTools = [
582 'page-primary' => [],
583 'page-secondary' => [],
585 'page-tertiary' => [],
590 $pileOfEditTools = [];
591 foreach ( $this->data[
'content_navigation'] as $navKey => $navBlock ) {
593 if ( $navKey ==
'namespaces' ) {
594 if ( $namespace < 0 ) {
596 $sortedPileOfTools[
'page-tertiary'] = $navBlock;
598 $sortedPileOfTools[
'namespaces'] = $navBlock;
601 $pileOfEditTools = array_merge( $pileOfEditTools, $navBlock );
607 if ( $namespace >= 0 ) {
609 'text' => $this->
getMsg(
'timeless-pagelog' )->text(),
610 'href' => SpecialPage::getTitleFor(
'Log', $title->getPrefixedText() )->getLocalURL(),
615 'text' => $this->
getMsg(
'timeless-more' )->text(),
617 'class' =>
'dropdown-toggle'
621 if ( $this->data[
'language_urls'] !==
false ) {
623 'text' => $this->
getMsg(
'timeless-languages' )->escaped(),
624 'id' =>
'ca-languages',
625 'class' =>
'dropdown-toggle'
631 foreach ( $pileOfEditTools as $navKey => $navBlock ) {
634 if ( in_array( $navKey, [
638 $currentSet =
'namespaces';
639 } elseif ( in_array( $navKey, [
646 $currentSet =
'page-primary';
647 } elseif ( in_array( $navKey, [
654 $currentSet =
'page-secondary';
657 $currentSet =
'page-primary';
659 $sortedPileOfTools[$currentSet][$navKey] = $navBlock;
664 if ( in_array( $navKey, [
669 $currentSet =
'page-primary';
670 } elseif ( in_array( $navKey, [
675 $currentSet =
'user';
676 } elseif ( in_array( $navKey, [
681 'recentchangeslinked',
684 $currentSet =
'page-tertiary';
686 $currentSet =
'general';
688 $sortedPileOfTools[$currentSet][$navKey] = $navBlock;
691 return $sortedPileOfTools;
707 $title = $skin->getTitle();
712 if ( in_array( $skin->getRequest()->getVal(
'action' ), [
'submit',
'edit' ] ) ) {
715 $allCats2 = $skin->getOutput()->getCategories();
716 foreach ( $allCats2 as $displayName ) {
717 $catTitle = Title::makeTitleSafe(
NS_CATEGORY, $displayName );
718 $allCats[] = $catTitle->getDBkey();
722 $allCats = array_keys( $title->getParentCategories() );
725 foreach ( $allCats as $i => $catName ) {
726 $allCats[$i] = substr( $catName, $len );
729 if ( $allCats !== [] ) {
732 [
'page',
'page_props' ],
733 [
'page_id',
'page_title' ],
735 'page_title' => $allCats,
737 'pp_propname' =>
'hiddencat'
741 [
'page_props' => [
'JOIN',
'pp_page = page_id' ] ]
744 foreach (
$res as $row ) {
745 $hiddenCats[] = $row->page_title;
747 $normalCats = array_diff( $allCats, $hiddenCats );
749 $normalCount = count( $normalCats );
750 $hiddenCount = count( $hiddenCats );
751 $count = $normalCount;
756 $skin->getUser()->getBoolOption(
'showhiddencats' ) ||
759 $count += $hiddenCount;
767 if ( $normalCount ) {
768 $catHeader =
'categories';
770 $catHeader =
'hidden-categories';
773 if ( $normalCount ) {
774 $catList .= $this->
getCatList( $normalCats,
'catlist-normal',
'categories' );
776 if ( $hiddenCount ) {
780 [
'hidden-categories', $hiddenCount ]
806 foreach ( $list as $category ) {
807 $title = Title::makeTitleSafe(
NS_CATEGORY, $category );
811 $categories[ htmlspecialchars( $category ) ] = [
'links' => [ 0 => [
812 'href' => $title->getLinkURL(),
813 'text' => $title->getText()
830 if ( isset( $this->data[
'variant_urls'] ) && $this->data[
'variant_urls'] !==
false ) {
831 $variants = $this->
getPortlet(
'variants', $this->data[
'variant_urls'],
true );
835 if ( $this->data[
'language_urls'] !==
false ) {
838 'timeless-languages',
842 $this->data[
'language_urls'] ?: [],
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
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.
getCatList( $list, $id, $message)
List of categories.
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.
getPortlet( $name, $content, $msg=null)
Generates a block of navigation links with a header.
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 local content language as $wgContLang
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
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
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 "<div ...>$1</div>"). - flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException':Called before an exception(or PHP error) is logged. This is meant for integration with external error aggregation services
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