Merge "(bug 21660) "Pipe trick" full width commas (with test!)"
[lhc/web/wiklou.git] / skins / Modern.php
1 <?php
2 /**
3 * Modern skin, derived from monobook template.
4 *
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.
9 *
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.
14 *
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
19 *
20 * @todo document
21 * @file
22 * @ingroup Skins
23 */
24
25 if( !defined( 'MEDIAWIKI' ) )
26 die( -1 );
27
28 require( dirname(__FILE__) . '/MonoBook.php' );
29
30 /**
31 * Inherit main code from SkinTemplate, set the CSS and template filter.
32 * @todo document
33 * @ingroup Skins
34 */
35 class SkinModern extends SkinTemplate {
36 var $skinname = 'modern', $stylename = 'modern',
37 $template = 'ModernTemplate', $useHeadElement = true;
38
39 /**
40 * @param $out OutputPage
41 */
42 function setupSkinUserCss( OutputPage $out ){
43 parent::setupSkinUserCss( $out );
44 $out->addModuleStyles ('skins.modern');
45 }
46 }
47
48 /**
49 * @todo document
50 * @ingroup Skins
51 */
52 class ModernTemplate extends MonoBookTemplate {
53
54 /**
55 * Template filter callback for Modern skin.
56 * Takes an associative array of data set from a SkinTemplate-based
57 * class, and a wrapper for MediaWiki's localization database, and
58 * outputs a formatted page.
59 *
60 * @access private
61 */
62 function execute() {
63 // Suppress warnings to prevent notices about missing indexes in $this->data
64 wfSuppressWarnings();
65
66 $this->html( 'headelement' );
67 ?>
68
69 <!-- heading -->
70 <div id="mw_header"><h1 id="firstHeading"><span dir="auto"><?php $this->html('title') ?></span></h1></div>
71
72 <div id="mw_main">
73 <div id="mw_contentwrapper">
74 <!-- navigation portlet -->
75 <?php $this->cactions(); ?>
76
77 <!-- content -->
78 <div id="mw_content">
79 <!-- contentholder does nothing by default, but it allows users to style the text inside
80 the content area without affecting the meaning of 'em' in #mw_content, which is used
81 for the margins -->
82 <div id="mw_contentholder">
83 <div class='mw-topboxes'>
84 <div id="mw-js-message" style="display:none;"<?php $this->html('userlangattributes')?>></div>
85 <div class="mw-topbox" id="siteSub"><?php $this->msg('tagline') ?></div>
86 <?php if($this->data['newtalk'] ) {
87 ?><div class="usermessage mw-topbox"><?php $this->html('newtalk') ?></div>
88 <?php } ?>
89 <?php if($this->data['sitenotice']) {
90 ?><div class="mw-topbox" id="siteNotice"><?php $this->html('sitenotice') ?></div>
91 <?php } ?>
92 </div>
93
94 <div id="contentSub"<?php $this->html('userlangattributes') ?>><?php $this->html('subtitle') ?></div>
95
96 <?php if($this->data['undelete']) { ?><div id="contentSub2"><?php $this->html('undelete') ?></div><?php } ?>
97 <?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 } ?>
98
99 <?php $this->html('bodytext') ?>
100 <div class='mw_clear'></div>
101 <?php if($this->data['catlinks']) { $this->html('catlinks'); } ?>
102 <?php $this->html ('dataAfterContent') ?>
103 </div><!-- mw_contentholder -->
104 </div><!-- mw_content -->
105 </div><!-- mw_contentwrapper -->
106
107 <div id="mw_portlets"<?php $this->html("userlangattributes") ?>>
108
109 <!-- portlets -->
110 <?php $this->renderPortals( $this->data['sidebar'] ); ?>
111
112 </div><!-- mw_portlets -->
113
114
115 </div><!-- main -->
116
117 <div class="mw_clear"></div>
118
119 <!-- personal portlet -->
120 <div class="portlet" id="p-personal">
121 <h5><?php $this->msg('personaltools') ?></h5>
122 <div class="pBody">
123 <ul>
124 <?php foreach($this->getPersonalTools() as $key => $item) { ?>
125 <?php echo $this->makeListItem($key, $item); ?>
126
127 <?php } ?>
128 </ul>
129 </div>
130 </div>
131
132
133 <!-- footer -->
134 <div id="footer"<?php $this->html('userlangattributes') ?>>
135 <ul id="f-list">
136 <?php
137 foreach( $this->getFooterLinks("flat") as $aLink ) {
138 if( isset( $this->data[$aLink] ) && $this->data[$aLink] ) {
139 ?> <li id="<?php echo$aLink?>"><?php $this->html($aLink) ?></li>
140 <?php }
141 }
142 ?>
143 </ul>
144 <?php
145 foreach ( $this->getFooterIcons("nocopyright") as $blockName => $footerIcons ) { ?>
146 <div id="mw_<?php echo htmlspecialchars($blockName); ?>">
147 <?php
148 foreach ( $footerIcons as $icon ) { ?>
149 <?php echo $this->getSkin()->makeFooterIcon( $icon, 'withoutImage' ); ?>
150
151 <?php
152 } ?>
153 </div>
154 <?php
155 }
156 ?>
157 </div>
158
159 <?php $this->printTrail(); ?>
160 </body></html>
161 <?php
162 wfRestoreWarnings();
163 } // end of execute() method
164 } // end of class
165
166