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