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