Go to the documentation of this file.
37 $nav = $this->
data[
'content_navigation'];
39 if ( $this->config->get(
'VectorUseIconWatch' ) ) {
40 $mode = $this->
getSkin()->getUser()->isWatched( $this->
getSkin()->getRelevantTitle() )
44 if ( isset( $nav[
'actions'][$mode] ) ) {
45 $nav[
'views'][$mode] = $nav[
'actions'][$mode];
46 $nav[
'views'][$mode][
'class'] = rtrim(
'icon ' . $nav[
'views'][$mode][
'class'],
' ' );
47 $nav[
'views'][$mode][
'primary'] =
true;
48 unset( $nav[
'actions'][$mode] );
54 foreach ( $links
as $key =>
$link ) {
56 $link[
'class'] = rtrim(
'collapsible ' .
$link[
'class'],
' ' );
59 $xmlID = isset(
$link[
'id'] ) ?
$link[
'id'] :
'ca-' . $xmlID;
61 ' id="' . Sanitizer::escapeId( $xmlID ) .
'"';
62 if (
$link[
'class'] ) {
63 $nav[
$section][$key][
'attributes'] .=
64 ' class="' . htmlspecialchars(
$link[
'class'] ) .
'"';
65 unset( $nav[
$section][$key][
'class'] );
67 if ( isset(
$link[
'tooltiponly'] ) &&
$link[
'tooltiponly'] ) {
76 $this->
data[
'namespace_urls'] = $nav[
'namespaces'];
77 $this->
data[
'view_urls'] = $nav[
'views'];
78 $this->
data[
'action_urls'] = $nav[
'actions'];
79 $this->
data[
'variant_urls'] = $nav[
'variants'];
82 if ( $this->
data[
'rtl'] ) {
83 $this->
data[
'view_urls'] =
84 array_reverse( $this->
data[
'view_urls'] );
85 $this->
data[
'namespace_urls'] =
86 array_reverse( $this->
data[
'namespace_urls'] );
87 $this->
data[
'personal_urls'] =
88 array_reverse( $this->
data[
'personal_urls'] );
91 $this->
data[
'pageLanguage'] =
92 $this->
getSkin()->getTitle()->getPageViewLanguage()->getHtmlCode();
95 $this->
html(
'headelement' );
97 <div
id=
"mw-page-base" class=
"noprint"></
div>
98 <
div id=
"mw-head-base" class=
"noprint"></
div>
99 <
div id=
"content" class=
"mw-body" role=
"main">
103 if ( $this->
data[
'sitenotice'] ) {
105 <div
id=
"siteNotice" class=
"mw-body-content"><?
php $this->
html(
'sitenotice' ) ?></div>
110 if ( is_callable( [ $this,
'getIndicators' ] ) ) {
114 if ( $this->
data[
'title'] !=
'' ) {
116 <h1
id=
"firstHeading" class=
"firstHeading" lang=
"<?php $this->text( 'pageLanguage' ); ?>"><?
php
117 $this->
html(
'title' )
121 <?
php $this->
html(
'prebodyhtml' ) ?>
122 <div
id=
"bodyContent" class=
"mw-body-content">
124 if ( $this->
data[
'isarticle'] ) {
126 <div
id=
"siteSub"><?
php $this->
msg(
'tagline' ) ?></div>
130 <
div id=
"contentSub"<?
php $this->
html(
'userlangattributes' ) ?>><?php
131 $this->
html(
'subtitle' )
134 if ( $this->
data[
'undelete'] ) {
136 <div
id=
"contentSub2"><?
php $this->
html(
'undelete' ) ?></div>
141 if ( $this->
data[
'newtalk'] ) {
143 <div
class=
"usermessage"><?
php $this->
html(
'newtalk' ) ?></div>
147 <
div id=
"jump-to-nav" class=
"mw-jump">
148 <?
php $this->
msg(
'jumpto' ) ?>
149 <
a href=
"#mw-head"><?
php
150 $this->
msg(
'jumptonavigation' )
151 ?></
a><?php $this->
msg(
'comma-separator' ) ?>
152 <
a href=
"#p-search"><?
php $this->
msg(
'jumptosearch' ) ?></
a>
155 $this->
html(
'bodycontent' );
157 if ( $this->
data[
'printfooter'] ) {
159 <div
class=
"printfooter">
160 <?
php $this->
html(
'printfooter' ); ?>
165 if ( $this->
data[
'catlinks'] ) {
166 $this->
html(
'catlinks' );
169 if ( $this->
data[
'dataAfterContent'] ) {
170 $this->
html(
'dataAfterContent' );
173 <div
class=
"visualClear"></
div>
174 <?
php $this->
html(
'debughtml' ); ?>
177 <
div id=
"mw-navigation">
178 <h2><?
php $this->
msg(
'navigation-heading' ) ?></h2>
182 <div
id=
"left-navigation">
185 <
div id=
"right-navigation">
190 <
div id=
"p-logo" role=
"banner"><
a class=
"mw-wiki-logo" href=
"<?php
191 echo htmlspecialchars( $this->data['nav_urls']['mainpage']['href'] )
198 <
div id=
"footer" role=
"contentinfo"<?
php $this->
html(
'userlangattributes' ) ?>>
202 <ul
id=
"footer-<?php echo $category ?>">
206 <li
id=
"footer-<?php echo $category ?>-<?php echo $link ?>"><?
php $this->
html( $link ) ?></li>
215 if (
count( $footericons ) > 0 ) {
217 <ul
id=
"footer-icons" class=
"noprint">
221 <li
id=
"footer-<?php echo htmlspecialchars( $blockName ); ?>ico">
223 foreach ( $footerIcons
as $icon ) {
224 echo $this->
getSkin()->makeFooterIcon( $icon );
251 if ( !isset( $portals[
'SEARCH'] ) ) {
252 $portals[
'SEARCH'] =
true;
254 if ( !isset( $portals[
'TOOLBOX'] ) ) {
255 $portals[
'TOOLBOX'] =
true;
257 if ( !isset( $portals[
'LANGUAGES'] ) ) {
258 $portals[
'LANGUAGES'] =
true;
276 if ( $this->
data[
'language_urls'] !==
false ) {
277 $this->
renderPortal(
'lang', $this->
data[
'language_urls'],
'otherlanguages' );
294 if ( $msg ===
null ) {
298 $labelId = Sanitizer::escapeId(
"p-$name-label" );
300 <
div class=
"portal" role=
"navigation" id=
'<?php
301 echo Sanitizer::escapeId( "p-$name" )
304 ?> aria-labelledby=
'<?php echo $labelId ?>'>
305 <h3<?
php $this->
html(
'userlangattributes' ) ?>
id=
'<?php echo $labelId ?>'><?php
306 echo htmlspecialchars( $msgObj->exists() ? $msgObj->text() : $msg );
318 if ( $hook !==
null ) {
346 if ( !is_array( $elements ) ) {
347 $elements = [ $elements ];
349 } elseif ( $this->
data[
'rtl'] ) {
350 $elements = array_reverse( $elements );
353 foreach ( $elements
as $name => $element ) {
354 switch ( $element ) {
357 <
div id=
"p-namespaces" role=
"navigation" class=
"vectorTabs<?php
358 if ( count( $this->data['namespace_urls'] ) == 0 ) {
359 echo ' emptyPortlet';
361 ?>" aria-labelledby=
"p-namespaces-label">
362 <h3
id=
"p-namespaces-label"><?
php $this->
msg(
'namespaces' ) ?></h3>
363 <ul<?
php $this->
html(
'userlangattributes' ) ?>>
365 foreach ( $this->
data[
'namespace_urls']
as $link ) {
367 <li <?php echo $link['attributes'] ?>><span><
a href=
"<?php
368 echo htmlspecialchars( $link['href'] )
372 echo
' rel="' . htmlspecialchars(
$link[
'rel'] ) .
'"';
375 echo htmlspecialchars(
$link[
'text'] )
386 <
div id=
"p-variants" role=
"navigation" class=
"vectorMenu<?php
387 if ( count( $this->data['variant_urls'] ) == 0 ) {
388 echo ' emptyPortlet';
390 ?>" aria-labelledby=
"p-variants-label">
394 foreach ( $this->
data[
'variant_urls']
as $link ) {
395 if ( stripos(
$link[
'attributes'],
'selected' ) !==
false ) {
401 <h3
id=
"p-variants-label">
408 foreach ( $this->
data[
'variant_urls']
as $link ) {
410 <li<?php echo $link['attributes'] ?>><
a href=
"<?php
411 echo htmlspecialchars( $link['href'] )
413 echo htmlspecialchars( $link['lang'] )
415 echo htmlspecialchars( $link['hreflang'] )
419 echo htmlspecialchars(
$link[
'text'] )
431 <
div id=
"p-views" role=
"navigation" class=
"vectorTabs<?php
432 if ( count( $this->data['view_urls'] ) == 0 ) {
433 echo ' emptyPortlet';
435 ?>" aria-labelledby=
"p-views-label">
436 <h3
id=
"p-views-label"><?
php $this->
msg(
'views' ) ?></h3>
437 <ul<?
php $this->
html(
'userlangattributes' ) ?>>
439 foreach ( $this->
data[
'view_urls']
as $link ) {
441 <li<?php echo $link['attributes'] ?>><span><
a href=
"<?php
442 echo htmlspecialchars( $link['href'] )
445 if ( isset (
$link[
'rel'] ) ) {
446 echo
' rel="' . htmlspecialchars(
$link[
'rel'] ) .
'"';
450 if ( array_key_exists(
'text',
$link ) ) {
451 echo array_key_exists(
'img',
$link )
452 ?
'<img src="' .
$link[
'img'] .
'" alt="' .
$link[
'text'] .
'" />'
453 : htmlspecialchars(
$link[
'text'] );
465 <
div id=
"p-cactions" role=
"navigation" class=
"vectorMenu<?php
466 if ( count( $this->data['action_urls'] ) == 0 ) {
467 echo ' emptyPortlet';
469 ?>" aria-labelledby=
"p-cactions-label">
470 <h3
id=
"p-cactions-label"><span><?
php
471 $this->
msg(
'vector-more-actions' )
472 ?></span><
a href=
"#"></
a></h3>
475 <ul<?
php $this->
html(
'userlangattributes' ) ?>>
477 foreach ( $this->
data[
'action_urls']
as $link ) {
479 <li<?php echo $link['attributes'] ?>>
481 echo htmlspecialchars( $link['href'] )
483 echo
$link[
'key'] ?>><?
php echo htmlspecialchars(
$link[
'text'] )
496 <
div id=
"p-personal" role=
"navigation" class=
"<?php
497 if ( count( $this->data['personal_urls'] ) == 0 ) {
498 echo ' emptyPortlet';
500 ?>" aria-labelledby=
"p-personal-label">
501 <h3
id=
"p-personal-label"><?
php $this->
msg(
'personaltools' ) ?></h3>
502 <ul<?
php $this->
html(
'userlangattributes' ) ?>>
507 if ( !$this->
getSkin()->getUser()->isLoggedIn() &&
512 [
'id' =>
'pt-anonuserpage' ],
513 $this->
getMsg(
'notloggedin' )->escaped()
526 if ( !$this->
data[
'rtl' ] ) {
546 <
div id=
"p-search" role=
"search">
547 <h3<?
php $this->
html(
'userlangattributes' ) ?>>
548 <label
for=
"searchInput"><?
php $this->
msg(
'search' ) ?></label>
551 <
form action=
"<?php $this->text( 'wgScript' ) ?>" id=
"searchform">
552 <
div<?
php echo $this->config->get(
'VectorUseSimpleSearch' ) ?
' id="simpleSearch"' :
'' ?>>
569 [
'id' =>
'mw-searchButton',
'class' =>
'searchButton mw-fallbackSearchButton' ]
573 [
'id' =>
'searchButton',
'class' =>
'searchButton' ]
getPersonalTools()
Create an array of personal tools items from the data in the quicktemplate stored by SkinTemplate.
getFooterLinks( $option=null)
Returns an array of footerlinks trimmed down to only those footer links that are valid.
static expandAttributes( $attribs)
Given an array of ('attributename' => 'value'), it generates the code to set the XML attributes : att...
case __pad3__ if(count( $this->data['personal_urls'])==0) $this msg('personaltools') $this html('userlangattributes') $notLoggedIn
makeSearchButton( $mode, $attrs=[])
Allows to change the fields on the form that will be generated $name
static groupHasPermission( $group, $role)
Check, if the given group has the given permission.
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
QuickTemplate class for Vector skin.
$this html('userlangattributes') foreach( $this->getFooterLinks() as $category=> $links) foreach( $links as $link) $this html($link) $footericons
</source > ! result< div class="mw-highlight mw-content-ltr" dir="ltr">< pre >< span ></span >< span class="kd"> var</span >< span class="nx"> a</span >< span class="p"></span ></pre ></div > ! end ! test Multiline< source/> in lists !input *< source > a b</source > *foo< source > a b</source > ! html< ul >< li >< div class="mw-highlight mw-content-ltr" dir="ltr">< pre > a b</pre ></div ></li ></ul >< ul >< li > foo< div class="mw-highlight mw-content-ltr" dir="ltr">< pre > a b</pre ></div ></li ></ul > ! html tidy< ul >< li >< div class="mw-highlight mw-content-ltr" dir="ltr">< pre > a b</pre ></div ></li ></ul >< ul >< li > foo< div class="mw-highlight mw-content-ltr" dir="ltr">< pre > a b</pre ></div ></li ></ul > ! end ! test Custom attributes !input< source lang="javascript" id="foo" class="bar" dir="rtl" style="font-size: larger;"> var a
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content $content
execute()
Outputs the entire contents of the (X)HTML page.
printTrail()
Output getTrail.
makeListItem( $key, $item, $options=[])
Generates a list item for a navigation, portlet, portal, sidebar...
null means default in associative array form
renderPortal( $name, $content, $msg=null, $hook=null)
getIndicators()
Get the suggested HTML for page status indicators: icons (or short text snippets) usually displayed i...
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
static hidden( $name, $value, array $attribs=[])
Convenience function to produce an input element with type=hidden.
renderAfterPortlet( $name)
getMsg( $name)
Get a Message object with its context set.
static tooltipAndAccesskeyAttribs( $name, array $msgParams=[])
Returns the attributes for the tooltip and access key.
makeSearchInput( $attrs=[])
renderNavigation( $elements)
Render one or more navigations elements by name, automatically reveresed when UI is in RTL mode.
renderPortals( $portals)
Render a series of portals.
static tooltip( $name, $options=null)
Returns raw bits of HTML, use titleAttrib()
getToolbox()
Create an array of common toolbox items from the data in the quicktemplate stored by SkinTemplate.
usually copyright or history_copyright This message must be in HTML not wikitext if the section is included from a template $section
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 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
usually copyright or history_copyright This message must be in HTML not wikitext & $link
if(! $this->getSkin() ->getUser() ->isLoggedIn() &&User::groupHasPermission(' *', 'edit') $personalTools)
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 "<
case __pad0__ if(count( $this->data['variant_urls'])==0) $variantLabel
getFooterIcons( $option=null)
Returns an array of footer icons filtered down by options relevant to how the skin wishes to display ...
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...
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
$this html( 'userlangattributes')