r79347 didn't update other callers to mungeQuery(), so let's just take the easy way...
[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 # We don't want to give the watch tab an accesskey if the
76 # page is being edited, because that conflicts with the
77 # accesskey on the watch checkbox. We also don't want to
78 # give the edit tab an accesskey, because that's fairly su-
79 # perfluous and conflicts with an accesskey (Ctrl-E) often
80 # used for editing in Safari.
81 if( in_array( $action, array( 'edit', 'submit' ) )
82 && in_array( $key, array( 'edit', 'watch', 'unwatch' ))) {
83 echo $skin->tooltip( "ca-$key" );
84 } else {
85 echo $skin->tooltipAndAccesskey( "ca-$key" );
86 }
87 echo '>'.htmlspecialchars($tab['text']).'</a></li>';
88 } ?>
89 </ul>
90 </div>
91 </div>
92
93 <!-- content -->
94 <div id="mw_content">
95 <!-- contentholder does nothing by default, but it allows users to style the text inside
96 the content area without affecting the meaning of 'em' in #mw_content, which is used
97 for the margins -->
98 <div id="mw_contentholder" <?php $this->html("specialpageattributes") ?>>
99 <div class='mw-topboxes'>
100 <div id="mw-js-message" style="display:none;"<?php $this->html('userlangattributes')?>></div>
101 <div class="mw-topbox" id="siteSub"><?php $this->msg('tagline') ?></div>
102 <?php if($this->data['newtalk'] ) {
103 ?><div class="usermessage mw-topbox"><?php $this->html('newtalk') ?></div>
104 <?php } ?>
105 <?php if($this->data['sitenotice']) {
106 ?><div class="mw-topbox" id="siteNotice"><?php $this->html('sitenotice') ?></div>
107 <?php } ?>
108 </div>
109
110 <div id="contentSub"<?php $this->html('userlangattributes') ?>><?php $this->html('subtitle') ?></div>
111
112 <?php if($this->data['undelete']) { ?><div id="contentSub2"><?php $this->html('undelete') ?></div><?php } ?>
113 <?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 } ?>
114
115 <?php $this->html('bodytext') ?>
116 <div class='mw_clear'></div>
117 <?php if($this->data['catlinks']) { $this->html('catlinks'); } ?>
118 <?php $this->html ('dataAfterContent') ?>
119 </div><!-- mw_contentholder -->
120 </div><!-- mw_content -->
121 </div><!-- mw_contentwrapper -->
122
123 <div id="mw_portlets"<?php $this->html("userlangattributes") ?>>
124
125 <!-- portlets -->
126 <?php
127 $sidebar = $this->data['sidebar'];
128 if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true;
129 if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true;
130 if ( !isset( $sidebar['LANGUAGES'] ) ) $sidebar['LANGUAGES'] = true;
131
132 foreach ($sidebar as $boxName => $cont) {
133 if ( $boxName == 'SEARCH' ) {
134 $this->searchBox();
135 } elseif ( $boxName == 'TOOLBOX' ) {
136 $this->toolbox();
137 } elseif ( $boxName == 'LANGUAGES' ) {
138 $this->languageBox();
139 } else {
140 $this->customBox( $boxName, $cont );
141 }
142 }
143 ?>
144
145 </div><!-- mw_portlets -->
146
147
148 </div><!-- main -->
149
150 <div class="mw_clear"></div>
151
152 <!-- personal portlet -->
153 <div class="portlet" id="p-personal">
154 <h5><?php $this->msg('personaltools') ?></h5>
155 <div class="pBody">
156 <ul>
157 <?php foreach($this->getPersonalTools() as $key => $item) { ?>
158 <?php echo $this->makeListItem($key, $item); ?>
159
160 <?php } ?>
161 </ul>
162 </div>
163 </div>
164
165
166 <!-- footer -->
167 <div id="footer"<?php $this->html('userlangattributes') ?>>
168 <ul id="f-list">
169 <?php
170 foreach( $this->getFooterLinks("flat") as $aLink ) {
171 if( isset( $this->data[$aLink] ) && $this->data[$aLink] ) {
172 ?> <li id="<?php echo$aLink?>"><?php $this->html($aLink) ?></li>
173 <?php }
174 }
175 ?>
176 </ul>
177 <?php
178 foreach ( $this->getFooterIcons("nocopyright") as $blockName => $footerIcons ) { ?>
179 <div id="mw_<?php echo htmlspecialchars($blockName); ?>">
180 <?php
181 foreach ( $footerIcons as $icon ) { ?>
182 <?php echo $this->skin->makeFooterIcon( $icon, 'withoutImage' ); ?>
183
184 <?php
185 } ?>
186 </div>
187 <?php
188 }
189 ?>
190 </div>
191
192 <?php $this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?>
193 <?php $this->html('reporttime') ?>
194 <?php if ( $this->data['debug'] ): ?>
195 <!-- Debug output:
196 <?php $this->text( 'debug' ); ?>
197 -->
198 <?php endif; ?>
199 </body></html>
200 <?php
201 wfRestoreWarnings();
202 } // end of execute() method
203 } // end of class
204
205