Fix r80666: botched variable rename
[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 function setupSkinUserCss( OutputPage $out ){
25 // Do not call parent::setupSkinUserCss(), we have our own print style
26 $out->addStyle( 'common/shared.css', 'screen' );
27 $out->addStyle( 'modern/main.css', 'screen' );
28 $out->addStyle( 'modern/print.css', 'print' );
29 $out->addStyle( 'modern/rtl.css', 'screen', '', 'rtl' );
30 }
31 }
32
33 /**
34 * @todo document
35 * @ingroup Skins
36 */
37 class ModernTemplate extends MonoBookTemplate {
38 var $skin;
39 /**
40 * Template filter callback for Modern skin.
41 * Takes an associative array of data set from a SkinTemplate-based
42 * class, and a wrapper for MediaWiki's localization database, and
43 * outputs a formatted page.
44 *
45 * @access private
46 */
47 function execute() {
48 global $wgRequest;
49 $this->skin = $skin = $this->data['skin'];
50 $action = $wgRequest->getText( 'action' );
51
52 // Suppress warnings to prevent notices about missing indexes in $this->data
53 wfSuppressWarnings();
54
55 $this->html( 'headelement' );
56 ?>
57
58 <!-- heading -->
59 <div id="mw_header"><h1 id="firstHeading"><?php $this->html('title') ?></h1></div>
60
61 <div id="mw_main">
62 <div id="mw_contentwrapper">
63 <!-- navigation portlet -->
64 <div id="p-cactions" class="portlet">
65 <h5><?php $this->msg('views') ?></h5>
66 <div class="pBody">
67 <ul>
68 <?php foreach($this->data['content_actions'] as $key => $tab) {
69 echo '
70 <li id="' . Sanitizer::escapeId( "ca-$key" ) . '"';
71 if( $tab['class'] ) {
72 echo ' class="'.htmlspecialchars($tab['class']).'"';
73 }
74 echo'><a href="'.htmlspecialchars($tab['href']).'"';
75 if( isset($tab["tooltiponly"]) && $tab["tooltiponly"] ) {
76 echo $skin->tooltip( "ca-$key" );
77 } else {
78 echo $skin->tooltipAndAccesskey( "ca-$key" );
79 }
80 echo '>'.htmlspecialchars($tab['text']).'</a></li>';
81 } ?>
82 </ul>
83 </div>
84 </div>
85
86 <!-- content -->
87 <div id="mw_content">
88 <!-- contentholder does nothing by default, but it allows users to style the text inside
89 the content area without affecting the meaning of 'em' in #mw_content, which is used
90 for the margins -->
91 <div id="mw_contentholder" <?php $this->html("specialpageattributes") ?>>
92 <div class='mw-topboxes'>
93 <div id="mw-js-message" style="display:none;"<?php $this->html('userlangattributes')?>></div>
94 <div class="mw-topbox" id="siteSub"><?php $this->msg('tagline') ?></div>
95 <?php if($this->data['newtalk'] ) {
96 ?><div class="usermessage mw-topbox"><?php $this->html('newtalk') ?></div>
97 <?php } ?>
98 <?php if($this->data['sitenotice']) {
99 ?><div class="mw-topbox" id="siteNotice"><?php $this->html('sitenotice') ?></div>
100 <?php } ?>
101 </div>
102
103 <div id="contentSub"<?php $this->html('userlangattributes') ?>><?php $this->html('subtitle') ?></div>
104
105 <?php if($this->data['undelete']) { ?><div id="contentSub2"><?php $this->html('undelete') ?></div><?php } ?>
106 <?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 } ?>
107
108 <?php $this->html('bodytext') ?>
109 <div class='mw_clear'></div>
110 <?php if($this->data['catlinks']) { $this->html('catlinks'); } ?>
111 <?php $this->html ('dataAfterContent') ?>
112 </div><!-- mw_contentholder -->
113 </div><!-- mw_content -->
114 </div><!-- mw_contentwrapper -->
115
116 <div id="mw_portlets"<?php $this->html("userlangattributes") ?>>
117
118 <!-- portlets -->
119 <?php
120 $sidebar = $this->data['sidebar'];
121 if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true;
122 if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true;
123 if ( !isset( $sidebar['LANGUAGES'] ) ) $sidebar['LANGUAGES'] = true;
124
125 foreach ($sidebar as $boxName => $cont) {
126 if ( $boxName == 'SEARCH' ) {
127 $this->searchBox();
128 } elseif ( $boxName == 'TOOLBOX' ) {
129 $this->toolbox();
130 } elseif ( $boxName == 'LANGUAGES' ) {
131 $this->languageBox();
132 } else {
133 $this->customBox( $boxName, $cont );
134 }
135 }
136 ?>
137
138 </div><!-- mw_portlets -->
139
140
141 </div><!-- main -->
142
143 <div class="mw_clear"></div>
144
145 <!-- personal portlet -->
146 <div class="portlet" id="p-personal">
147 <h5><?php $this->msg('personaltools') ?></h5>
148 <div class="pBody">
149 <ul>
150 <?php foreach($this->getPersonalTools() as $key => $item) { ?>
151 <?php echo $this->makeListItem($key, $item); ?>
152
153 <?php } ?>
154 </ul>
155 </div>
156 </div>
157
158
159 <!-- footer -->
160 <div id="footer"<?php $this->html('userlangattributes') ?>>
161 <ul id="f-list">
162 <?php
163 foreach( $this->getFooterLinks("flat") as $aLink ) {
164 if( isset( $this->data[$aLink] ) && $this->data[$aLink] ) {
165 ?> <li id="<?php echo$aLink?>"><?php $this->html($aLink) ?></li>
166 <?php }
167 }
168 ?>
169 </ul>
170 <?php
171 foreach ( $this->getFooterIcons("nocopyright") as $blockName => $footerIcons ) { ?>
172 <div id="mw_<?php echo htmlspecialchars($blockName); ?>">
173 <?php
174 foreach ( $footerIcons as $icon ) { ?>
175 <?php echo $this->skin->makeFooterIcon( $icon, 'withoutImage' ); ?>
176
177 <?php
178 } ?>
179 </div>
180 <?php
181 }
182 ?>
183 </div>
184
185 <?php $this->printTrail(); ?>
186 </body></html>
187 <?php
188 wfRestoreWarnings();
189 } // end of execute() method
190 } // end of class
191
192