* @ingroup Skins
*/
-if( !defined( 'MEDIAWIKI' ) )
+if( !defined( 'MEDIAWIKI' ) ) {
die( -1 );
+}
/**
* SkinTemplate class for Vector skin
/**
* Initializes output page and sets up skin-specific parameters
- * @param object $out Output page object to initialize
+ * @param $out OutputPage object to initialize
*/
public function initPage( OutputPage $out ) {
global $wgLocalStylePath;
-
+
parent::initPage( $out );
// Append CSS which includes IE only behavior fixes for hover support -
// wait for the CSS file to load before fetching the HTC file.
$out->addScript(
'<!--[if lt IE 7]><style type="text/css">body{behavior:url("' .
- $wgLocalStylePath .
+ htmlspecialchars( $wgLocalStylePath ) .
'/vector/csshover.htc")}</style><![endif]-->'
);
}
/**
- * Load skin and user css files in the correct order
+ * Load skin and user CSS files in the correct order
* fixes bug 22916
- * @param object $out OutputPage object
+ * @param $out OutputPage object
*/
-
function setupSkinUserCss( OutputPage $out ){
global $wgVectorExtraStyles;
-
+
parent::setupSkinUserCss( $out );
// Append skin-specific styles
* @private
*/
function buildNavigationUrls() {
- global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest, $wgArticle, $wgStylePath;
+ global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest, $wgArticle;
global $wgDisableLangConversion, $wgVectorUseIconWatch;
wfProfileIn( __METHOD__ );
// Checks if page is some kind of content
if( $this->iscontent ) {
-
// Gets page objects for the related namespaces
$subjectPage = $this->mTitle->getSubjectPage();
$talkPage = $this->mTitle->getTalkPage();
? wfMsg( 'vector-view-edit' )
: wfMsg( 'vector-view-create' ),
'href' =>
- $this->mTitle->getLocalUrl( $this->editUrlOptions() )
+ $this->mTitle->getLocalURL( $this->editUrlOptions() )
);
// Checks if this is a current rev of talk page and we should show a new
// section link
$links['views']['addsection'] = array(
'class' => 'collapsible ' . ( $section == 'new' ? 'selected' : false ),
'text' => wfMsg( 'vector-action-addsection' ),
- 'href' => $this->mTitle->getLocalUrl(
+ 'href' => $this->mTitle->getLocalURL(
'action=edit§ion=new'
)
);
'class' => ( $action == 'edit' ) ? 'selected' : false,
'text' => wfMsg( 'vector-view-viewsource' ),
'href' =>
- $this->mTitle->getLocalUrl( $this->editUrlOptions() )
+ $this->mTitle->getLocalURL( $this->editUrlOptions() )
);
}
wfProfileOut( __METHOD__ . '-edit' );
if ( $this->mTitle->exists() ) {
// Adds history view link
$links['views']['history'] = array(
- 'class' => 'collapsible ' . ( ($action == 'history') ? 'selected' : false ),
+ 'class' => 'collapsible ' . ( ( $action == 'history' ) ? 'selected' : false ),
'text' => wfMsg( 'vector-view-history' ),
- 'href' => $this->mTitle->getLocalUrl( 'action=history' ),
+ 'href' => $this->mTitle->getLocalURL( 'action=history' ),
'rel' => 'archives',
);
if( $wgUser->isAllowed( 'delete' ) ) {
$links['actions']['delete'] = array(
- 'class' => ($action == 'delete') ? 'selected' : false,
+ 'class' => ( $action == 'delete' ) ? 'selected' : false,
'text' => wfMsg( 'vector-action-delete' ),
- 'href' => $this->mTitle->getLocalUrl( 'action=delete' )
+ 'href' => $this->mTitle->getLocalURL( 'action=delete' )
);
}
if ( $this->mTitle->quickUserCan( 'move' ) ) {
'class' => $this->mTitle->isSpecial( 'Movepage' ) ?
'selected' : false,
'text' => wfMsg( 'vector-action-move' ),
- 'href' => $moveTitle->getLocalUrl()
+ 'href' => $moveTitle->getLocalURL()
);
}
$this->mTitle->getNamespace() !== NS_MEDIAWIKI &&
$wgUser->isAllowed( 'protect' )
) {
- if ( !$this->mTitle->isProtected() ){
+ if ( !$this->mTitle->isProtected() ) {
$links['actions']['protect'] = array(
- 'class' => ($action == 'protect') ?
+ 'class' => ( $action == 'protect' ) ?
'selected' : false,
'text' => wfMsg( 'vector-action-protect' ),
'href' =>
- $this->mTitle->getLocalUrl( 'action=protect' )
+ $this->mTitle->getLocalURL( 'action=protect' )
);
} else {
$links['actions']['unprotect'] = array(
- 'class' => ($action == 'unprotect') ?
+ 'class' => ( $action == 'unprotect' ) ?
'selected' : false,
'text' => wfMsg( 'vector-action-unprotect' ),
'href' =>
- $this->mTitle->getLocalUrl( 'action=unprotect' )
+ $this->mTitle->getLocalURL( 'action=unprotect' )
);
}
}
array( 'parsemag' ),
$wgLang->formatNum( $n )
),
- 'href' => $undelTitle->getLocalUrl(
+ 'href' => $undelTitle->getLocalURL(
'target=' . urlencode( $this->thispage )
)
);
) {
if ( !$this->mTitle->getRestrictions( 'create' ) ) {
$links['actions']['protect'] = array(
- 'class' => ($action == 'protect') ?
+ 'class' => ( $action == 'protect' ) ?
'selected' : false,
'text' => wfMsg( 'vector-action-protect' ),
'href' =>
- $this->mTitle->getLocalUrl( 'action=protect' )
+ $this->mTitle->getLocalURL( 'action=protect' )
);
} else {
$links['actions']['unprotect'] = array(
- 'class' => ($action == 'unprotect') ?
+ 'class' => ( $action == 'unprotect' ) ?
'selected' : false,
'text' => wfMsg( 'vector-action-unprotect' ),
'href' =>
- $this->mTitle->getLocalUrl( 'action=unprotect' )
+ $this->mTitle->getLocalURL( 'action=unprotect' )
);
}
}
$links[$place][$mode] = array(
'class' => $class . ( ( $action == 'watch' || $action == 'unwatch' ) ? ' selected' : false ),
'text' => wfMsg( $mode ), // uses 'watch' or 'unwatch' message
- 'href' => $this->mTitle->getLocalUrl( 'action=' . $mode )
+ 'href' => $this->mTitle->getLocalURL( 'action=' . $mode )
);
}
// This is instead of SkinTemplateTabs - which uses a flat array
<?php if ( $this->data['showjumplinks'] ): ?>
<!-- jumpto -->
<div id="jump-to-nav">
- <?php $this->msg( 'jumpto' ) ?><a href="#head"><?php $this->msg( 'jumptonavigation' ) ?></a>,
+ <?php $this->msg( 'jumpto' ) ?> <a href="#head"><?php $this->msg( 'jumptonavigation' ) ?></a>,
<a href="#p-search"><?php $this->msg( 'jumptosearch' ) ?></a>
</div>
<!-- /jumpto -->
* when UI is in RTL mode
*/
private function renderNavigation( $elements ) {
- global $wgContLang, $wgVectorUseSimpleSearch, $wgVectorShowVariantName, $wgStylePath;
+ global $wgContLang, $wgVectorUseSimpleSearch, $wgVectorShowVariantName;
// If only one element was given, wrap it in an array, allowing more
// flexible arguments
?>
<div id="p-namespaces" class="vectorTabs<?php if ( count( $this->data['namespace_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
<h5><?php $this->msg('namespaces') ?></h5>
- <?php if ( count( $this->data['namespace_urls'] ) ): ?>
<ul<?php $this->html('userlangattributes') ?>>
<?php foreach ($this->data['namespace_urls'] as $key => $link ): ?>
<li <?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><span><?php echo htmlspecialchars( $link['text'] ) ?></span></a></li>
<?php endforeach; ?>
</ul>
- <?php endif; ?>
</div>
<?php
break;
<div id="p-variants" class="vectorMenu<?php if ( count( $this->data['variant_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
<?php if ( $wgVectorShowVariantName ): ?>
<h4>
- <?php foreach ($this->data['variant_urls'] as $key => $link ): ?>
+ <?php foreach ( $this->data['variant_urls'] as $key => $link ): ?>
<?php if ( stripos( $link['attributes'], 'selected' ) !== false ): ?>
<?php echo htmlspecialchars( $link['text'] ) ?>
<?php endif; ?>
<?php endif; ?>
<h5><span><?php $this->msg('variants') ?></span><a href="#"></a></h5>
<div class="menu">
- <?php if ( count( $this->data['variant_urls'] ) ): ?>
<ul<?php $this->html('userlangattributes') ?>>
- <?php foreach ($this->data['variant_urls'] as $key => $link ): ?>
+ <?php foreach ( $this->data['variant_urls'] as $key => $link ): ?>
<li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li>
<?php endforeach; ?>
</ul>
- <?php endif; ?>
</div>
</div>
<?php
?>
<div id="p-views" class="vectorTabs<?php if ( count( $this->data['view_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
<h5><?php $this->msg('views') ?></h5>
- <?php if ( count( $this->data['view_urls'] ) ): ?>
<ul<?php $this->html('userlangattributes') ?>>
- <?php foreach ($this->data['view_urls'] as $key => $link ): ?>
+ <?php foreach ( $this->data['view_urls'] as $key => $link ): ?>
<li<?php echo $link['attributes'] ?>><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'].'" />' : '<span>'.htmlspecialchars( $link['text'] ).'</span>') ?></a></li>
<?php endforeach; ?>
</ul>
- <?php endif; ?>
</div>
<?php
break;
<div id="p-cactions" class="vectorMenu<?php if ( count( $this->data['action_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
<h5><span><?php $this->msg('actions') ?></span><a href="#"></a></h5>
<div class="menu">
- <?php if ( count( $this->data['action_urls'] ) ): ?>
<ul<?php $this->html('userlangattributes') ?>>
<?php foreach ($this->data['action_urls'] as $key => $link ): ?>
<li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li>
<?php endforeach; ?>
</ul>
- <?php endif; ?>
</div>
</div>
<?php
?>
<div id="p-personal" class="<?php if ( count( $this->data['personal_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
<h5><?php $this->msg('personaltools') ?></h5>
- <?php if ( count( $this->data['personal_urls'] ) ): ?>
<ul<?php $this->html('userlangattributes') ?>>
<?php foreach($this->data['personal_urls'] as $key => $item): ?>
<li <?php echo $item['attributes'] ?>><a href="<?php echo htmlspecialchars($item['href']) ?>"<?php echo $item['key'] ?><?php if(!empty($item['class'])): ?> class="<?php echo htmlspecialchars($item['class']) ?>"<?php endif; ?>><?php echo htmlspecialchars($item['text']) ?></a></li>
<?php endforeach; ?>
</ul>
- <?php endif; ?>
</div>
<?php
break;
<input type='hidden' name="title" value="<?php $this->text( 'searchtitle' ) ?>"/>
<?php if ( $wgVectorUseSimpleSearch ): ?>
<div id="simpleSearch">
- <input id="searchInput" name="search" type="text" tabindex="1" <?php echo $this->skin->tooltipAndAccesskey( 'search' ); ?> <?php if( isset( $this->data['search'] ) ): ?> value="<?php $this->text( 'search' ) ?>"<?php endif; ?> />
- <button id="searchButton" type='submit' name='button' <?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?>> </button>
+ <input id="searchInput" name="search" type="text" <?php echo $this->skin->tooltipAndAccesskey( 'search' ); ?> <?php if( isset( $this->data['search'] ) ): ?> value="<?php $this->text( 'search' ) ?>"<?php endif; ?> />
+ <button id="searchButton" type='submit' name='button' <?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?>> </button>
</div>
<?php else: ?>
- <input id="searchInput" name="search" type="text" tabindex="1" <?php echo $this->skin->tooltipAndAccesskey( 'search' ); ?> <?php if( isset( $this->data['search'] ) ): ?> value="<?php $this->text( 'search' ) ?>"<?php endif; ?> />
+ <input id="searchInput" name="search" type="text" <?php echo $this->skin->tooltipAndAccesskey( 'search' ); ?> <?php if( isset( $this->data['search'] ) ): ?> value="<?php $this->text( 'search' ) ?>"<?php endif; ?> />
<input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg( 'searcharticle' ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-go' ); ?> />
<input type="submit" name="fulltext" class="searchButton" id="mw-searchButton" value="<?php $this->msg( 'searchbutton' ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?> />
<?php endif; ?>