3 * Modern skin, derived from monobook template.
10 if( !defined( 'MEDIAWIKI' ) )
13 require( dirname(__FILE__
) . '/MonoBook.php' );
16 * Inherit main code from SkinTemplate, set the CSS and template filter.
20 class SkinModern
extends SkinTemplate
{
21 var $skinname = 'modern', $stylename = 'modern',
22 $template = 'ModernTemplate', $useHeadElement = true;
25 * We don't like the default getPoweredBy, the icon clashes with the
28 function getPoweredBy() {
30 return "<div class='mw_poweredby'>Powered by MediaWiki $wgVersion</div>";
33 function setupSkinUserCss( OutputPage
$out ){
34 global $wgStyleVersion, $wgJsMimeType, $wgStylePath;
36 // Do not call parent::setupSkinUserCss(), we have our own print style
37 $out->addStyle( 'common/shared.css', 'screen' );
38 $out->addStyle( 'modern/main.css', 'screen' );
39 $out->addStyle( 'modern/print.css', 'print' );
40 $out->addStyle( 'modern/rtl.css', 'screen', '', 'rtl' );
48 class ModernTemplate
extends MonoBookTemplate
{
51 * Template filter callback for Modern skin.
52 * Takes an associative array of data set from a SkinTemplate-based
53 * class, and a wrapper for MediaWiki's localization database, and
54 * outputs a formatted page.
59 global $wgRequest, $wgOut;
60 $this->skin
= $skin = $this->data
['skin'];
61 $action = $wgRequest->getText( 'action' );
63 // Suppress warnings to prevent notices about missing indexes in $this->data
66 $this->html( 'headelement' );
70 <div id
="mw_header"><h1 id
="firstHeading"><?php
$this->html('title') ?
></h1
></div
>
73 <div id
="mw_contentwrapper">
74 <!-- navigation portlet
-->
75 <div id
="p-cactions" class="portlet">
76 <h5
><?php
$this->msg('views') ?
></h5
>
79 <?php
foreach($this->data
['content_actions'] as $key => $tab) {
81 <li id="' . Sanitizer
::escapeId( "ca-$key" ) . '"';
83 echo ' class="'.htmlspecialchars($tab['class']).'"';
85 echo'><a href="'.htmlspecialchars($tab['href']).'"';
86 # We don't want to give the watch tab an accesskey if the
87 # page is being edited, because that conflicts with the
88 # accesskey on the watch checkbox. We also don't want to
89 # give the edit tab an accesskey, because that's fairly su-
90 # perfluous and conflicts with an accesskey (Ctrl-E) often
91 # used for editing in Safari.
92 if( in_array( $action, array( 'edit', 'submit' ) )
93 && in_array( $key, array( 'edit', 'watch', 'unwatch' ))) {
94 echo $skin->tooltip( "ca-$key" );
96 echo $skin->tooltipAndAccesskey( "ca-$key" );
98 echo '>'.htmlspecialchars($tab['text']).'</a></li>';
105 <div id
="mw_content">
106 <!-- contentholder does nothing by
default, but it allows users to style the text inside
107 the content area without affecting the meaning of
'em' in
#mw_content, which is used
109 <div id
="mw_contentholder" <?php
$this->html("specialpageattributes") ?
>>
110 <div
class='mw-topboxes'>
111 <div id
="mw-js-message" style
="display:none;"<?php
$this->html('userlangattributes')?
>></div
>
112 <div
class="mw-topbox" id
="siteSub"><?php
$this->msg('tagline') ?
></div
>
113 <?php
if($this->data
['newtalk'] ) {
114 ?
><div
class="usermessage mw-topbox"><?php
$this->html('newtalk') ?
></div
>
116 <?php
if($this->data
['sitenotice']) {
117 ?
><div
class="mw-topbox" id
="siteNotice"><?php
$this->html('sitenotice') ?
></div
>
121 <div id
="contentSub"<?php
$this->html('userlangattributes') ?
>><?php
$this->html('subtitle') ?
></div
>
123 <?php
if($this->data
['undelete']) { ?
><div id
="contentSub2"><?php
$this->html('undelete') ?
></div
><?php
} ?
>
124 <?php
if($this->data
['showjumplinks']) { ?
><div id
="jump-to-nav"><?php
$this->msg('jumpto') ?
> <a href
="#mw_portlets"><?php
$this->msg('jumptonavigation') ?
></a
>, <a href
="#searchInput"><?php
$this->msg('jumptosearch') ?
></a
></div
><?php
} ?
>
126 <?php
$this->html('bodytext') ?
>
127 <div
class='mw_clear'></div
>
128 <?php
if($this->data
['catlinks']) { $this->html('catlinks'); } ?
>
129 <?php
$this->html ('dataAfterContent') ?
>
130 </div
><!-- mw_contentholder
-->
131 </div
><!-- mw_content
-->
132 </div
><!-- mw_contentwrapper
-->
134 <div id
="mw_portlets"<?php
$this->html("userlangattributes") ?
>>
138 $sidebar = $this->data
['sidebar'];
139 if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true;
140 if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true;
141 if ( !isset( $sidebar['LANGUAGES'] ) ) $sidebar['LANGUAGES'] = true;
143 foreach ($sidebar as $boxName => $cont) {
144 if ( $boxName == 'SEARCH' ) {
146 } elseif ( $boxName == 'TOOLBOX' ) {
148 } elseif ( $boxName == 'LANGUAGES' ) {
149 $this->languageBox();
151 $this->customBox( $boxName, $cont );
156 </div
><!-- mw_portlets
-->
161 <div
class="mw_clear"></div
>
163 <!-- personal portlet
-->
164 <div
class="portlet" id
="p-personal">
165 <h5
><?php
$this->msg('personaltools') ?
></h5
>
168 <?php
foreach($this->data
['personal_urls'] as $key => $item) { ?
>
169 <li id
="<?php echo Sanitizer::escapeId( "pt
-$key" ) ?>"<?php
170 if ($item['active']) { ?
> class="active"<?php
} ?
>><a href
="<?php
171 echo htmlspecialchars($item['href']) ?>"<?php
echo $skin->tooltipAndAccesskey('pt-'.$key) ?
><?php
172 if(!empty($item['class'])) { ?
> class="<?php
173 echo htmlspecialchars($item['class']) ?>"<?php
} ?
>><?php
174 echo htmlspecialchars($item['text']) ?
></a
></li
>
182 <div id
="footer"<?php
$this->html('userlangattributes') ?
>>
185 $footerlinks = array(
186 'lastmod', 'viewcount', 'numberofwatchingusers', 'credits', 'copyright',
187 'privacy', 'about', 'disclaimer', 'tagline',
189 foreach( $footerlinks as $aLink ) {
190 if( isset( $this->data
[$aLink] ) && $this->data
[$aLink] ) {
191 ?
> <li id
="<?php echo$aLink?>"><?php
$this->html($aLink) ?
></li
>
196 <?php
echo $this->html("poweredbyico"); ?
>
199 <?php
$this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?
>
200 <?php
$this->html('reporttime') ?
>
201 <?php
if ( $this->data
['debug'] ): ?
>
203 <?php
$this->text( 'debug' ); ?
>
209 } // end of execute() method