r53029 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53028‎ | r53029 | r53030 >
Date:02:13, 10 July 2009
Author:simetrical
Status:ok
Tags:
Comment:
Finish cross-skin unification of <head>

Vector and Modern are now using $wgOut->headElement(), finishing the
work that r52864 started. -80 lines net.
Modified paths:
  • /trunk/phase3/skins/Modern.php (modified) (history)
  • /trunk/phase3/skins/MonoBook.php (modified) (history)
  • /trunk/phase3/skins/Vector.php (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/Vector.php
@@ -67,7 +67,7 @@
6868 * Outputs the entire contents of the XHTML page
6969 */
7070 public function execute() {
71 - global $wgRequest, $wgUseTwoButtonsSearchForm;
 71+ global $wgRequest, $wgUseTwoButtonsSearchForm, $wgOut;
7272
7373 $this->skin = $this->data['skin'];
7474 $action = $wgRequest->getText( 'action' );
@@ -159,63 +159,9 @@
160160 }
161161
162162 // Begin content output
163 -?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
164 -<html xmlns="<?php $this->text('xhtmldefaultnamespace') ?>" <?php foreach($this->data['xhtmlnamespaces'] as $tag => $ns): ?>xmlns:<?php echo "{$tag}=\"{$ns}\" "; ?><?php endforeach ?>xml:lang="<?php $this->text('lang') ?>" lang="<?php $this->text('lang') ?>" dir="<?php $this->text('dir') ?>">
165 - <head>
166 - <meta http-equiv="Content-Type" content="<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" />
167 - <title><?php $this->text('pagetitle') ?></title>
168 - <!-- headlinks -->
169 - <?php $this->html('headlinks') ?>
170 - <!-- /headlinks -->
171 - <!-- csslinks -->
172 - <?php $this->html('csslinks') ?>
173 - <!-- /csslinks -->
174 - <!-- IEFixes -->
175 - <!--[if lt IE 7]><script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath') ?>/common/IEFixes.js?<?php echo $GLOBALS['wgStyleVersion'] ?>"></script>
176 - <meta http-equiv="imagetoolbar" content="no" /><![endif]-->
177 - <style type="text/css">body{behavior:url("<?php $this->text('stylepath') ?>/vector/csshover.htc")}</style>
178 - <!-- /IEFixes -->
179 - <!-- globalVariablesScript -->
180 - <?php echo Skin::makeGlobalVariablesScript( $this->data ); ?>
181 - <!-- /globalVariablesScript -->
182 - <!-- wikibits -->
183 - <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath' ) ?>/common/wikibits.js?<?php echo $GLOBALS['wgStyleVersion'] ?>"><!-- wikibits js --></script>
184 - <!-- /wikibits -->
185 - <!-- headscripts -->
186 - <?php $this->html('headscripts') ?>
187 - <!-- /headscripts -->
188 - <?php if($this->data['jsvarurl']): ?>
189 - <!-- jsvarurl -->
190 - <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('jsvarurl') ?>"><!-- site js --></script>
191 - <!-- /jsvarurl -->
192 - <?php endif; ?>
193 - <?php if($this->data['pagecss']): ?>
194 - <!-- pagecss -->
195 - <style type="text/css"><?php $this->html('pagecss') ?></style>
196 - <!-- /pagecss -->
197 - <?php endif; ?>
198 - <?php if($this->data['usercss']): ?>
199 - <!-- usercss -->
200 - <style type="text/css"><?php $this->html('usercss') ?></style>
201 - <!-- /usercss -->
202 - <?php endif; ?>
203 - <?php if($this->data['userjs']): ?>
204 - <!-- userjs -->
205 - <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('userjs' ) ?>"></script>
206 - <!-- /userjs -->
207 - <?php endif; ?>
208 - <?php if($this->data['userjsprev']): ?>
209 - <!-- userjsprev -->
210 - <script type="<?php $this->text('jsmimetype') ?>"><?php $this->html('userjsprev') ?></script>
211 - <!-- /userjsprev -->
212 - <?php endif; ?>
213 - <?php if($this->data['trackbackhtml']): ?>
214 - <!-- trackbackhtml -->
215 - <?php echo $this->data['trackbackhtml']; ?>
216 - <!-- /trackbackhtml -->
217 - <?php endif; ?>
218 - </head>
219 - <body<?php if($this->data['body_ondblclick']): ?> ondblclick="<?php $this->text('body_ondblclick') ?>"<?php endif; ?> <?php if($this->data['body_onload']): ?> onload="<?php $this->text('body_onload') ?>"<?php endif; ?> class="mediawiki <?php $this->text('dir') ?> <?php $this->text('pageclass') ?> <?php $this->text('skinnameclass') ?>">
 163+
 164+ echo $wgOut->headElement( $this->skin );
 165+?> <body<?php if($this->data['body_ondblclick']): ?> ondblclick="<?php $this->text('body_ondblclick') ?>"<?php endif; ?> <?php if($this->data['body_onload']): ?> onload="<?php $this->text('body_onload') ?>"<?php endif; ?> class="mediawiki <?php $this->text('dir') ?> <?php $this->text('pageclass') ?> <?php $this->text('skinnameclass') ?>">
220166 <div id="page-base" class="noprint"></div>
221167 <div id="head-base" class="noprint"></div>
222168 <!-- content -->
Index: trunk/phase3/skins/MonoBook.php
@@ -72,6 +72,7 @@
7373 wfSuppressWarnings();
7474
7575 $path = htmlspecialchars( $wgStylePath );
 76+ # FIXME: What is this? Should it apply to all skins?
7677 $wgOut->addScript( <<<HTML
7778 <!--[if lt IE 7]><script type="$wgJsMimeType" src="$path/common/IEFixes.js?$wgStyleVersion"></script>
7879 <meta http-equiv="imagetoolbar" content="no" /><![endif]-->
Index: trunk/phase3/skins/Modern.php
@@ -56,48 +56,21 @@
5757 * @access private
5858 */
5959 function execute() {
60 - global $wgRequest;
 60+ global $wgRequest, $wgOut;
6161 $this->skin = $skin = $this->data['skin'];
6262 $action = $wgRequest->getText( 'action' );
6363
6464 // Suppress warnings to prevent notices about missing indexes in $this->data
6565 wfSuppressWarnings();
6666
67 -?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
68 -<html xmlns="<?php $this->text('xhtmldefaultnamespace') ?>" <?php
69 - foreach($this->data['xhtmlnamespaces'] as $tag => $ns) {
70 - ?>xmlns:<?php echo "{$tag}=\"{$ns}\" ";
71 - } ?>xml:lang="<?php $this->text('lang') ?>" lang="<?php $this->text('lang') ?>" dir="<?php $this->text('dir') ?>">
72 - <head>
73 - <meta http-equiv="Content-Type" content="<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" />
74 - <?php $this->html('headlinks') ?>
75 - <title><?php $this->text('pagetitle') ?></title>
76 - <?php $this->html('csslinks') ?>
77 - <!--[if lt IE 7]><meta http-equiv="imagetoolbar" content="no" /><![endif]-->
78 -
79 - <?php print Skin::makeGlobalVariablesScript( $this->data ); ?>
80 -
81 - <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath' ) ?>/common/wikibits.js?<?php echo $GLOBALS['wgStyleVersion'] ?>"><!-- wikibits js --></script>
82 - <!-- Head Scripts -->
83 -<?php $this->html('headscripts') ?>
84 -<?php if($this->data['jsvarurl' ]) { ?>
85 - <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('jsvarurl' ) ?>"><!-- site js --></script>
86 -<?php } ?>
87 -<?php if($this->data['pagecss' ]) { ?>
88 - <style type="text/css"><?php $this->html('pagecss' ) ?></style>
89 -<?php }
90 - if($this->data['usercss' ]) { ?>
91 - <style type="text/css"><?php $this->html('usercss' ) ?></style>
92 -<?php }
93 - if($this->data['userjs' ]) { ?>
94 - <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('userjs' ) ?>"></script>
95 -<?php }
96 - if($this->data['userjsprev']) { ?>
97 - <script type="<?php $this->text('jsmimetype') ?>"><?php $this->html('userjsprev') ?></script>
98 -<?php }
99 - if($this->data['trackbackhtml']) print $this->data['trackbackhtml']; ?>
100 - </head>
101 -<body<?php if($this->data['body_ondblclick']) { ?> ondblclick="<?php $this->text('body_ondblclick') ?>"<?php } ?>
 67+ $wgOut->addScript( <<<HTML
 68+<!--[if lt IE 7]><script type="$wgJsMimeType" src="$path/common/IEFixes.js?$wgStyleVersion"></script>
 69+ <meta http-equiv="imagetoolbar" content="no" /><![endif]-->
 70+HTML
 71+ );
 72+
 73+ echo $wgOut->headElement( $this->skin );
 74+?><body<?php if($this->data['body_ondblclick']) { ?> ondblclick="<?php $this->text('body_ondblclick') ?>"<?php } ?>
10275 <?php if($this->data['body_onload' ]) { ?> onload="<?php $this->text('body_onload') ?>"<?php } ?>
10376 class="mediawiki <?php $this->text('dir') ?> <?php $this->text('pageclass') ?> <?php $this->text('skinnameclass') ?>">
10477

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r52864Unify MonoBook <head> generation with legacy skins...simetrical21:49, 7 July 2009

Status & tagging log