static function skinPreferences( $user, &$defaultPreferences ) {
## Skin #####################################
+ global $wgLang, $wgAllowUserCss, $wgAllowUserJs;
+
$defaultPreferences['skin'] =
array(
'type' => 'radio',
'section' => 'rendering/skin',
);
+ # Create links to user CSS/JS pages for all skins
+ # This code is basically copied from generateSkinOptions(). It'd
+ # be nice to somehow merge this back in there to avoid redundancy.
+ if( $wgAllowUserCss || $wgAllowUserJs ) {
+ $sk = $user->getSkin();
+ $linkTools = array();
+ if( $wgAllowUserCss ) {
+ $cssPage = Title::makeTitleSafe( NS_USER, $user->getName() . '/common.css' );
+ $linkTools[] = $sk->link( $cssPage, wfMsgHtml( 'prefs-custom-css' ) );
+ }
+ if( $wgAllowUserJs ) {
+ $jsPage = Title::makeTitleSafe( NS_USER, $user->getName() . '/common.js' );
+ $linkTools[] = $sk->link( $jsPage, wfMsgHtml( 'prefs-custom-js' ) );
+ }
+ $defaultPreferences['commoncssjs'] =
+ array(
+ 'type' => 'info',
+ 'raw' => true,
+ 'default' => $wgLang->pipeList( $linkTools ),
+ 'label-message' => 'prefs-common-css-js',
+ 'section' => 'rendering/skin',
+ );
+ }
+
$selectedSkin = $user->getOption( 'skin' );
if ( in_array( $selectedSkin, array( 'cologneblue', 'standard' ) ) ) {
global $wgLang;
'prefs-files' => 'Files',
'prefs-custom-css' => 'Custom CSS',
'prefs-custom-js' => 'Custom JS',
+'prefs-common-css-js' => 'Shared CSS/JS for all skins:',
'prefs-reset-intro' => 'You can use this page to reset your preferences to the site defaults.
This cannot be undone.',
'prefs-emailconfirm-label' => 'E-mail confirmation:',
'prefs-files' => 'Tiedostot',
'prefs-custom-css' => 'Käyttäjäkohtainen CSS-tyylisivu',
'prefs-custom-js' => 'Käyttäjäkohtainen JavaScript-sivu',
+'prefs-common-css-js' => 'Yhteiset CSS/JS-sivut kaikille ulkoasuille',
'prefs-reset-intro' => 'Voit käyttää tätä sivua palauttaaksesi kaikki asetuksesi sivuston oletusasetuksiin. Tätä ei voi kumota.',
'prefs-emailconfirm-label' => 'Sähköpostin varmistus',
'prefs-textboxsize' => 'Muokkauskentän koko',