Removed useless begin()/commit() calls as DBO_TRX is not on in cli mode.
[mediawiki.git] / skins / Modern.php
blob4211bb844d51f923b7dbbb455a25fe53ecd6374c
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 );
28 /**
29 * Inherit main code from SkinTemplate, set the CSS and template filter.
30 * @todo document
31 * @ingroup Skins
33 class SkinModern extends SkinTemplate {
34 var $skinname = 'modern', $stylename = 'modern',
35 $template = 'ModernTemplate', $useHeadElement = true;
37 /**
38 * @param $out OutputPage
40 function setupSkinUserCss( OutputPage $out ){
41 parent::setupSkinUserCss( $out );
42 $out->addModuleStyles ('skins.modern');
46 /**
47 * @todo document
48 * @ingroup Skins
50 class ModernTemplate extends MonoBookTemplate {
52 /**
53 * Template filter callback for Modern skin.
54 * Takes an associative array of data set from a SkinTemplate-based
55 * class, and a wrapper for MediaWiki's localization database, and
56 * outputs a formatted page.
58 * @access private
60 function execute() {
61 // Suppress warnings to prevent notices about missing indexes in $this->data
62 wfSuppressWarnings();
64 $this->html( 'headelement' );
67 <!-- heading -->
68 <div id="mw_header"><h1 id="firstHeading"><span dir="auto"><?php $this->html('title') ?></span></h1></div>
70 <div id="mw_main">
71 <div id="mw_contentwrapper">
72 <!-- navigation portlet -->
73 <?php $this->cactions(); ?>
75 <!-- content -->
76 <div id="mw_content">
77 <!-- contentholder does nothing by default, but it allows users to style the text inside
78 the content area without affecting the meaning of 'em' in #mw_content, which is used
79 for the margins -->
80 <div id="mw_contentholder" class="mw-body">
81 <div class='mw-topboxes'>
82 <div id="mw-js-message" style="display:none;"<?php $this->html('userlangattributes')?>></div>
83 <div class="mw-topbox" id="siteSub"><?php $this->msg('tagline') ?></div>
84 <?php if($this->data['newtalk'] ) {
85 ?><div class="usermessage mw-topbox"><?php $this->html('newtalk') ?></div>
86 <?php } ?>
87 <?php if($this->data['sitenotice']) {
88 ?><div class="mw-topbox" id="siteNotice"><?php $this->html('sitenotice') ?></div>
89 <?php } ?>
90 </div>
92 <div id="contentSub"<?php $this->html('userlangattributes') ?>><?php $this->html('subtitle') ?></div>
94 <?php if($this->data['undelete']) { ?><div id="contentSub2"><?php $this->html('undelete') ?></div><?php } ?>
95 <?php if($this->data['showjumplinks']) { ?><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><?php } ?>
97 <?php $this->html('bodytext') ?>
98 <div class='mw_clear'></div>
99 <?php if($this->data['catlinks']) { $this->html('catlinks'); } ?>
100 <?php $this->html ('dataAfterContent') ?>
101 </div><!-- mw_contentholder -->
102 </div><!-- mw_content -->
103 </div><!-- mw_contentwrapper -->
105 <div id="mw_portlets"<?php $this->html("userlangattributes") ?>>
107 <!-- portlets -->
108 <?php $this->renderPortals( $this->data['sidebar'] ); ?>
110 </div><!-- mw_portlets -->
113 </div><!-- main -->
115 <div class="mw_clear"></div>
117 <!-- personal portlet -->
118 <div class="portlet" id="p-personal">
119 <h5><?php $this->msg('personaltools') ?></h5>
120 <div class="pBody">
121 <ul>
122 <?php foreach($this->getPersonalTools() as $key => $item) { ?>
123 <?php echo $this->makeListItem($key, $item); ?>
125 <?php } ?>
126 </ul>
127 </div>
128 </div>
131 <!-- footer -->
132 <div id="footer"<?php $this->html('userlangattributes') ?>>
133 <ul id="f-list">
134 <?php
135 foreach( $this->getFooterLinks("flat") as $aLink ) {
136 if( isset( $this->data[$aLink] ) && $this->data[$aLink] ) {
137 ?> <li id="<?php echo$aLink?>"><?php $this->html($aLink) ?></li>
138 <?php }
141 </ul>
142 <?php
143 foreach ( $this->getFooterIcons("nocopyright") as $blockName => $footerIcons ) { ?>
144 <div id="mw_<?php echo htmlspecialchars($blockName); ?>">
145 <?php
146 foreach ( $footerIcons as $icon ) { ?>
147 <?php echo $this->getSkin()->makeFooterIcon( $icon, 'withoutImage' ); ?>
149 <?php
150 } ?>
151 </div>
152 <?php
155 </div>
157 <?php $this->printTrail(); ?>
158 </body></html>
159 <?php
160 wfRestoreWarnings();
161 } // end of execute() method
162 } // end of class