Go to the documentation of this file.
20 $html = $this->
get(
'headelement' );
27 $this->
getLogo(
'p-logo-text',
'text' ) .
38 Html::rawElement(
'div', [
'id' =>
'mw-content-block',
'class' =>
'ts-inner' ],
41 Html::rawElement(
'div', [
'id' =>
'content',
'class' =>
'mw-body',
'role' =>
'main' ],
47 'id' =>
'firstHeading',
48 'class' =>
'firstHeading',
49 'lang' => $this->
get(
'pageLanguage' )
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' ) .
82 $this->
getLogo(
'p-logo',
'image' ) .
89 $this->pileOfTools[
'general'],
114 $html .= $this->
get(
'bottomscripts' );
115 $html .= $this->
get(
'reporttime' );
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'] ) ) {
173 $hookContents = ob_get_contents();
175 if ( !trim( $hookContents ) ) {
182 $labelId = Sanitizer::escapeId(
"p-$name-label" );
191 [
'text-wrapper' => [
'tag' =>
'span' ] ]
196 $contentText .= $hookContents;
203 'role' =>
'navigation',
204 'class' => [
'mw-portlet',
'emptyPortlet' => !
$content ],
205 'id' => Sanitizer::escapeId(
'p-' .
$name ),
207 'aria-labelledby' => $labelId
211 'lang' => $this->
get(
'userlang' ),
212 'dir' => $this->
get(
'dir' )
239 [
'id' => Sanitizer::escapeId( $id ),
'class' =>
'sidebar-chunk' ],
260 protected function getLogo( $id =
'p-logo', $part =
'both' ) {
262 $language = $this->
getSkin()->getLanguage();
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';
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']
317 [
'lang' => $this->
get(
'userlang' ),
'dir' => $this->
get(
'dir' ) ],
325 'id' =>
'searchInput'
331 [
'id' =>
'mw-searchButton',
'class' =>
'searchButton mw-fallbackSearchButton' ]
335 [
'id' =>
'searchButton',
'class' =>
'searchButton' ]
355 $sidebar[
'SEARCH'] =
false;
357 $sidebar[
'TOOLBOX'] =
false;
359 $sidebar[
'LANGUAGES'] =
false;
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 );
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';
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 ) {
499 [
'id' =>
'personal-extra',
'class' =>
'p-body' ],
520 if ( $this->
data[
'sitenotice'] ) {
523 if ( $this->
data[
'newtalk'] ) {
539 if ( $this->
data[
'subtitle'] ) {
540 $html .= $this->
get(
'subtitle' );
542 if ( $this->
data[
'undelete'] ) {
543 $html .= $this->
get(
'undelete' );
559 if ( $this->
data[
'catlinks'] || $this->
data[
'dataAfterContent'] ) {
561 if ( $this->
data[
'catlinks'] ) {
562 $html .= $this->
get(
'catlinks' );
564 if ( $this->
data[
'dataAfterContent'] ) {
565 $html .= $this->
get(
'dataAfterContent' );
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(),
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';
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 ) {
767 $makeLinkItem =
function ( $linkHtml ) {
771 $categoryItems = array_map( $makeLinkItem, $list );
775 implode(
'', $categoryItems )
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'] ?: [],
getPersonalTools()
Create an array of personal tools items from the data in the quicktemplate stored by SkinTemplate.
getSidebarChunk( $id, $headerMessage, $content)
Sidebar chunk containing one or more portlets.
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
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
static getDebugHTML(IContextSource $context)
Returns the HTML to add to the page for the toolbar.
getPortlet( $name, $content, $msg=null)
Generates a block of navigation links with a header.
makeSearchButton( $mode, $attrs=[])
getClear()
Get a div with the core visualClear class, for clearing floats.
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,...
getContentSub()
Links and information that may appear below the firstHeading.
getPageToolSidebar()
Page tools in sidebar.
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
getSkin()
Get the Skin object related to this object.
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
static tooltipAndAccesskeyAttribs( $name, array $msgParams=[], $options=null)
Returns the attributes for the tooltip and access key.
getSearch()
The search box at the top.
static closeElement( $element)
Returns "</$element>".
BaseTemplate class for the Timeless 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 and may include noclasses & $html
namespace and then decline to actually register it file or subcat img or subcat $title
getAfterPortlet( $name)
Allows extensions to hook into known portlets and add stuff to them.
makeListItem( $key, $item, $options=[])
Generates a list item for a navigation, portlet, portal, sidebar...
getIndicators()
Get the suggested HTML for page status indicators: icons (or short text snippets) usually displayed i...
getHeaderHack()
The colour bars Split this out so we don't have to look at it/can easily kill it later.
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))
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
Allows to change the fields on the form that will be generated $name
getFooter( $iconStyle='icononly', $linkStyle='flat')
Renderer for getFooterIcons and getFooterLinks.
static hidden( $name, $value, array $attribs=[])
Convenience function to produce an input element with type=hidden.
getMsg( $name)
Get a Message object with its context set.
getSiteNotices()
Notices that may appear above the firstHeading.
makeSearchInput( $attrs=[])
getLogo( $id='p-logo', $part='both')
The logo and (optionally) site title.
static titleAttrib( $name, $options=null, array $msgParams=[])
Given the id of an interface element, constructs the appropriate title attribute from the system mess...
getMainNavigation()
Left sidebar navigation, usually.
getToolbox()
Create an array of common toolbox items from the data in the quicktemplate stored by SkinTemplate.
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
static openElement( $element, $attribs=[])
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a 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 $skin
getInterlanguageLinks()
Interlanguage links block, also with variants.
getPageTools()
Generate pile of all the tools.
getCatList( $list, $id, $class, $message)
List of categories.
getAfterContent()
The data after content, catlinks, and potential other stuff that may appear within the content block ...
static element( $element, $attribs=[], $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
New base template for a skin's template extended from QuickTemplate this class features helper method...
getUserLinks()
Personal/user links portlet for header.
execute()
Outputs the entire contents of the page.
getCategories()
Categories for the sidebar.