X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=skins%2FVector.php;h=3479ba58f7941a2f2ec503f82e0a74fcb031ecc7;hb=25b3c477503a47d5b20023c5a07b336474a12749;hp=4fa5a65a2df75d07012729da25ad26baadd31613;hpb=cd110a89f2a66f2f12428d9159229cd6dec0d77a;p=lhc%2Fweb%2Fwiklou.git
diff --git a/skins/Vector.php b/skins/Vector.php
index 4fa5a65a2d..3479ba58f7 100644
--- a/skins/Vector.php
+++ b/skins/Vector.php
@@ -8,8 +8,9 @@
* @ingroup Skins
*/
-if( !defined( 'MEDIAWIKI' ) )
+if( !defined( 'MEDIAWIKI' ) ) {
die( -1 );
+}
/**
* SkinTemplate class for Vector skin
@@ -23,11 +24,11 @@ class SkinVector extends SkinTemplate {
/**
* 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 $wgStylePath;
-
+ global $wgLocalStylePath;
+
parent::initPage( $out );
// Append CSS which includes IE only behavior fixes for hover support -
@@ -35,31 +36,30 @@ class SkinVector extends SkinTemplate {
// wait for the CSS file to load before fetching the HTC file.
$out->addScript(
''
+ htmlspecialchars( $wgLocalStylePath ) .
+ "/{$this->stylename}/csshover.htc\")}"
);
}
/**
- * 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
- $out->addStyle( 'vector/main-rtl.css', 'screen', '', 'rtl' );
- $out->addStyle( 'vector/main-ltr.css', 'screen', '', 'ltr' );
+ $out->addStyle( "{$this->stylename}/main-rtl.css", 'screen', '', 'rtl' );
+ $out->addStyle( "{$this->stylename}/main-ltr.css", 'screen', '', 'ltr' );
// Add extra stylesheets
// THIS IS ONLY USEFUL FOR EXPERIMENTING WITH DIFFERNT STYLE OPTIONS! THIS WILL BE REMOVED IN THE NEAR FUTURE.
if ( is_array( $wgVectorExtraStyles ) ) {
foreach ( $wgVectorExtraStyles as $style ) {
- $out->addStyle( 'vector/' . $style, 'screen' );
+ $out->addStyle( "vector/$style", 'screen' );
}
}
}
@@ -70,7 +70,7 @@ class SkinVector extends SkinTemplate {
* @private
*/
function buildNavigationUrls() {
- global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest, $wgArticle, $wgStylePath;
+ global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest, $wgArticle;
global $wgDisableLangConversion, $wgVectorUseIconWatch;
wfProfileIn( __METHOD__ );
@@ -88,7 +88,6 @@ class SkinVector extends SkinTemplate {
// 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();
@@ -104,7 +103,6 @@ class SkinVector extends SkinTemplate {
} else {
$talkId = "{$subjectId}_talk";
}
- $currentId = $isTalk ? $talkId : $subjectId;
// Adds namespace links
$links['namespaces'][$subjectId] = $this->tabAction(
@@ -151,7 +149,7 @@ class SkinVector extends SkinTemplate {
? 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
@@ -163,7 +161,7 @@ class SkinVector extends SkinTemplate {
$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'
)
);
@@ -176,7 +174,7 @@ class SkinVector extends SkinTemplate {
'class' => ( $action == 'edit' ) ? 'selected' : false,
'text' => wfMsg( 'vector-view-viewsource' ),
'href' =>
- $this->mTitle->getLocalUrl( $this->editUrlOptions() )
+ $this->mTitle->getLocalURL( $this->editUrlOptions() )
);
}
wfProfileOut( __METHOD__ . '-edit' );
@@ -187,17 +185,17 @@ class SkinVector extends SkinTemplate {
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' ) ) {
@@ -208,7 +206,7 @@ class SkinVector extends SkinTemplate {
'class' => $this->mTitle->isSpecial( 'Movepage' ) ?
'selected' : false,
'text' => wfMsg( 'vector-action-move' ),
- 'href' => $moveTitle->getLocalUrl()
+ 'href' => $moveTitle->getLocalURL()
);
}
@@ -216,22 +214,22 @@ class SkinVector extends SkinTemplate {
$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' )
);
}
}
@@ -250,7 +248,7 @@ class SkinVector extends SkinTemplate {
array( 'parsemag' ),
$wgLang->formatNum( $n )
),
- 'href' => $undelTitle->getLocalUrl(
+ 'href' => $undelTitle->getLocalURL(
'target=' . urlencode( $this->thispage )
)
);
@@ -263,20 +261,20 @@ class SkinVector extends SkinTemplate {
) {
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' )
);
}
}
@@ -294,7 +292,7 @@ class SkinVector extends SkinTemplate {
// Checks if the user is logged in
if ( $this->loggedin ) {
if ( $wgVectorUseIconWatch ) {
- $class = 'icon ';
+ $class = 'icon';
$place = 'views';
} else {
$class = '';
@@ -304,7 +302,7 @@ class SkinVector extends SkinTemplate {
$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
@@ -368,7 +366,7 @@ class VectorTemplate extends QuickTemplate {
* Outputs the entire contents of the XHTML page
*/
public function execute() {
- global $wgRequest, $wgOut, $wgContLang;
+ global $wgRequest, $wgContLang;
$this->skin = $this->data['skin'];
$action = $wgRequest->getText( 'action' );
@@ -440,7 +438,15 @@ class VectorTemplate extends QuickTemplate {
'about',
'disclaimer',
),
+ 'icons' => array(
+ 'poweredbyico',
+ 'copyrightico',
+ ),
);
+ $footerlinksClasses = array(
+ 'icons' => array( 'noprint' )
+ );
+
// Reduce footer links down to only those which are being used
$validFooterLinks = array();
foreach( $footerlinks as $category => $links ) {
@@ -463,8 +469,8 @@ class VectorTemplate extends QuickTemplate {
// Output HTML Page
$this->html( 'headelement' );
?>
-
-
+
+
html('specialpageattributes') ?>>
@@ -480,7 +486,7 @@ class VectorTemplate extends QuickTemplate {
-
msg( 'tagline' ) ?>
+
msg( 'tagline' ) ?>
html('userlangattributes') ?>>html( 'subtitle' ) ?>
@@ -498,7 +504,7 @@ class VectorTemplate extends QuickTemplate {
data['showjumplinks'] ): ?>
@@ -522,7 +528,7 @@ class VectorTemplate extends QuickTemplate {
-
+
renderNavigation( 'PERSONAL' ); ?>
renderNavigation( array( 'NAMESPACES', 'VARIANTS' ) ); ?>
@@ -533,7 +539,7 @@ class VectorTemplate extends QuickTemplate {
-
+
@@ -544,7 +550,7 @@ class VectorTemplate extends QuickTemplate {
@@ -640,7 +638,7 @@ class VectorTemplate extends QuickTemplate {
data['language_urls'] as $langlink ): ?>
-
+
@@ -676,14 +674,14 @@ class VectorTemplate extends QuickTemplate {
* when UI is in RTL mode
*/
private function renderNavigation( $elements ) {
- global $wgContLang, $wgVectorUseSimpleSearch, $wgStylePath;
+ global $wgVectorUseSimpleSearch, $wgVectorShowVariantName, $wgUser;
// If only one element was given, wrap it in an array, allowing more
// flexible arguments
if ( !is_array( $elements ) ) {
$elements = array( $elements );
// If there's a series of elements, reverse them when in RTL mode
- } else if ( $wgContLang->isRTL() ) {
+ } else if ( wfUILang()->isRTL() ) {
$elements = array_reverse( $elements );
}
// Render elements
@@ -694,28 +692,33 @@ class VectorTemplate extends QuickTemplate {
?>
msg('namespaces') ?>
- data['namespace_urls'] ) ): ?>
html('userlangattributes') ?>>
data['namespace_urls'] as $key => $link ): ?>
- >>
+ >>
-
msg('views') ?>
- data['view_urls'] ) ): ?>
-
data['action_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
msg('actions') ?>
msg('personaltools') ?>
- data['personal_urls'] ) ): ?>
html('userlangattributes') ?>>
data['personal_urls'] as $key => $item): ?>
> class="">
-
html('userlangattributes') ?>>
msg( 'search' ) ?>