Partial revert to r94024
[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 <?php if($this->data['printfooter']) { ?><div class="printfooter"><?php $this->html('printfooter'); ?></div><?php } ?>
92 <?php $this->html('debughtml'); ?>
93 <div class='mw_clear'></div>
94 <?php if($this->data['catlinks']) { $this->html('catlinks'); } ?>
95 <?php $this->html ('dataAfterContent') ?>
96 </div><!-- mw_contentholder -->
97 </div><!-- mw_content -->
98 </div><!-- mw_contentwrapper -->
99
100 <div id="mw_portlets"<?php $this->html("userlangattributes") ?>>
101
102 <!-- portlets -->
103 <?php $this->renderPortals( $this->data['sidebar'] ); ?>
104
105 </div><!-- mw_portlets -->
106
107
108 </div><!-- main -->
109
110 <div class="mw_clear"></div>
111
112 <!-- personal portlet -->
113 <div class="portlet" id="p-personal">
114 <h5><?php $this->msg('personaltools') ?></h5>
115 <div class="pBody">
116 <ul>
117 <?php foreach($this->getPersonalTools() as $key => $item) { ?>
118 <?php echo $this->makeListItem($key, $item); ?>
119
120 <?php } ?>
121 </ul>
122 </div>
123 </div>
124
125
126 <!-- footer -->
127 <div id="footer"<?php $this->html('userlangattributes') ?>>
128 <ul id="f-list">
129 <?php
130 foreach( $this->getFooterLinks("flat") as $aLink ) {
131 if( isset( $this->data[$aLink] ) && $this->data[$aLink] ) {
132 ?> <li id="<?php echo$aLink?>"><?php $this->html($aLink) ?></li>
133 <?php }
134 }
135 ?>
136 </ul>
137 <?php
138 foreach ( $this->getFooterIcons("nocopyright") as $blockName => $footerIcons ) { ?>
139 <div id="mw_<?php echo htmlspecialchars($blockName); ?>">
140 <?php
141 foreach ( $footerIcons as $icon ) { ?>
142 <?php echo $this->skin->makeFooterIcon( $icon, 'withoutImage' ); ?>
143
144 <?php
145 } ?>
146 </div>
147 <?php
148 }
149 ?>
150 </div>
151
152 <?php $this->printTrail(); ?>
153 </body></html>
154 <?php
155 wfRestoreWarnings();
156 } // end of execute() method
157 } // end of class
158
159