r46152 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46151‎ | r46152 | r46153 >
Date:17:49, 24 January 2009
Author:aaron
Status:ok (Comments)
Tags:todo 
Comment:
Only show css/js links for selected skin
Modified paths:
  • /trunk/phase3/includes/specials/SpecialPreferences.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialPreferences.php
@@ -868,14 +868,18 @@
869869 $checked = $skinkey == $this->mSkin ? ' checked="checked"' : '';
870870 $mplink = htmlspecialchars( $mptitle->getLocalURL( "useskin=$skinkey" ) );
871871 $previewlink = "(<a target='_blank' href=\"$mplink\">$previewtext</a>)";
872 - $cssPage = Title::makeTitleSafe( NS_USER, $wgUser->getName().'/'.$skinkey.'.css' );
873 - $jsPage = Title::makeTitleSafe( NS_USER, $wgUser->getName().'/'.$skinkey.'.js' );
874 - $customCSS = $sk->makeLinkObj( $cssPage, wfMsgHtml('prefs-custom-css') );
875 - $customJS = $sk->makeLinkObj( $jsPage, wfMsgHtml('prefs-custom-js') );
 872+ $extraLinks = '';
 873+ if( $skinkey == $this->mSkin ) {
 874+ $cssPage = Title::makeTitleSafe( NS_USER, $wgUser->getName().'/'.$skinkey.'.css' );
 875+ $jsPage = Title::makeTitleSafe( NS_USER, $wgUser->getName().'/'.$skinkey.'.js' );
 876+ $customCSS = $sk->makeLinkObj( $cssPage, wfMsgHtml('prefs-custom-css') );
 877+ $customJS = $sk->makeLinkObj( $jsPage, wfMsgHtml('prefs-custom-js') );
 878+ $extraLinks = " ($customCSS) ($customJS)";
 879+ }
876880 if( $skinkey == $wgDefaultSkin )
877881 $sn .= ' (' . wfMsg( 'default' ) . ')';
878882 $wgOut->addHTML( "<input type='radio' name='wpSkin' id=\"wpSkin$skinkey\" value=\"$skinkey\"$checked />
879 - <label for=\"wpSkin$skinkey\">{$sn}</label> $previewlink ($customCSS) ($customJS)<br />\n" );
 883+ <label for=\"wpSkin$skinkey\">{$sn}</label> $previewlink{$extraLinks}<br />\n" );
880884 }
881885 $wgOut->addHTML( "</fieldset>\n\n" );
882886 }

Comments

#Comment by Brion VIBBER (talk | contribs)   23:10, 26 January 2009

This would make it a bit tricky to get at things when using another skin (say, because your customized CSS ate your normal skin and you're poking to another temporarily)

#Comment by Aaron Schulz (talk | contribs)   03:19, 27 January 2009
#Comment by Aaron Schulz (talk | contribs)   03:19, 27 January 2009

s/contradict

#Comment by Aaron Schulz (talk | contribs)   03:16, 27 January 2009

Fixme -> todo: non blocker

Status & tagging log