<?php
/**
- * Vector - Branch of MonoBook which has many usability improvements and
- * somewhat cleaner code.
+ * Vector - Modern version of MonoBook with fresh look and many usability
+ * improvements.
*
* @todo document
* @file
*/
class SkinVector extends SkinTemplate {
- /* Functions */
var $skinname = 'vector', $stylename = 'vector',
$template = 'VectorTemplate', $useHeadElement = true;
* @param $out OutputPage object to initialize
*/
public function initPage( OutputPage $out ) {
- global $wgLocalStylePath;
+ global $wgLocalStylePath, $wgRequest;
parent::initPage( $out );
-
+
// Append CSS which includes IE only behavior fixes for hover support -
// this is better than including this in a CSS fille since it doesn't
// wait for the CSS file to load before fetching the HTC file.
- $out->addScript(
+ $min = $wgRequest->getFuzzyBool( 'debug' ) ? '' : '.min';
+ $out->addHeadItem( 'csshover',
'<!--[if lt IE 7]><style type="text/css">body{behavior:url("' .
htmlspecialchars( $wgLocalStylePath ) .
- "/{$this->stylename}/csshover.htc\")}</style><![endif]-->"
+ "/{$this->stylename}/csshover{$min}.htc\")}</style><![endif]-->"
);
}
/* Members */
/**
- * @var Cached skin object
+ * @var Skin Cached skin object
*/
var $skin;
/* Functions */
/**
- * Outputs the entire contents of the XHTML page
+ * Outputs the entire contents of the (X)HTML page
*/
public function execute() {
- global $wgRequest, $wgLang, $wgVectorUseIconWatch;
+ global $wgLang, $wgVectorUseIconWatch;
$this->skin = $this->data['skin'];
- $action = $wgRequest->getText( 'action' );
// Build additional attributes for navigation urls
//$nav = $this->skin->buildNavigationUrls();
$nav = $this->data['content_navigation'];
if ( $wgVectorUseIconWatch ) {
- $mode = $this->skin->mTitle->userIsWatching() ? 'unwatch' : 'watch';
- $nav['views'][$mode] = $nav['actions'][$mode];
- $nav['views'][$mode]['class'] = rtrim('icon ' . $nav['views'][$mode]['class'], ' ');
- $nav['views'][$mode]['primary'] = true;
- unset($nav['actions'][$mode]);
+ $mode = $this->skin->getTitle()->userIsWatching() ? 'unwatch' : 'watch';
+ if ( isset($nav['actions'][$mode]) ) {
+ $nav['views'][$mode] = $nav['actions'][$mode];
+ $nav['views'][$mode]['class'] = rtrim('icon ' . $nav['views'][$mode]['class'], ' ');
+ $nav['views'][$mode]['primary'] = true;
+ unset($nav['actions'][$mode]);
+ }
}
-
+
+ $xmlID = '';
foreach ( $nav as $section => $links ) {
foreach ( $links as $key => $link ) {
if ( $section == "views" && !(isset($link["primary"]) && $link["primary"]) ) {
<!-- /firstHeading -->
<!-- bodyContent -->
<div id="bodyContent">
+ <?php if ( $this->data['isarticle'] ): ?>
<!-- tagline -->
<div id="siteSub"><?php $this->msg( 'tagline' ) ?></div>
<!-- /tagline -->
+ <?php endif; ?>
<!-- subtitle -->
<div id="contentSub"<?php $this->html('userlangattributes') ?>><?php $this->html( 'subtitle' ) ?></div>
<!-- /subtitle -->
<div style="clear:both"></div>
</div>
<!-- /footer -->
- <?php $this->html( 'bottomscripts' ); /* JS call to runBodyOnloadHook */ ?>
<!-- fixalpha -->
<script type="<?php $this->text('jsmimetype') ?>"> if ( window.isMSIE55 ) fixalpha(); </script>
<!-- /fixalpha -->
- <?php $this->html( 'reporttime' ) ?>
- <?php if ( $this->data['debug'] ): ?>
- <!-- Debug output: <?php $this->text( 'debug' ); ?> -->
- <?php endif; ?>
+ <?php $this->printTrail(); ?>
+
</body>
</html>
<?php
}
?>
<div class="portal" id='<?php echo Sanitizer::escapeId( "p-$name" ) ?>'<?php echo $this->skin->tooltip( 'p-' . $name ) ?>>
- <h5<?php $this->html('userlangattributes') ?>><?php $out = wfMsg( $msg ); if ( wfEmptyMsg( $msg, $out ) ) echo htmlspecialchars( $msg ); else echo htmlspecialchars( $out ); ?></h5>
+ <h5<?php $this->html('userlangattributes') ?>><?php $out = wfMsg( $msg ); if ( wfEmptyMsg( $msg ) ) echo htmlspecialchars( $msg ); else echo htmlspecialchars( $out ); ?></h5>
<div class="body">
<?php
if ( is_array( $content ) ): ?>
break;
case 'VIEWS':
?>
-<div id="p-views" class="vectorTabs<?php if ( count( $this->data['view_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
+<div id="p-views" class="vectorTabs<?php if ( count( $this->data['view_urls'] ) == 0 ) { echo ' emptyPortlet'; } ?>">
<h5><?php $this->msg('views') ?></h5>
<ul<?php $this->html('userlangattributes') ?>>
<?php foreach ( $this->data['view_urls'] as $link ): ?>
- <li<?php echo $link['attributes'] ?>><span><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo (array_key_exists('img',$link) ? '<img src="'.$link['img'].'" alt="'.$link['text'].'" />' : htmlspecialchars( $link['text'] ) ) ?></a></span></li>
+ <li<?php echo $link['attributes'] ?>><span><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php
+ // $link['text'] can be undefined - bug 27764
+ if ( array_key_exists( 'text', $link ) ) {
+ echo array_key_exists( 'img', $link ) ? '<img src="' . $link['img'] . '" alt="' . $link['text'] . '" />' : htmlspecialchars( $link['text'] );
+ }
+ ?></a></span></li>
<?php endforeach; ?>
</ul>
</div>