Add link to css/js subpage in preferences
authorAaron Schulz <aaron@users.mediawiki.org>
Sat, 24 Jan 2009 05:28:31 +0000 (05:28 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sat, 24 Jan 2009 05:28:31 +0000 (05:28 +0000)
includes/specials/SpecialPreferences.php
languages/messages/MessagesEn.php

index b57cc68..f138f86 100644 (file)
@@ -864,13 +864,18 @@ class PreferencesForm {
                                }
                        }
                        asort($validSkinNames);
-                       foreach ($validSkinNames as $skinkey => $sn ) {
+                       foreach$validSkinNames as $skinkey => $sn ) {
                                $checked = $skinkey == $this->mSkin ? ' checked="checked"' : '';
                                $mplink = htmlspecialchars( $mptitle->getLocalURL( "useskin=$skinkey" ) );
                                $previewlink = "(<a target='_blank' href=\"$mplink\">$previewtext</a>)";
+                               $cssPage = Title::makeTitleSafe( NS_USER, $wgUser->getName().'/'.$skinkey.'.css' );
+                               $jsPage = Title::makeTitleSafe( NS_USER, $wgUser->getName().'/'.$skinkey.'.js' );
+                               $customCSS = $sk->makeLinkObj( $cssPage, wfMsgHtml('prefs-custom-css') );
+                               $customJS = $sk->makeLinkObj( $jsPage, wfMsgHtml('prefs-custom-js') ); 
                                if( $skinkey == $wgDefaultSkin )
                                        $sn .= ' (' . wfMsg( 'default' ) . ')';
-                               $wgOut->addHTML( "<input type='radio' name='wpSkin' id=\"wpSkin$skinkey\" value=\"$skinkey\"$checked /> <label for=\"wpSkin$skinkey\">{$sn}</label> $previewlink<br />\n" );
+                               $wgOut->addHTML( "<input type='radio' name='wpSkin' id=\"wpSkin$skinkey\" value=\"$skinkey\"$checked /> 
+                                       <label for=\"wpSkin$skinkey\">{$sn}</label> $previewlink ($customCSS) ($customJS)<br />\n" );
                        }
                        $wgOut->addHTML( "</fieldset>\n\n" );
                }
index 991a9a8..de51ac9 100644 (file)
@@ -1574,6 +1574,8 @@ please see math/README to configure.',
 'defaultns'                 => 'Search in these namespaces by default:',
 'default'                   => 'default',
 'files'                     => 'Files',
+'prefs-custom-css'          => 'Custom CSS',
+'prefs-custom-js'           => 'Custom JS',
 
 # User rights
 'userrights'                     => 'User rights management', # Not used as normal message but as header for the special page itself