Merge "Remove useless variable from Title::newFromText()"
[mediawiki.git] / skins / Modern.php
blobd1d11c36a2087aa05a0e03261e5b798a51246671
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 public $skinname = 'modern';
36 public $stylename = 'modern';
37 public $template = 'ModernTemplate';
38 public $useHeadElement = true;
40 /**
41 * @param OutputPage $out
43 function setupSkinUserCss( OutputPage $out ) {
44 parent::setupSkinUserCss( $out );
45 $out->addModuleStyles( 'skins.modern' );
49 /**
50 * @todo document
51 * @ingroup Skins
53 class ModernTemplate extends MonoBookTemplate {
55 /**
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.
61 * @access private
63 function execute() {
64 // Suppress warnings to prevent notices about missing indexes in $this->data
65 wfSuppressWarnings();
67 $this->html( 'headelement' );
70 <!-- heading -->
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>
76 <div id="mw_main">
77 <div id="mw_contentwrapper">
78 <!-- navigation portlet -->
79 <?php $this->cactions(); ?>
81 <!-- content -->
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
85 for the margins -->
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>
91 <?php
92 if ( $this->data['newtalk'] ) {
94 <div class="usermessage mw-topbox"><?php $this->html( 'newtalk' ) ?></div>
95 <?php
98 <?php
99 if ( $this->data['sitenotice'] ) {
101 <div class="mw-topbox" id="siteNotice"><?php $this->html( 'sitenotice' ) ?></div>
102 <?php
105 </div>
107 <div id="contentSub"<?php
108 $this->html( 'userlangattributes' )
109 ?>><?php
110 $this->html( 'subtitle' )
111 ?></div>
113 <?php
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>
124 </div>
126 <?php $this->html( 'bodytext' ) ?>
127 <div class='mw_clear'></div>
128 <?php
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>
141 <!-- portlets -->
142 <?php $this->renderPortals( $this->data['sidebar'] ); ?>
144 </div><!-- mw_portlets -->
147 </div><!-- main -->
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>
155 <div class="pBody">
156 <ul>
157 <?php
158 foreach ( $this->getPersonalTools() as $key => $item ) {
160 <?php echo $this->makeListItem( $key, $item ); ?>
162 <?php
165 </ul>
166 </div>
167 </div>
170 <!-- footer -->
171 <div id="footer" role="contentinfo"<?php $this->html( 'userlangattributes' ) ?>>
172 <ul id="f-list">
173 <?php
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>
178 <?php
182 </ul>
183 <?php
184 foreach ( $this->getFooterIcons( "nocopyright" ) as $blockName => $footerIcons ) {
186 <div id="mw_<?php echo htmlspecialchars( $blockName ); ?>">
187 <?php
188 foreach ( $footerIcons as $icon ) {
190 <?php echo $this->getSkin()->makeFooterIcon( $icon, 'withoutImage' ); ?>
192 <?php
193 } ?>
194 </div>
195 <?php
198 </div>
200 <?php $this->printTrail(); ?>
202 </body>
203 </html>
204 <?php
205 wfRestoreWarnings();
206 } // end of execute() method
207 } // end of class