dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a920d0b
)
Consistency tweak: coalesce tool links with pipes instead of a lot () () ()
author
Raimond Spekking
<raymond@users.mediawiki.org>
Thu, 8 Oct 2009 19:35:24 +0000
(19:35 +0000)
committer
Raimond Spekking
<raymond@users.mediawiki.org>
Thu, 8 Oct 2009 19:35:24 +0000
(19:35 +0000)
includes/Preferences.php
patch
|
blob
|
history
diff --git
a/includes/Preferences.php
b/includes/Preferences.php
index
196b83b
..
072f92d
100644
(file)
--- a/
includes/Preferences.php
+++ b/
includes/Preferences.php
@@
-1002,8
+1002,12
@@
class Preferences {
}
}
}
}
+ /**
+ * @param object $user The user object
+ * @return array Text/links to display as key; $skinkey as value
+ */
static function generateSkinOptions( $user ) {
static function generateSkinOptions( $user ) {
- global $wgDefaultSkin;
+ global $wgDefaultSkin
, $wgLang, $wgAllowUserCss, $wgAllowUserJs
;
$ret = array();
$mptitle = Title::newMainPage();
$ret = array();
$mptitle = Title::newMainPage();
@@
-1024,23
+1028,28
@@
class Preferences {
$sk = $user->getSkin();
foreach( $validSkinNames as $skinkey => $sn ) {
$sk = $user->getSkin();
foreach( $validSkinNames as $skinkey => $sn ) {
+ $linkTools = array();
+
+ # Mark the default skin
+ if( $skinkey == $wgDefaultSkin ) {
+ $linkTools[] = wfMsgHtml( 'default' );
+ }
+
+ # Create preview link
$mplink = htmlspecialchars( $mptitle->getLocalURL( "useskin=$skinkey" ) );
$mplink = htmlspecialchars( $mptitle->getLocalURL( "useskin=$skinkey" ) );
- $
previewlink = "(<a target='_blank' href=\"$mplink\">$previewtext</a>)
";
- $extraLinks = '';
- global $wgAllowUserCss, $wgAllowUserJs;
+ $
linkTools[] = "<a target='_blank' href=\"$mplink\">$previewtext</a>
";
+
+ # Create links to user CSS/JS pages
if( $wgAllowUserCss ) {
$cssPage = Title::makeTitleSafe( NS_USER, $user->getName() . '/' . $skinkey . '.css' );
if( $wgAllowUserCss ) {
$cssPage = Title::makeTitleSafe( NS_USER, $user->getName() . '/' . $skinkey . '.css' );
- $customCSS = $sk->link( $cssPage, wfMsgHtml( 'prefs-custom-css' ) );
- $extraLinks .= " ($customCSS)";
+ $linkTools[] = $sk->link( $cssPage, wfMsgHtml( 'prefs-custom-css' ) );
}
if( $wgAllowUserJs ) {
$jsPage = Title::makeTitleSafe( NS_USER, $user->getName() . '/' . $skinkey . '.js' );
}
if( $wgAllowUserJs ) {
$jsPage = Title::makeTitleSafe( NS_USER, $user->getName() . '/' . $skinkey . '.js' );
- $customJS = $sk->link( $jsPage, wfMsgHtml( 'prefs-custom-js' ) );
- $extraLinks .= " ($customJS)";
+ $linkTools[] = $sk->link( $jsPage, wfMsgHtml( 'prefs-custom-js' ) );
}
}
- if( $skinkey == $wgDefaultSkin )
- $sn .= ' (' . wfMsgHtml( 'default' ) . ')';
- $display = "$sn $previewlink{$extraLinks}";
+
+ $display = $sn . ' ' . wfMsg( 'parentheses', $wgLang->pipeList( $linkTools ) );
$ret[$display] = $skinkey;
}
$ret[$display] = $skinkey;
}