Merge "Whitelist the <wbr> element."
[mediawiki.git] / skins / Modern.php
blob8d778cf6211e3179d83d8555645d064546987aed
1 <?php
2 /**
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
20 * @todo document
21 * @file
22 * @ingroup Skins
25 if ( !defined( 'MEDIAWIKI' ) ) {
26 die( -1 );
29 /**
30 * Inherit main code from SkinTemplate, set the CSS and template filter.
31 * @todo document
32 * @ingroup Skins
34 class SkinModern extends SkinTemplate {
35 var $skinname = 'modern', $stylename = 'modern',
36 $template = 'ModernTemplate', $useHeadElement = true;
38 /**
39 * @param $out OutputPage
41 function setupSkinUserCss( OutputPage $out ) {
42 parent::setupSkinUserCss( $out );
43 $out->addModuleStyles( 'skins.modern' );
47 /**
48 * @todo document
49 * @ingroup Skins
51 class ModernTemplate extends MonoBookTemplate {
53 /**
54 * Template filter callback for Modern skin.
55 * Takes an associative array of data set from a SkinTemplate-based
56 * class, and a wrapper for MediaWiki's localization database, and
57 * outputs a formatted page.
59 * @access private
61 function execute() {
62 // Suppress warnings to prevent notices about missing indexes in $this->data
63 wfSuppressWarnings();
65 $this->html( 'headelement' );
68 <!-- heading -->
69 <div id="mw_header"><h1 id="firstHeading" lang="<?php
70 $this->data['pageLanguage'] = $this->getSkin()->getTitle()->getPageViewLanguage()->getHtmlCode();
71 $this->text( 'pageLanguage' );
72 ?>"><span dir="auto"><?php $this->html( 'title' ) ?></span></h1></div>
74 <div id="mw_main">
75 <div id="mw_contentwrapper">
76 <!-- navigation portlet -->
77 <?php $this->cactions(); ?>
79 <!-- content -->
80 <div id="mw_content" role="main">
81 <!-- contentholder does nothing by default, but it allows users to style the text inside
82 the content area without affecting the meaning of 'em' in #mw_content, which is used
83 for the margins -->
84 <div id="mw_contentholder" class="mw-body">
85 <div class='mw-topboxes'>
86 <div id="mw-js-message" style="display:none;"<?php $this->html( 'userlangattributes' ) ?>></div>
87 <div class="mw-topbox" id="siteSub"><?php $this->msg( 'tagline' ) ?></div>
88 <?php if ( $this->data['newtalk'] ) {
89 ?><div class="usermessage mw-topbox"><?php $this->html( 'newtalk' ) ?></div>
90 <?php } ?>
91 <?php if ( $this->data['sitenotice'] ) {
92 ?><div class="mw-topbox" id="siteNotice"><?php $this->html( 'sitenotice' ) ?></div>
93 <?php } ?>
94 </div>
96 <div id="contentSub"<?php $this->html( 'userlangattributes' ) ?>><?php $this->html( 'subtitle' ) ?></div>
98 <?php if ( $this->data['undelete'] ) { ?><div id="contentSub2"><?php $this->html( 'undelete' ) ?></div><?php } ?>
99 <div id="jump-to-nav"><?php $this->msg( 'jumpto' ) ?> <a href="#mw_portlets"><?php $this->msg( 'jumptonavigation' ) ?></a><?php $this->msg( 'comma-separator' ) ?><a href="#searchInput"><?php $this->msg( 'jumptosearch' ) ?></a></div>
101 <?php $this->html( 'bodytext' ) ?>
102 <div class='mw_clear'></div>
103 <?php if ( $this->data['catlinks'] ) { $this->html( 'catlinks' ); } ?>
104 <?php $this->html( 'dataAfterContent' ) ?>
105 </div><!-- mw_contentholder -->
106 </div><!-- mw_content -->
107 </div><!-- mw_contentwrapper -->
109 <div id="mw_portlets"<?php $this->html( "userlangattributes" ) ?>>
110 <h2><?php $this->msg( 'navigation-heading' ) ?></h2>
112 <!-- portlets -->
113 <?php $this->renderPortals( $this->data['sidebar'] ); ?>
115 </div><!-- mw_portlets -->
118 </div><!-- main -->
120 <div class="mw_clear"></div>
122 <!-- personal portlet -->
123 <div class="portlet" id="p-personal" role="navigation">
124 <h3><?php $this->msg( 'personaltools' ) ?></h3>
125 <div class="pBody">
126 <ul>
127 <?php foreach ( $this->getPersonalTools() as $key => $item ) { ?>
128 <?php echo $this->makeListItem( $key, $item ); ?>
130 <?php } ?>
131 </ul>
132 </div>
133 </div>
136 <!-- footer -->
137 <div id="footer" role="contentinfo"<?php $this->html( 'userlangattributes' ) ?>>
138 <ul id="f-list">
139 <?php
140 foreach ( $this->getFooterLinks( "flat" ) as $aLink ) {
141 if ( isset( $this->data[$aLink] ) && $this->data[$aLink] ) {
142 ?> <li id="<?php echo $aLink ?>"><?php $this->html( $aLink ) ?></li>
143 <?php }
146 </ul>
147 <?php
148 foreach ( $this->getFooterIcons( "nocopyright" ) as $blockName => $footerIcons ) { ?>
149 <div id="mw_<?php echo htmlspecialchars( $blockName ); ?>">
150 <?php
151 foreach ( $footerIcons as $icon ) { ?>
152 <?php echo $this->getSkin()->makeFooterIcon( $icon, 'withoutImage' ); ?>
154 <?php
155 } ?>
156 </div>
157 <?php
160 </div>
162 <?php $this->printTrail(); ?>
163 </body></html>
164 <?php
165 wfRestoreWarnings();
166 } // end of execute() method
167 } // end of class