Remove unnecessary break statement after return statement.
[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 * 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 // Suppress warnings to prevent notices about missing indexes in $this->data
49 wfSuppressWarnings();
50
51 $this->html( 'headelement' );
52 ?>
53
54 <!-- heading -->
55 <div id="mw_header"><h1 id="firstHeading"><span dir="auto"><?php $this->html('title') ?></span></h1></div>
56
57 <div id="mw_main">
58 <div id="mw_contentwrapper">
59 <!-- navigation portlet -->
60 <?php $this->cactions(); ?>
61
62 <!-- content -->
63 <div id="mw_content">
64 <!-- contentholder does nothing by default, but it allows users to style the text inside
65 the content area without affecting the meaning of 'em' in #mw_content, which is used
66 for the margins -->
67 <div id="mw_contentholder">
68 <div class='mw-topboxes'>
69 <div id="mw-js-message" style="display:none;"<?php $this->html('userlangattributes')?>></div>
70 <div class="mw-topbox" id="siteSub"><?php $this->msg('tagline') ?></div>
71 <?php if($this->data['newtalk'] ) {
72 ?><div class="usermessage mw-topbox"><?php $this->html('newtalk') ?></div>
73 <?php } ?>
74 <?php if($this->data['sitenotice']) {
75 ?><div class="mw-topbox" id="siteNotice"><?php $this->html('sitenotice') ?></div>
76 <?php } ?>
77 </div>
78
79 <div id="contentSub"<?php $this->html('userlangattributes') ?>><?php $this->html('subtitle') ?></div>
80
81 <?php if($this->data['undelete']) { ?><div id="contentSub2"><?php $this->html('undelete') ?></div><?php } ?>
82 <?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 } ?>
83
84 <?php $this->html('bodytext') ?>
85 <div class='mw_clear'></div>
86 <?php if($this->data['catlinks']) { $this->html('catlinks'); } ?>
87 <?php $this->html ('dataAfterContent') ?>
88 </div><!-- mw_contentholder -->
89 </div><!-- mw_content -->
90 </div><!-- mw_contentwrapper -->
91
92 <div id="mw_portlets"<?php $this->html("userlangattributes") ?>>
93
94 <!-- portlets -->
95 <?php $this->renderPortals( $this->data['sidebar'] ); ?>
96
97 </div><!-- mw_portlets -->
98
99
100 </div><!-- main -->
101
102 <div class="mw_clear"></div>
103
104 <!-- personal portlet -->
105 <div class="portlet" id="p-personal">
106 <h5><?php $this->msg('personaltools') ?></h5>
107 <div class="pBody">
108 <ul>
109 <?php foreach($this->getPersonalTools() as $key => $item) { ?>
110 <?php echo $this->makeListItem($key, $item); ?>
111
112 <?php } ?>
113 </ul>
114 </div>
115 </div>
116
117
118 <!-- footer -->
119 <div id="footer"<?php $this->html('userlangattributes') ?>>
120 <ul id="f-list">
121 <?php
122 foreach( $this->getFooterLinks("flat") as $aLink ) {
123 if( isset( $this->data[$aLink] ) && $this->data[$aLink] ) {
124 ?> <li id="<?php echo$aLink?>"><?php $this->html($aLink) ?></li>
125 <?php }
126 }
127 ?>
128 </ul>
129 <?php
130 foreach ( $this->getFooterIcons("nocopyright") as $blockName => $footerIcons ) { ?>
131 <div id="mw_<?php echo htmlspecialchars($blockName); ?>">
132 <?php
133 foreach ( $footerIcons as $icon ) { ?>
134 <?php echo $this->getSkin()->makeFooterIcon( $icon, 'withoutImage' ); ?>
135
136 <?php
137 } ?>
138 </div>
139 <?php
140 }
141 ?>
142 </div>
143
144 <?php $this->printTrail(); ?>
145 </body></html>
146 <?php
147 wfRestoreWarnings();
148 } // end of execute() method
149 } // end of class
150
151