byteLimit/byteLength improvements:
[mediawiki.git] / skins / Modern.php
blob9b85064f3b426e56535c4311488366e66c618f7e
1 <?php
2 /**
3 * Modern skin, derived from monobook template.
5 * @todo document
6 * @file
7 * @ingroup Skins
8 */
10 if( !defined( 'MEDIAWIKI' ) )
11 die( -1 );
13 require( dirname(__FILE__) . '/MonoBook.php' );
15 /**
16 * Inherit main code from SkinTemplate, set the CSS and template filter.
17 * @todo document
18 * @ingroup Skins
20 class SkinModern extends SkinTemplate {
21 var $skinname = 'modern', $stylename = 'modern',
22 $template = 'ModernTemplate', $useHeadElement = true;
24 /**
25 * @param $out OutputPage
27 function setupSkinUserCss( OutputPage $out ){
28 parent::setupSkinUserCss( $out );
29 $out->addModuleStyles ('skins.modern');
33 /**
34 * @todo document
35 * @ingroup Skins
37 class ModernTemplate extends MonoBookTemplate {
39 /**
40 * @var Skin
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.
49 * @access private
51 function execute() {
52 $this->skin = $skin = $this->data['skin'];
54 // Suppress warnings to prevent notices about missing indexes in $this->data
55 wfSuppressWarnings();
57 $this->html( 'headelement' );
60 <!-- heading -->
61 <div id="mw_header"><h1 id="firstHeading"><?php $this->html('title') ?></h1></div>
63 <div id="mw_main">
64 <div id="mw_contentwrapper">
65 <!-- navigation portlet -->
66 <?php $this->cactions( $skin ); ?>
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" <?php $this->html("specialpageattributes") ?>>
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>
85 <div id="contentSub"<?php $this->html('userlangattributes') ?>><?php $this->html('subtitle') ?></div>
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 } ?>
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 -->
100 <div id="mw_portlets"<?php $this->html("userlangattributes") ?>>
102 <!-- portlets -->
103 <?php $this->renderPortals( $this->data['sidebar'] ); ?>
105 </div><!-- mw_portlets -->
108 </div><!-- main -->
110 <div class="mw_clear"></div>
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); ?>
120 <?php } ?>
121 </ul>
122 </div>
123 </div>
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 }
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' ); ?>
144 <?php
145 } ?>
146 </div>
147 <?php
150 </div>
152 <?php $this->printTrail(); ?>
153 </body></html>
154 <?php
155 wfRestoreWarnings();
156 } // end of execute() method
157 } // end of class