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;
24 function setupSkinUserCss( OutputPage
$out ){
25 // Do not call parent::setupSkinUserCss(), we have our own print style
26 $out->addStyle( 'common/shared.css', 'screen' );
27 $out->addStyle( 'modern/main.css', 'screen' );
28 $out->addStyle( 'modern/print.css', 'print' );
29 $out->addStyle( 'modern/rtl.css', 'screen', '', 'rtl' );
37 class ModernTemplate
extends MonoBookTemplate
{
40 * Template filter callback for Modern skin.
41 * Takes an associative array of data set from a SkinTemplate-based
42 * class, and a wrapper for MediaWiki's localization database, and
43 * outputs a formatted page.
49 $this->skin
= $skin = $this->data
['skin'];
50 $action = $wgRequest->getText( 'action' );
52 // Suppress warnings to prevent notices about missing indexes in $this->data
55 $this->html( 'headelement' );
59 <div id
="mw_header"><h1 id
="firstHeading"><?php
$this->html('title') ?
></h1
></div
>
62 <div id
="mw_contentwrapper">
63 <!-- navigation portlet
-->
64 <div id
="p-cactions" class="portlet">
65 <h5
><?php
$this->msg('views') ?
></h5
>
68 <?php
foreach($this->data
['content_actions'] as $key => $tab) {
70 <li id="' . Sanitizer
::escapeId( "ca-$key" ) . '"';
72 echo ' class="'.htmlspecialchars($tab['class']).'"';
74 echo'><a href="'.htmlspecialchars($tab['href']).'"';
75 if( isset($tab["tooltiponly"]) && $tab["tooltiponly"] ) {
76 echo $skin->tooltip( "ca-$key" );
78 echo $skin->tooltipAndAccesskey( "ca-$key" );
80 echo '>'.htmlspecialchars($tab['text']).'</a></li>';
88 <!-- contentholder does nothing by
default, but it allows users to style the text inside
89 the content area without affecting the meaning of
'em' in
#mw_content, which is used
91 <div id
="mw_contentholder" <?php
$this->html("specialpageattributes") ?
>>
92 <div
class='mw-topboxes'>
93 <div id
="mw-js-message" style
="display:none;"<?php
$this->html('userlangattributes')?
>></div
>
94 <div
class="mw-topbox" id
="siteSub"><?php
$this->msg('tagline') ?
></div
>
95 <?php
if($this->data
['newtalk'] ) {
96 ?
><div
class="usermessage mw-topbox"><?php
$this->html('newtalk') ?
></div
>
98 <?php
if($this->data
['sitenotice']) {
99 ?
><div
class="mw-topbox" id
="siteNotice"><?php
$this->html('sitenotice') ?
></div
>
103 <div id
="contentSub"<?php
$this->html('userlangattributes') ?
>><?php
$this->html('subtitle') ?
></div
>
105 <?php
if($this->data
['undelete']) { ?
><div id
="contentSub2"><?php
$this->html('undelete') ?
></div
><?php
} ?
>
106 <?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
} ?
>
108 <?php
$this->html('bodytext') ?
>
109 <div
class='mw_clear'></div
>
110 <?php
if($this->data
['catlinks']) { $this->html('catlinks'); } ?
>
111 <?php
$this->html ('dataAfterContent') ?
>
112 </div
><!-- mw_contentholder
-->
113 </div
><!-- mw_content
-->
114 </div
><!-- mw_contentwrapper
-->
116 <div id
="mw_portlets"<?php
$this->html("userlangattributes") ?
>>
120 $sidebar = $this->data
['sidebar'];
121 if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true;
122 if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true;
123 if ( !isset( $sidebar['LANGUAGES'] ) ) $sidebar['LANGUAGES'] = true;
125 foreach ($sidebar as $boxName => $cont) {
126 if ( $boxName == 'SEARCH' ) {
128 } elseif ( $boxName == 'TOOLBOX' ) {
130 } elseif ( $boxName == 'LANGUAGES' ) {
131 $this->languageBox();
133 $this->customBox( $boxName, $cont );
138 </div
><!-- mw_portlets
-->
143 <div
class="mw_clear"></div
>
145 <!-- personal portlet
-->
146 <div
class="portlet" id
="p-personal">
147 <h5
><?php
$this->msg('personaltools') ?
></h5
>
150 <?php
foreach($this->getPersonalTools() as $key => $item) { ?
>
151 <?php
echo $this->makeListItem($key, $item); ?
>
160 <div id
="footer"<?php
$this->html('userlangattributes') ?
>>
163 foreach( $this->getFooterLinks("flat") as $aLink ) {
164 if( isset( $this->data
[$aLink] ) && $this->data
[$aLink] ) {
165 ?
> <li id
="<?php echo$aLink?>"><?php
$this->html($aLink) ?
></li
>
171 foreach ( $this->getFooterIcons("nocopyright") as $blockName => $footerIcons ) { ?
>
172 <div id
="mw_<?php echo htmlspecialchars($blockName); ?>">
174 foreach ( $footerIcons as $icon ) { ?
>
175 <?php
echo $this->skin
->makeFooterIcon( $icon, 'withoutImage' ); ?
>
185 <?php
$this->printTrail(); ?
>
189 } // end of execute() method