Revert r85324 (making links grey for rev-del'd info). Per CR: grey is a bad color...
[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 * @var Skin
41 */
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.
48 *
49 * @access private
50 */
51 function execute() {
52 $this->skin = $skin = $this->data['skin'];
53
54 // Suppress warnings to prevent notices about missing indexes in $this->data
55 wfSuppressWarnings();
56
57 $this->html( 'headelement' );
58 ?>
59
60 <!-- heading -->
61 <div id="mw_header"><h1 id="firstHeading"><?php $this->html('title') ?></h1></div>
62
63 <div id="mw_main">
64 <div id="mw_contentwrapper">
65 <!-- navigation portlet -->
66 <?php $this->cactions( $skin ); ?>
67
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>
84
85 <div id="contentSub"<?php $this->html('userlangattributes') ?>><?php $this->html('subtitle') ?></div>
86
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 } ?>
89
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 -->
99
100 <div id="mw_portlets"<?php $this->html("userlangattributes") ?>>
101
102 <!-- portlets -->
103 <?php
104 $sidebar = $this->data['sidebar'];
105 if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true;
106 if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true;
107 if ( !isset( $sidebar['LANGUAGES'] ) ) $sidebar['LANGUAGES'] = true;
108
109 foreach ($sidebar as $boxName => $cont) {
110 if ( $boxName == 'SEARCH' ) {
111 $this->searchBox();
112 } elseif ( $boxName == 'TOOLBOX' ) {
113 $this->toolbox();
114 } elseif ( $boxName == 'LANGUAGES' ) {
115 $this->languageBox();
116 } else {
117 $this->customBox( $boxName, $cont );
118 }
119 }
120 ?>
121
122 </div><!-- mw_portlets -->
123
124
125 </div><!-- main -->
126
127 <div class="mw_clear"></div>
128
129 <!-- personal portlet -->
130 <div class="portlet" id="p-personal">
131 <h5><?php $this->msg('personaltools') ?></h5>
132 <div class="pBody">
133 <ul>
134 <?php foreach($this->getPersonalTools() as $key => $item) { ?>
135 <?php echo $this->makeListItem($key, $item); ?>
136
137 <?php } ?>
138 </ul>
139 </div>
140 </div>
141
142
143 <!-- footer -->
144 <div id="footer"<?php $this->html('userlangattributes') ?>>
145 <ul id="f-list">
146 <?php
147 foreach( $this->getFooterLinks("flat") as $aLink ) {
148 if( isset( $this->data[$aLink] ) && $this->data[$aLink] ) {
149 ?> <li id="<?php echo$aLink?>"><?php $this->html($aLink) ?></li>
150 <?php }
151 }
152 ?>
153 </ul>
154 <?php
155 foreach ( $this->getFooterIcons("nocopyright") as $blockName => $footerIcons ) { ?>
156 <div id="mw_<?php echo htmlspecialchars($blockName); ?>">
157 <?php
158 foreach ( $footerIcons as $icon ) { ?>
159 <?php echo $this->skin->makeFooterIcon( $icon, 'withoutImage' ); ?>
160
161 <?php
162 } ?>
163 </div>
164 <?php
165 }
166 ?>
167 </div>
168
169 <?php $this->printTrail(); ?>
170 </body></html>
171 <?php
172 wfRestoreWarnings();
173 } // end of execute() method
174 } // end of class
175
176