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 // Generate additional footer links
56 $footerlinks = $this->data
["footerlinks"];
57 // fold footerlinks into a single array using a bit of trickery
58 $footerlinks = call_user_func_array('array_merge', array_values($footerlinks));
59 // Generate additional footer icons
60 $footericons = $this->data
["footericons"];
61 // Unset copyright.copyright since we don't need the icon and already output a copyright from footerlinks
62 unset($footericons["copyright"]["copyright"]);
63 if ( count($footericons["copyright"]) <= 0 ) {
64 unset($footericons["copyright"]);
67 $this->html( 'headelement' );
71 <div id
="mw_header"><h1 id
="firstHeading"><?php
$this->html('title') ?
></h1
></div
>
74 <div id
="mw_contentwrapper">
75 <!-- navigation portlet
-->
76 <div id
="p-cactions" class="portlet">
77 <h5
><?php
$this->msg('views') ?
></h5
>
80 <?php
foreach($this->data
['content_actions'] as $key => $tab) {
82 <li id="' . Sanitizer
::escapeId( "ca-$key" ) . '"';
84 echo ' class="'.htmlspecialchars($tab['class']).'"';
86 echo'><a href="'.htmlspecialchars($tab['href']).'"';
87 # We don't want to give the watch tab an accesskey if the
88 # page is being edited, because that conflicts with the
89 # accesskey on the watch checkbox. We also don't want to
90 # give the edit tab an accesskey, because that's fairly su-
91 # perfluous and conflicts with an accesskey (Ctrl-E) often
92 # used for editing in Safari.
93 if( in_array( $action, array( 'edit', 'submit' ) )
94 && in_array( $key, array( 'edit', 'watch', 'unwatch' ))) {
95 echo $skin->tooltip( "ca-$key" );
97 echo $skin->tooltipAndAccesskey( "ca-$key" );
99 echo '>'.htmlspecialchars($tab['text']).'</a></li>';
106 <div id
="mw_content">
107 <!-- contentholder does nothing by
default, but it allows users to style the text inside
108 the content area without affecting the meaning of
'em' in
#mw_content, which is used
110 <div id
="mw_contentholder" <?php
$this->html("specialpageattributes") ?
>>
111 <div
class='mw-topboxes'>
112 <div id
="mw-js-message" style
="display:none;"<?php
$this->html('userlangattributes')?
>></div
>
113 <div
class="mw-topbox" id
="siteSub"><?php
$this->msg('tagline') ?
></div
>
114 <?php
if($this->data
['newtalk'] ) {
115 ?
><div
class="usermessage mw-topbox"><?php
$this->html('newtalk') ?
></div
>
117 <?php
if($this->data
['sitenotice']) {
118 ?
><div
class="mw-topbox" id
="siteNotice"><?php
$this->html('sitenotice') ?
></div
>
122 <div id
="contentSub"<?php
$this->html('userlangattributes') ?
>><?php
$this->html('subtitle') ?
></div
>
124 <?php
if($this->data
['undelete']) { ?
><div id
="contentSub2"><?php
$this->html('undelete') ?
></div
><?php
} ?
>
125 <?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
} ?
>
127 <?php
$this->html('bodytext') ?
>
128 <div
class='mw_clear'></div
>
129 <?php
if($this->data
['catlinks']) { $this->html('catlinks'); } ?
>
130 <?php
$this->html ('dataAfterContent') ?
>
131 </div
><!-- mw_contentholder
-->
132 </div
><!-- mw_content
-->
133 </div
><!-- mw_contentwrapper
-->
135 <div id
="mw_portlets"<?php
$this->html("userlangattributes") ?
>>
139 $sidebar = $this->data
['sidebar'];
140 if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true;
141 if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true;
142 if ( !isset( $sidebar['LANGUAGES'] ) ) $sidebar['LANGUAGES'] = true;
144 foreach ($sidebar as $boxName => $cont) {
145 if ( $boxName == 'SEARCH' ) {
147 } elseif ( $boxName == 'TOOLBOX' ) {
149 } elseif ( $boxName == 'LANGUAGES' ) {
150 $this->languageBox();
152 $this->customBox( $boxName, $cont );
157 </div
><!-- mw_portlets
-->
162 <div
class="mw_clear"></div
>
164 <!-- personal portlet
-->
165 <div
class="portlet" id
="p-personal">
166 <h5
><?php
$this->msg('personaltools') ?
></h5
>
169 <?php
foreach($this->data
['personal_urls'] as $key => $item) { ?
>
170 <li id
="<?php echo Sanitizer::escapeId( "pt
-$key" ) ?>"<?php
171 if ($item['active']) { ?
> class="active"<?php
} ?
>><a href
="<?php
172 echo htmlspecialchars($item['href']) ?>"<?php
echo $skin->tooltipAndAccesskey('pt-'.$key) ?
><?php
173 if(!empty($item['class'])) { ?
> class="<?php
174 echo htmlspecialchars($item['class']) ?>"<?php
} ?
>><?php
175 echo htmlspecialchars($item['text']) ?
></a
></li
>
183 <div id
="footer"<?php
$this->html('userlangattributes') ?
>>
186 foreach( $footerlinks as $aLink ) {
187 if( isset( $this->data
[$aLink] ) && $this->data
[$aLink] ) {
188 ?
> <li id
="<?php echo$aLink?>"><?php
$this->html($aLink) ?
></li
>
194 foreach ( $footericons as $blockName => $footerIcons ) { ?
>
195 <div id
="mw_<?php echo htmlspecialchars($blockName); ?>">
197 foreach ( $footerIcons as $icon ) {
198 if ( is_string($icon) ) {
201 $html = htmlspecialchars($icon["alt"]);
202 if ( $icon["url"] ) {
203 $html = Html
::element( 'a', array( "href" => $icon["url"] ), $html );
214 <?php
$this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?
>
215 <?php
$this->html('reporttime') ?
>
216 <?php
if ( $this->data
['debug'] ): ?
>
218 <?php
$this->text( 'debug' ); ?
>
224 } // end of execute() method