Follow up for r38587: Thanks to VasilievVV for pointing out that not every wiki allow...
authorRaimond Spekking <raymond@users.mediawiki.org>
Mon, 4 Aug 2008 19:33:14 +0000 (19:33 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Mon, 4 Aug 2008 19:33:14 +0000 (19:33 +0000)
includes/specials/SpecialPreferences.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index b08e774..a04c3e8 100644 (file)
@@ -814,11 +814,17 @@ class PreferencesForm {
 
                # Skin
                #
+               global $wgAllowUserCss, $wgAllowUserJs;
                $wgOut->addHTML(
                        Xml::openElement( 'fieldset' ) .
-                       Xml::element( 'legend', null, wfMsg( 'skin' ) ) . "\n" .
-                       wfMsg( 'skin-header' ) . "<br /><br />"
+                       Xml::element( 'legend', null, wfMsg( 'skin' ) ) . "\n"
                );
+               $wgOut->addWikiMsg( 'skin-header' );
+               if ( $wgAllowUserCss )
+                       $wgOut->addWikiMsg( 'skin-header-css' );
+
+               if ( $wgAllowUserJs )
+                       $wgOut->addWikiMsg( 'skin-header-js' );
 
                $mptitle = Title::newMainPage();
                $previewtext = wfMsg('skin-preview');
@@ -837,14 +843,21 @@ class PreferencesForm {
                        if ( in_array( $skinkey, $wgSkipSkins ) ) {
                                continue;
                        }
-                       $pageCSS = Title::makeTitle( NS_USER, $wgUser->getName() . '/' . $skinkey . '.css' );
-                       $pageJS = Title::makeTitle( NS_USER, $wgUser->getName() . '/' . $skinkey . '.js' );
-                       $linkToCSS = $sk->link( $pageCSS, wfMsg( 'skin-link-to-css' ) );
-                       $linkToJS = $sk->link( $pageJS, wfMsg( 'skin-link-to-js' ) );
+
+                       $linkToCSS = $linkToJS = '';
+                       if ( $wgAllowUserCss ) {
+                               $pageCSS = Title::makeTitle( NS_USER, $wgUser->getName() . '/' . $skinkey . '.css' );
+                               $linkToCSS = ' | ' . $sk->link( $pageCSS, wfMsg( 'skin-link-to-css' ) );
+                       }
+                       if ( $wgAllowUserJs ) {
+                               $pageJS = Title::makeTitle( NS_USER, $wgUser->getName() . '/' . $skinkey . '.js' );
+                               $linkToJS = ' | ' . $sk->link( $pageJS, wfMsg( 'skin-link-to-js' ) );
+                       }
+
                        $checked = $skinkey == $this->mSkin ? ' checked="checked"' : '';
 
                        $mplink = htmlspecialchars($mptitle->getLocalURL("useskin=$skinkey"));
-                       $linkLine = " (<a target='_blank' href=\"$mplink\">$previewtext</a> | " . $linkToCSS . " | " . $linkToJS . ')';
+                       $linkLine = " (<a target='_blank' href=\"$mplink\">$previewtext</a>" . $linkToCSS . $linkToJS . ')';
                        if( $skinkey == $wgDefaultSkin ) {
                                $sn .= ' (' . wfMsg( 'default' ) . ')';
                        }
index bbd7a6f..dfd91a6 100644 (file)
@@ -1403,7 +1403,9 @@ Note that their indexes of {{SITENAME}} content may be out of date.',
 'qbsettings-floatingright' => 'Floating right',
 'changepassword'           => 'Change password',
 'skin'                     => 'Skin',
-'skin-header'              => 'Available skins. You can customize each skin with the associated cascading style sheet (CSS) and JavaScript pages.',
+'skin-header'              => 'Available skins.',
+'skin-header-css'          => '* With the associated cascading style sheets (CSS) pages you can customize each skin.',
+'skin-header-js'           => '* With the associated JavaScript (JS) pages you can add own scripts to each skin.',
 'skin-preview'             => 'Preview',
 'skin-link-to-css'         => 'associated CSS',
 'skin-link-to-js'          => 'associated JS',
index c8bd6e1..c9e5b27 100644 (file)
@@ -752,6 +752,8 @@ $wgMessageStructure = array(
                'changepassword',
                'skin',
                'skin-header',
+               'skin-header-css',
+               'skin-header-js'
                'skin-preview',
                'skin-link-to-css',
                'skin-link-to-js',