Go to the documentation of this file.
26 if ( !defined(
'MEDIAWIKI' ) ) {
48 parent::initPage(
$out );
53 $min = $this->
getRequest()->getFuzzyBool(
'debug' ) ?
'' :
'.min';
55 '<!--[if lt IE 7]><style type="text/css">body{behavior:url("' .
56 htmlspecialchars( $wgLocalStylePath ) .
57 "/{$this->stylename}/csshover{$min}.htc\")}</style><![endif]-->"
60 $out->addModules(
array(
'skins.vector.js',
'skins.vector.collapsibleNav' ) );
68 parent::setupSkinUserCss(
$out );
70 $styles =
array(
'mediawiki.skinning.interface',
'skins.vector.styles' );
72 $out->addModuleStyles( $styles );
82 if ( isset( $bodyAttrs[
'class'] ) && strlen( $bodyAttrs[
'class'] ) > 0 ) {
83 $bodyAttrs[
'class'] .=
' ' . implode(
' ', static::$bodyClasses );
85 $bodyAttrs[
'class'] = implode(
' ', static::$bodyClasses );
102 global $wgVectorUseIconWatch;
105 $nav = $this->
data[
'content_navigation'];
107 if ( $wgVectorUseIconWatch ) {
108 $mode = $this->
getSkin()->getUser()->isWatched( $this->
getSkin()->getRelevantTitle() ) ?
'unwatch' :
'watch';
109 if ( isset( $nav[
'actions'][$mode] ) ) {
110 $nav[
'views'][$mode] = $nav[
'actions'][$mode];
111 $nav[
'views'][$mode][
'class'] = rtrim(
'icon ' . $nav[
'views'][$mode][
'class'],
' ' );
112 $nav[
'views'][$mode][
'primary'] =
true;
113 unset( $nav[
'actions'][$mode] );
119 foreach ( $links
as $key =>
$link ) {
121 $link[
'class'] = rtrim(
'collapsible ' .
$link[
'class'],
' ' );
124 $xmlID = isset(
$link[
'id'] ) ?
$link[
'id'] :
'ca-' . $xmlID;
125 $nav[
$section][$key][
'attributes'] =
127 if (
$link[
'class'] ) {
128 $nav[
$section][$key][
'attributes'] .=
129 ' class="' . htmlspecialchars(
$link[
'class'] ) .
'"';
130 unset( $nav[
$section][$key][
'class'] );
132 if ( isset(
$link[
'tooltiponly'] ) &&
$link[
'tooltiponly'] ) {
141 $this->
data[
'namespace_urls'] = $nav[
'namespaces'];
142 $this->
data[
'view_urls'] = $nav[
'views'];
143 $this->
data[
'action_urls'] = $nav[
'actions'];
144 $this->
data[
'variant_urls'] = $nav[
'variants'];
147 if ( $this->
data[
'rtl'] ) {
148 $this->
data[
'view_urls'] =
149 array_reverse( $this->
data[
'view_urls'] );
150 $this->
data[
'namespace_urls'] =
151 array_reverse( $this->
data[
'namespace_urls'] );
152 $this->
data[
'personal_urls'] =
153 array_reverse( $this->
data[
'personal_urls'] );
156 $this->
html(
'headelement' );
158 <div
id=
"mw-page-base" class=
"noprint"></div>
159 <div
id=
"mw-head-base" class=
"noprint"></div>
160 <div
id=
"content" class=
"mw-body" role=
"main">
162 <div
id=
"mw-js-message" style=
"display:none;"<?
php $this->
html(
'userlangattributes' ) ?>></div>
163 <?
php if ( $this->
data[
'sitenotice'] ) { ?>
164 <div
id=
"siteNotice"><?
php $this->
html(
'sitenotice' ) ?></div>
166 <h1
id=
"firstHeading" class=
"firstHeading" lang=
"<?php
167 $this->data['pageLanguage'] = $this->getSkin()->getTitle()->getPageViewLanguage()->getHtmlCode();
168 $this->text( 'pageLanguage' );
169 ?>"><span dir=
"auto"><?
php $this->
html(
'title' ) ?></span></h1>
170 <?
php $this->
html(
'prebodyhtml' ) ?>
171 <div
id=
"bodyContent">
172 <?
php if ( $this->
data[
'isarticle'] ) { ?>
173 <div
id=
"siteSub"><?
php $this->
msg(
'tagline' ) ?></div>
175 <div
id=
"contentSub"<?
php $this->
html(
'userlangattributes' ) ?>><?php $this->
html(
'subtitle' ) ?></div>
176 <?
php if ( $this->
data[
'undelete'] ) { ?>
177 <div
id=
"contentSub2"><?
php $this->
html(
'undelete' ) ?></div>
179 <?
php if ( $this->
data[
'newtalk'] ) { ?>
180 <div
class=
"usermessage"><?
php $this->
html(
'newtalk' ) ?></div>
182 <div
id=
"jump-to-nav" class=
"mw-jump">
183 <?
php $this->
msg(
'jumpto' ) ?>
184 <a
href=
"#mw-navigation"><?
php $this->
msg(
'jumptonavigation' ) ?></a><?
php $this->
msg(
'comma-separator' ) ?>
185 <a
href=
"#p-search"><?
php $this->
msg(
'jumptosearch' ) ?></a>
187 <?
php $this->
html(
'bodycontent' ) ?>
188 <?php
if ( $this->
data[
'printfooter'] ) { ?>
189 <div
class=
"printfooter">
190 <?
php $this->
html(
'printfooter' ); ?>
193 <?
php if ( $this->
data[
'catlinks'] ) { ?>
194 <?php $this->
html(
'catlinks' ); ?>
196 <?
php if ( $this->
data[
'dataAfterContent'] ) { ?>
197 <?php $this->
html(
'dataAfterContent' ); ?>
199 <div
class=
"visualClear"></div>
200 <?
php $this->
html(
'debughtml' ); ?>
203 <div
id=
"mw-navigation">
204 <h2><?
php $this->
msg(
'navigation-heading' ) ?></h2>
207 <div
id=
"left-navigation">
210 <div
id=
"right-navigation">
219 <div
id=
"footer" role=
"contentinfo"<?
php $this->
html(
'userlangattributes' ) ?>>
221 <ul
id=
"footer-<?php echo $category ?>">
223 <li
id=
"footer-<?php echo $category ?>-<?php echo $link ?>"><?
php $this->
html( $link ) ?></li>
229 <ul
id=
"footer-icons" class=
"noprint">
231 <li
id=
"footer-<?php echo htmlspecialchars( $blockName ); ?>ico">
232 <?
php foreach ( $footerIcons
as $icon ) { ?>
233 <?
php echo $this->
getSkin()->makeFooterIcon( $icon ); ?>
240 <div style=
"clear:both"></div>
256 if ( !isset( $portals[
'SEARCH'] ) ) {
257 $portals[
'SEARCH'] =
true;
259 if ( !isset( $portals[
'TOOLBOX'] ) ) {
260 $portals[
'TOOLBOX'] =
true;
262 if ( !isset( $portals[
'LANGUAGES'] ) ) {
263 $portals[
'LANGUAGES'] =
true;
266 foreach ( $portals
as $name => $content ) {
267 if ( $content ===
false ) {
278 if ( $this->
data[
'language_urls'] !==
false ) {
279 $this->
renderPortal(
'lang', $this->
data[
'language_urls'],
'otherlanguages' );
296 if ( $msg ===
null ) {
301 <div
class=
"portal" role=
"navigation" id=
'<?php echo Sanitizer::escapeId( "p-$name" ) ?>'<?
php echo
Linker::tooltip(
'p-' .
$name ) ?> aria-labelledby=
'<?php echo Sanitizer::escapeId( "p-$name-label" ) ?>'>
302 <h3<?
php $this->
html(
'userlangattributes' ) ?>
id=
'<?php echo Sanitizer::escapeId( "p-$name-label" ) ?>'><?php echo htmlspecialchars( $msgObj->exists() ? $msgObj->text() : $msg ); ?></h3>
305 if ( is_array( $content ) ) { ?>
308 foreach ( $content
as $key => $val ) { ?>
313 if ( $hook !==
null ) {
338 global $wgVectorUseSimpleSearch;
342 if ( !is_array( $elements ) ) {
343 $elements =
array( $elements );
345 } elseif ( $this->
data[
'rtl'] ) {
346 $elements = array_reverse( $elements );
349 foreach ( $elements
as $name => $element ) {
350 switch ( $element ) {
353 <div
id=
"p-namespaces" role=
"navigation" class=
"vectorTabs<?php if ( count( $this->data['namespace_urls'] ) == 0 ) { echo ' emptyPortlet'; } ?>" aria-labelledby=
"p-namespaces-label">
354 <h3
id=
"p-namespaces-label"><?
php $this->
msg(
'namespaces' ) ?></h3>
355 <ul<?
php $this->
html(
'userlangattributes' ) ?>>
356 <?php
foreach ( $this->
data[
'namespace_urls']
as $link ) { ?>
357 <li <?php echo $link['attributes'] ?>><span><a
href=
"<?php echo htmlspecialchars( $link['href'] ) ?>" <?
php echo
$link[
'key'] ?>><?
php echo htmlspecialchars(
$link[
'text'] ) ?></a></span></li>
365 <div
id=
"p-variants" role=
"navigation" class=
"vectorMenu<?php if ( count( $this->data['variant_urls'] ) == 0 ) { echo ' emptyPortlet'; } ?>" aria-labelledby=
"p-variants-label">
366 <h3
id=
"mw-vector-current-variant">
367 <?
php foreach ( $this->
data[
'variant_urls']
as $link ) { ?>
368 <?
php if ( stripos(
$link[
'attributes'],
'selected' ) !==
false ) { ?>
369 <?
php echo htmlspecialchars(
$link[
'text'] ) ?>
373 <h3
id=
"p-variants-label"><span><?
php $this->
msg(
'variants' ) ?></span><a
href=
"#"></a></h3>
376 <?
php foreach ( $this->
data[
'variant_urls']
as $link ) { ?>
377 <li<?php echo $link['attributes'] ?>><a
href=
"<?php echo htmlspecialchars( $link['href'] ) ?>" lang=
"<?php echo htmlspecialchars( $link['lang'] ) ?>" hreflang=
"<?php echo htmlspecialchars( $link['hreflang'] ) ?>" <?
php echo
$link[
'key'] ?>><?
php echo htmlspecialchars(
$link[
'text'] ) ?></a></li>
386 <div
id=
"p-views" role=
"navigation" class=
"vectorTabs<?php if ( count( $this->data['view_urls'] ) == 0 ) { echo ' emptyPortlet'; } ?>" aria-labelledby=
"p-views-label">
387 <h3
id=
"p-views-label"><?
php $this->
msg(
'views' ) ?></h3>
388 <ul<?
php $this->
html(
'userlangattributes' ) ?>>
389 <?php
foreach ( $this->
data[
'view_urls']
as $link ) { ?>
390 <li<?php echo $link['attributes'] ?>><span><a
href=
"<?php echo htmlspecialchars( $link['href'] ) ?>" <?
php echo
$link[
'key'] ?>><?
php
392 if ( array_key_exists(
'text',
$link ) ) {
393 echo array_key_exists(
'img',
$link ) ?
'<img src="' .
$link[
'img'] .
'" alt="' .
$link[
'text'] .
'" />' : htmlspecialchars(
$link[
'text'] );
403 <div
id=
"p-cactions" role=
"navigation" class=
"vectorMenu<?php if ( count( $this->data['action_urls'] ) == 0 ) { echo ' emptyPortlet'; } ?>" aria-labelledby=
"p-cactions-label">
404 <h3
id=
"p-cactions-label"><span><?
php $this->
msg(
'actions' ) ?></span><a
href=
"#"></a></h3>
406 <ul<?
php $this->
html(
'userlangattributes' ) ?>>
407 <?php
foreach ( $this->
data[
'action_urls']
as $link ) { ?>
408 <li<?php echo $link['attributes'] ?>><a
href=
"<?php echo htmlspecialchars( $link['href'] ) ?>" <?
php echo
$link[
'key'] ?>><?
php echo htmlspecialchars(
$link[
'text'] ) ?></a></li>
417 <div
id=
"p-personal" role=
"navigation" class=
"<?php if ( count( $this->data['personal_urls'] ) == 0 ) { echo ' emptyPortlet'; } ?>" aria-labelledby=
"p-personal-label">
418 <h3
id=
"p-personal-label"><?
php $this->
msg(
'personaltools' ) ?></h3>
419 <ul<?
php $this->
html(
'userlangattributes' ) ?>>
432 <div
id=
"p-search" role=
"search">
433 <h3<?
php $this->
html(
'userlangattributes' ) ?>><label
for=
"searchInput"><?
php $this->
msg(
'search' ) ?></label></h3>
434 <
form action=
"<?php $this->text( 'wgScript' ) ?>" id=
"searchform">
435 <?
php if ( $wgVectorUseSimpleSearch ) { ?>
436 <div
id=
"simpleSearch">
451 echo $this->
makeSearchButton(
'fulltext',
array(
'id' =>
'mw-searchButton',
'class' =>
'searchButton mw-fallbackSearchButton' ) );
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.
makeSearchInput( $attrs=array())
setupSkinUserCss(OutputPage $out)
Loads skin and user CSS files.
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
static expandAttributes( $attribs)
Given an array of ('attributename' => 'value'), it generates the code to set the XML attributes : att...
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
makeListItem( $key, $item, $options=array())
Generates a list item for a navigation, portlet, portal, sidebar...
addToBodyAttributes( $out, &$bodyAttrs)
Adds classes to the body element.
static hidden( $name, $value, $attribs=array())
Convenience function to produce an input element with type=hidden.
getRequest()
Get the WebRequest object.
set to $title object and return false for a match for latest after cache objects are set use the ContentHandler facility to handle CSS and JavaScript for highlighting & $link
getSkin()
Get the Skin object related to this object.
addHeadItem( $name, $value)
Add or replace an header item to the output.
QuickTemplate class for Vector skin.
static tooltipAndAccesskeyAttribs( $name)
Returns the attributes for the tooltip and access key.
$this html('userlangattributes') foreach( $this->getFooterLinks() as $category=> $links) foreach( $links as $link) $this html($link) $footericons
case __pad3__ if(count( $this->data['personal_urls'])==0) $this msg('personaltools') $this html('userlangattributes') $personalTools
execute()
Outputs the entire contents of the (X)HTML page.
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 after processing after in associative array form externallinks including delete and has completed for all link tables 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 "<
printTrail()
Output the basic end-page trail including bottomscripts, reporttime, and debug stuff.
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
renderPortal( $name, $content, $msg=null, $hook=null)
when a variable name is used in a it is silently declared as a new masking the global
null means default in associative array form
This class should be covered by a general architecture document which does not exist as of January 20...
static escapeId( $id, $options=array())
Given a value, escape it so that it can be used in an id attribute and return it.
renderAfterPortlet( $name)
Allows to change the fields on the form that will be generated $name
renderNavigation( $elements)
Render one or more navigations elements by name, automatically reveresed when UI is in RTL mode.
makeSearchButton( $mode, $attrs=array())
renderPortals( $portals)
Render a series of portals.
SkinTemplate class for Vector skin.
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.
initPage(OutputPage $out)
Initializes output page and sets up skin-specific parameters.
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
getFooterIcons( $option=null)
Returns an array of footer icons filtered down by options relevant to how the skin wishes to display ...
New base template for a skin's template extended from QuickTemplate this class features helper method...
Template-filler skin base class Formerly generic PHPTal (http://phptal.sourceforge....
$this html( 'userlangattributes')