r85126 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85125‎ | r85126 | r85127 >
Date:15:18, 1 April 2011
Author:ialex
Status:deferred
Tags:
Comment:
Include the CSS file from the special page instead of using SkinTemplateSetupPageCss hook
Modified paths:
  • /trunk/extensions/Vote/Vote.page.php (modified) (history)
  • /trunk/extensions/Vote/Vote.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Vote/Vote.php
@@ -41,17 +41,3 @@
4242
4343 $wgAvailableRights[] = 'vote';
4444 $wgAvailableRights[] = 'voteadmin';
45 -
46 -$wgHooks['SkinTemplateSetupPageCss'][] = 'efVoteCss';
47 -
48 -/**
49 - * Add extra CSS to the skin
50 - */
51 -function efVoteCss( &$css ) {
52 - global $wgTitle;
53 - if ( $wgTitle->isSpecial( 'Vote' ) ) {
54 - $file = dirname( __FILE__ ) . '/Vote.css';
55 - $css .= "/*<![CDATA[*/\n" . htmlspecialchars( file_get_contents( $file ) ) . "\n/*]]>*/";
56 - }
57 - return true;
58 -}
Index: trunk/extensions/Vote/Vote.page.php
@@ -25,10 +25,12 @@
2626 * @param $mode Mixed: parameter passed to the page or null
2727 */
2828 public function execute( $mode ) {
29 - global $wgOut, $wgUser;
 29+ global $wgOut, $wgUser, $wgExtensionAssetsPath;
3030
3131 $this->setHeaders();
3232 $this->user = $wgUser;
 33+ $wgOut->addExtensionStyle( "$wgExtensionAssetsPath/Vote/Vote.css" );
 34+
3335 if ( strtolower( $mode ) == 'results' ) {
3436 if ( $wgUser->isAllowed( 'voteadmin' ) )
3537 $this->showResults();

Status & tagging log