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 # We don't want to give the watch tab an accesskey if the
76 # page is being edited, because that conflicts with the
77 # accesskey on the watch checkbox. We also don't want to
78 # give the edit tab an accesskey, because that's fairly su-
79 # perfluous and conflicts with an accesskey (Ctrl-E) often
80 # used for editing in Safari.
81 if( in_array( $action, array( 'edit', 'submit' ) )
82 && in_array( $key, array( 'edit', 'watch', 'unwatch' ))) {
83 echo $skin->tooltip( "ca-$key" );
85 echo $skin->tooltipAndAccesskey( "ca-$key" );
87 echo '>'.htmlspecialchars($tab['text']).'</a></li>';
95 <!-- contentholder does nothing by
default, but it allows users to style the text inside
96 the content area without affecting the meaning of
'em' in
#mw_content, which is used
98 <div id
="mw_contentholder" <?php
$this->html("specialpageattributes") ?
>>
99 <div
class='mw-topboxes'>
100 <div id
="mw-js-message" style
="display:none;"<?php
$this->html('userlangattributes')?
>></div
>
101 <div
class="mw-topbox" id
="siteSub"><?php
$this->msg('tagline') ?
></div
>
102 <?php
if($this->data
['newtalk'] ) {
103 ?
><div
class="usermessage mw-topbox"><?php
$this->html('newtalk') ?
></div
>
105 <?php
if($this->data
['sitenotice']) {
106 ?
><div
class="mw-topbox" id
="siteNotice"><?php
$this->html('sitenotice') ?
></div
>
110 <div id
="contentSub"<?php
$this->html('userlangattributes') ?
>><?php
$this->html('subtitle') ?
></div
>
112 <?php
if($this->data
['undelete']) { ?
><div id
="contentSub2"><?php
$this->html('undelete') ?
></div
><?php
} ?
>
113 <?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
} ?
>
115 <?php
$this->html('bodytext') ?
>
116 <div
class='mw_clear'></div
>
117 <?php
if($this->data
['catlinks']) { $this->html('catlinks'); } ?
>
118 <?php
$this->html ('dataAfterContent') ?
>
119 </div
><!-- mw_contentholder
-->
120 </div
><!-- mw_content
-->
121 </div
><!-- mw_contentwrapper
-->
123 <div id
="mw_portlets"<?php
$this->html("userlangattributes") ?
>>
127 $sidebar = $this->data
['sidebar'];
128 if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true;
129 if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true;
130 if ( !isset( $sidebar['LANGUAGES'] ) ) $sidebar['LANGUAGES'] = true;
132 foreach ($sidebar as $boxName => $cont) {
133 if ( $boxName == 'SEARCH' ) {
135 } elseif ( $boxName == 'TOOLBOX' ) {
137 } elseif ( $boxName == 'LANGUAGES' ) {
138 $this->languageBox();
140 $this->customBox( $boxName, $cont );
145 </div
><!-- mw_portlets
-->
150 <div
class="mw_clear"></div
>
152 <!-- personal portlet
-->
153 <div
class="portlet" id
="p-personal">
154 <h5
><?php
$this->msg('personaltools') ?
></h5
>
157 <?php
foreach($this->data
['personal_urls'] as $key => $item) { ?
>
158 <li id
="<?php echo Sanitizer::escapeId( "pt
-$key" ) ?>"<?php
159 if ($item['active']) { ?
> class="active"<?php
} ?
>><a href
="<?php
160 echo htmlspecialchars($item['href']) ?>"<?php
echo $skin->tooltipAndAccesskey('pt-'.$key) ?
><?php
161 if(!empty($item['class'])) { ?
> class="<?php
162 echo htmlspecialchars($item['class']) ?>"<?php
} ?
>><?php
163 echo htmlspecialchars($item['text']) ?
></a
></li
>
171 <div id
="footer"<?php
$this->html('userlangattributes') ?
>>
174 foreach( $this->getFooterLinks("flat") as $aLink ) {
175 if( isset( $this->data
[$aLink] ) && $this->data
[$aLink] ) {
176 ?
> <li id
="<?php echo$aLink?>"><?php
$this->html($aLink) ?
></li
>
182 foreach ( $this->getFooterIcons("nocopyright") as $blockName => $footerIcons ) { ?
>
183 <div id
="mw_<?php echo htmlspecialchars($blockName); ?>">
185 foreach ( $footerIcons as $icon ) { ?
>
186 <?php
echo $this->skin
->makeFooterIcon( $icon, 'withoutImage' ); ?
>
196 <?php
$this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?
>
197 <?php
$this->html('reporttime') ?
>
198 <?php
if ( $this->data
['debug'] ): ?
>
200 <?php
$this->text( 'debug' ); ?
>
206 } // end of execute() method