Go to the documentation of this file.
25 if ( !defined(
'MEDIAWIKI' ) ) {
42 parent::setupSkinUserCss(
$out );
43 $out->addModuleStyles(
'mediawiki.legacy.oldshared' );
44 $out->addModuleStyles(
'skins.cologneblue' );
60 $this->
html(
'headelement' );
62 $this->
html(
'bodytext' );
65 $this->
html(
'dataAfterContent' );
67 echo
"\n</body></html>";
78 $variants = $this->
data[
'content_navigation'][
'variants'];
80 foreach ( $variants
as $key =>
$link ) {
84 return $this->
getSkin()->getLanguage()->pipeList(
$s );
88 global $wgHideInterlanguageLinks;
89 if ( $wgHideInterlanguageLinks ) {
97 $language_urls = $this->
data[
'language_urls'];
98 if ( !empty( $language_urls ) ) {
100 foreach ( $language_urls
as $key => $data ) {
106 . $this->
getSkin()->getLanguage()->pipeList(
$s );
121 $html = $content !==
'' ?
"<div class='after-portlet after-portlet-$name'>$content</div>" :
'';
130 foreach ( $footlinks[
'places']
as $item ) {
131 $s[] = $this->
data[$item];
134 return $this->
getSkin()->getLanguage()->pipeList(
$s );
153 $navlink[
'text'] =
wfMessage( $message )->escaped();
161 $content_nav = $this->
data[
'content_navigation'];
165 if ( $this->
getSkin()->getOutput()->isArticleRelated() ) {
169 $editLinkMessage = $this->
getSkin()->getTitle()->exists() ?
'editthispage' :
'create-this-page';
170 $element[] = $this->
processBottomLink(
'edit', $content_nav[
'views'][
'edit'], $editLinkMessage );
171 $element[] = $this->
processBottomLink(
'viewsource', $content_nav[
'views'][
'viewsource'],
'viewsource' );
173 $element[] = $this->
processBottomLink(
'watch', $content_nav[
'actions'][
'watch'],
'watchthispage' );
174 $element[] = $this->
processBottomLink(
'unwatch', $content_nav[
'actions'][
'unwatch'],
'unwatchthispage' );
178 $element[] = $this->
processBottomLink(
'history', $content_nav[
'views'][
'history'],
'history' );
180 $element[] = $this->
processBottomLink(
'whatlinkshere', $toolbox[
'whatlinkshere'] );
181 $element[] = $this->
processBottomLink(
'recentchangeslinked', $toolbox[
'recentchangeslinked'] );
183 $element[] = $this->
processBottomLink(
'contributions', $toolbox[
'contributions'] );
186 $lines[] = $this->
getSkin()->getLanguage()->pipeList( array_filter( $element ) );
191 $element[] = $this->
processBottomLink(
'delete', $content_nav[
'actions'][
'delete'],
'deletethispage' );
192 $element[] = $this->
processBottomLink(
'undelete', $content_nav[
'actions'][
'undelete'],
'undeletethispage' );
194 $element[] = $this->
processBottomLink(
'protect', $content_nav[
'actions'][
'protect'],
'protectthispage' );
195 $element[] = $this->
processBottomLink(
'unprotect', $content_nav[
'actions'][
'unprotect'],
'unprotectthispage' );
197 $element[] = $this->
processBottomLink(
'move', $content_nav[
'actions'][
'move'],
'movethispage' );
199 $lines[] = $this->
getSkin()->getLanguage()->pipeList( array_filter( $element ) );
205 return implode( array_filter(
$lines ),
"<br />\n" ) .
"<br />\n";
216 $companionTitle =
$title->isTalkPage() ?
$title->getSubjectPage() :
$title->getTalkPage();
217 $companionNamespace = $companionTitle->getNamespace();
221 $nsToMessage =
array(
236 if ( isset( $nsToMessage[$companionNamespace] ) ) {
237 $message = $nsToMessage[$companionNamespace];
239 $message = $companionTitle->isTalkPage() ?
'talkpage' :
'articlepage';
244 $key = $companionTitle->getNamespaceKey(
'' );
245 if ( $companionTitle->isTalkPage() ) {
246 $key = ( $key ==
'main' ?
'talk' : $key .
"_talk" );
250 $namespacesLinks = $this->
data[
'content_navigation'][
'namespaces'];
264 if ( $navlink[
'id'] ) {
265 $navlink[
'single-id'] = $navlink[
'id'];
266 $navlink[
'tooltiponly'] =
true;
269 if ( $idPrefix ===
false ) {
270 unset( $navlink[
'id'] );
272 $navlink[
'id'] = $idPrefix . $navlink[
'id'];
287 <p
id=
"sitetitle" role=
"banner">
288 <a
href=
"<?php echo htmlspecialchars( $this->data['nav_urls']['mainpage']['href'] ) ?>">
292 <p
id=
"sitesub"><?
php echo
wfMessage(
'sitesubtitle' )->escaped() ?></p>
293 <div
id=
"linkcollection" role=
"navigation">
294 <div
id=
"langlinks"><?
php echo str_replace(
'<br />',
'', $this->
otherLanguages() ) ?></div>
295 <?
php echo $this->
getSkin()->getCategories() ?>
297 <?
php if ( $this->
data[
'newtalk'] ) { ?>
298 <div
class=
"usermessage"><strong><?
php echo $this->
data[
'newtalk'] ?></strong></div>
302 <div
id=
"article" class=
"mw-body" role=
"main">
303 <?
php if ( $this->
getSkin()->getSiteNotice() ) { ?>
304 <div
id=
"siteNotice"><?
php echo $this->
getSkin()->getSiteNotice() ?></div>
306 <h1
id=
"firstHeading" lang=
"<?php
307 $this->data['pageLanguage'] = $this->getSkin()->getTitle()->getPageViewLanguage()->getHtmlCode();
308 $this->text( 'pageLanguage' );
309 ?>"><span dir=
"auto"><?
php echo $this->
data[
'title'] ?></span></h1>
310 <?
php if ( $this->translator->translate(
'tagline' ) ) { ?>
311 <p
class=
"tagline"><?
php echo htmlspecialchars( $this->translator->translate(
'tagline' ) ) ?></p>
313 <?
php if ( $this->
getSkin()->getOutput()->getSubtitle() ) { ?>
314 <p
class=
"subtitle"><?
php echo $this->
getSkin()->getOutput()->getSubtitle() ?></p>
316 <?
php if ( $this->
getSkin()->subPageSubtitle() ) { ?>
317 <p
class=
"subpages"><?
php echo $this->
getSkin()->subPageSubtitle() ?></p>
320 $s = ob_get_contents();
334 <div
id=
"footer-navigation" role=
"navigation">
342 $this->
getSkin()->mainPageLink(),
348 <div
id=
"footer-info" role=
"contentinfo">
352 if ( $footlinks[
'info'] ) {
353 foreach ( $footlinks[
'info']
as $item ) {
354 echo $this->
data[$item] .
' ';
361 <div
id=
"mw-navigation">
362 <h2><?
php echo
wfMessage(
'navigation-heading' )->escaped() ?></h2>
363 <div
id=
"toplinks" role=
"navigation">
364 <p
id=
"syslinks"><?
php echo $this->
sysLinks() ?></p>
370 $s = ob_get_contents();
381 $this->
getSkin()->mainPageLink(),
398 foreach (
array(
'logout',
'createaccount',
'login' )
as $key ) {
399 if ( $personalUrls[$key] ) {
404 return $this->
getSkin()->getLanguage()->pipeList(
$s );
418 $content_navigation = $this->
data[
'content_navigation'];
419 $qbpageoptions = array_merge(
420 $content_navigation[
'namespaces'],
422 'history' => $content_navigation[
'views'][
'history'],
423 'watch' => $content_navigation[
'actions'][
'watch'],
424 'unwatch' => $content_navigation[
'actions'][
'unwatch'],
427 $content_navigation[
'actions'][
'watch'] =
null;
428 $content_navigation[
'actions'][
'unwatch'] =
null;
429 $qbedit = array_merge(
431 'edit' => $content_navigation[
'views'][
'edit'],
432 'addsection' => $content_navigation[
'views'][
'addsection'],
434 $content_navigation[
'actions']
439 foreach (
array(
'logout',
'createaccount',
'login', )
as $key ) {
440 $qbmyoptions[$key] =
null;
444 $bar[
'cactions'] = $qbedit;
445 $bar[
'pageoptions'] = $qbpageoptions;
446 $bar[
'personal'] = $qbmyoptions;
462 $orig_bar = $this->
data[
'sidebar'];
467 $bar[
'SEARCH'] =
true;
469 foreach ( $orig_bar
as $heading => $data ) {
470 if ( $heading ==
'TOOLBOX' ) {
476 if ( $heading !=
'LANGUAGES' ) {
477 $bar[$heading] = $data;
481 if ( !$hasToolbox ) {
488 foreach ( $orig_bar
as $heading => $data ) {
489 if ( $heading ==
'SEARCH' ) {
490 $bar[
'search'] = $this->
searchForm(
'sidebar' );
491 } elseif ( $heading ==
'TOOLBOX' ) {
494 $bar[$heading] = $data;
500 $idToMessage =
array(
501 'search' =>
'qbfind',
502 'navigation' =>
'qbbrowse',
504 'cactions' =>
'qbedit',
505 'personal' =>
'qbmyoptions',
506 'pageoptions' =>
'qbpageoptions',
509 $s =
"<div id='quickbar'>\n";
511 foreach ( $bar
as $heading => $data ) {
513 $headingMsg =
wfMessage( $idToMessage[$heading] ? $idToMessage[$heading] : $heading );
514 $headingHTML =
"<h3>" . ( $headingMsg->exists() ? $headingMsg->escaped() : htmlspecialchars( $heading ) ) .
"</h3>";
517 if ( is_array( $data ) ) {
519 foreach ( $data
as $key =>
$link ) {
526 $listHTML =
"<ul>$listHTML</ul>";
534 $role = ( $heading ==
'search' ) ?
'search' :
'navigation';
535 $s .=
"<div class=\"portlet\" id=\"$portletId\" role=\"$role\">\n$headingHTML\n$listHTML\n</div>\n";
550 global $wgUseTwoButtonsSearchForm;
552 $search = $this->
getSkin()->getRequest()->getText(
'search' );
553 $action = $this->
data[
'searchaction'];
554 $s =
"<form id=\"searchform-" . htmlspecialchars( $which ) .
"\" method=\"get\" class=\"inline\" action=\"$action\">";
555 if ( $which ==
'footer' ) {
560 $s .= ( $which ==
'footer' ?
" " :
"<br />" );
563 if ( $wgUseTwoButtonsSearchForm ) {
566 $s .=
'<div><a href="' . $action .
'" rel="search">' .
wfMessage(
'powersearch-legend' )->escaped() .
"</a></div>\n";
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())
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
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...
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
if( $this->translator->translate( 'tagline')) if( $this->getSkin() ->getOutput() ->getSubtitle()) if( $this->getSkin() ->subPageSubtitle()) $s
variantLinks()
Language/charset variant links for classic-style skins.
execute()
Main function, used by classes that subclass QuickTemplate to show the actual HTML output.
wfSuppressWarnings( $end=false)
Reference-counted warning suppression.
quickBar()
Compute the sidebar.
processNavlinkForDocument( $navlink, $idPrefix='cb-')
Takes a navigational link generated by SkinTemplate in whichever way and mangles attributes unsuitabl...
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.
static linkKnown( $target, $html=null, $customAttribs=array(), $query=array(), $options=array( 'known', 'noclasses'))
Identical to link(), except $options defaults to 'known'.
static makeExternalLink( $url, $text, $escape=true, $linktype='', $attribs=array(), $title=null)
Make an external link.
if( $this->data['newtalk']) if( $this->getSkin() ->getSiteNotice()) $this data['pageLanguage']
wfRestoreWarnings()
Restore error level to previous value.
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.
when a variable name is used in a it is silently declared as a new masking the global
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.
presenting them properly to the user as errors is done by the caller $title
Allows to change the fields on the form that will be generated $name
makeSearchButton( $mode, $attrs=array())
setupSkinUserCss(OutputPage $out)
processBottomLink( $key, $navlink, $message=null)
Used in bottomLinks() to eliminate repetitive code.
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
formatLanguageName( $name)
Override langlink formatting behavior not to uppercase the language names.
sidebarAdditions( $bar)
Adds CologneBlue-specific items to the sidebar: qbedit, qbpageoptions and qbmyoptions menus.
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....
static makeInternalOrExternalUrl( $name)
If url string starts with http, consider as external URL, else internal.
renderAfterPortlet( $name)