3 * Modern skin, derived from monobook template.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
25 if ( !defined( 'MEDIAWIKI' ) ) {
30 * Inherit main code from SkinTemplate, set the CSS and template filter.
34 class SkinModern
extends SkinTemplate
{
35 public $skinname = 'modern';
36 public $stylename = 'modern';
37 public $template = 'ModernTemplate';
38 public $useHeadElement = true;
41 * @param OutputPage $out
43 function setupSkinUserCss( OutputPage
$out ) {
44 parent
::setupSkinUserCss( $out );
45 $out->addModuleStyles( 'skins.modern' );
53 class ModernTemplate
extends MonoBookTemplate
{
56 * Template filter callback for Modern skin.
57 * Takes an associative array of data set from a SkinTemplate-based
58 * class, and a wrapper for MediaWiki's localization database, and
59 * outputs a formatted page.
64 // Suppress warnings to prevent notices about missing indexes in $this->data
67 $this->html( 'headelement' );
71 <div id
="mw_header"><h1 id
="firstHeading" lang
="<?php
72 $this->data['pageLanguage'] = $this->getSkin()->getTitle()->getPageViewLanguage()->getHtmlCode();
73 $this->text( 'pageLanguage' );
74 ?>"><span dir
="auto"><?php
$this->html( 'title' ) ?
></span
></h1
></div
>
77 <div id
="mw_contentwrapper">
78 <!-- navigation portlet
-->
79 <?php
$this->cactions(); ?
>
82 <div id
="mw_content" role
="main">
83 <!-- contentholder does nothing by
default, but it allows users to style the text inside
84 the content area without affecting the meaning of
'em' in
#mw_content, which is used
86 <div id
="mw_contentholder" class="mw-body">
87 <div
class='mw-topboxes'>
88 <div id
="mw-js-message"
89 style
="display:none;"<?php
$this->html( 'userlangattributes' ) ?
>></div
>
90 <div
class="mw-topbox" id
="siteSub"><?php
$this->msg( 'tagline' ) ?
></div
>
92 if ( $this->data
['newtalk'] ) {
94 <div
class="usermessage mw-topbox"><?php
$this->html( 'newtalk' ) ?
></div
>
99 if ( $this->data
['sitenotice'] ) {
101 <div
class="mw-topbox" id
="siteNotice"><?php
$this->html( 'sitenotice' ) ?
></div
>
107 <div id
="contentSub"<?php
108 $this->html( 'userlangattributes' )
110 $this->html( 'subtitle' )
114 if ( $this->data
['undelete'] ) {
116 <div id
="contentSub2"><?php
$this->html( 'undelete' ) ?
></div
><?php
119 <div id
="jump-to-nav"><?php
$this->msg( 'jumpto' ) ?
>
120 <a href
="#mw_portlets"><?php
121 $this->msg( 'jumptonavigation' ) ?
></a
><?php
$this->msg( 'comma-separator' )
123 <a href
="#searchInput"><?php
$this->msg( 'jumptosearch' ) ?
></a
>
126 <?php
$this->html( 'bodytext' ) ?
>
127 <div
class='mw_clear'></div
>
129 if ( $this->data
['catlinks'] ) {
130 $this->html( 'catlinks' );
133 <?php
$this->html( 'dataAfterContent' ) ?
>
134 </div
><!-- mw_contentholder
-->
135 </div
><!-- mw_content
-->
136 </div
><!-- mw_contentwrapper
-->
138 <div id
="mw_portlets"<?php
$this->html( "userlangattributes" ) ?
>>
139 <h2
><?php
$this->msg( 'navigation-heading' ) ?
></h2
>
142 <?php
$this->renderPortals( $this->data
['sidebar'] ); ?
>
144 </div
><!-- mw_portlets
-->
149 <div
class="mw_clear"></div
>
151 <!-- personal portlet
-->
152 <div
class="portlet" id
="p-personal" role
="navigation">
153 <h3
><?php
$this->msg( 'personaltools' ) ?
></h3
>
158 foreach ( $this->getPersonalTools() as $key => $item ) {
160 <?php
echo $this->makeListItem( $key, $item ); ?
>
171 <div id
="footer" role
="contentinfo"<?php
$this->html( 'userlangattributes' ) ?
>>
174 foreach ( $this->getFooterLinks( "flat" ) as $aLink ) {
175 if ( isset( $this->data
[$aLink] ) && $this->data
[$aLink] ) {
177 <li id
="<?php echo $aLink ?>"><?php
$this->html( $aLink ) ?
></li
>
184 foreach ( $this->getFooterIcons( "nocopyright" ) as $blockName => $footerIcons ) {
186 <div id
="mw_<?php echo htmlspecialchars( $blockName ); ?>">
188 foreach ( $footerIcons as $icon ) {
190 <?php
echo $this->getSkin()->makeFooterIcon( $icon, 'withoutImage' ); ?
>
200 <?php
$this->printTrail(); ?
>
204 } // end of execute() method