r84541 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84540‎ | r84541 | r84542 >
Date:17:49, 22 March 2011
Author:ialex
Status:deferred
Tags:
Comment:
Add the css file directly from the special page instead of using the SkinTemplateSetupPageCss hook
Modified paths:
  • /trunk/extensions/ProfileMonitor/ProfileMonitor.class.php (modified) (history)
  • /trunk/extensions/ProfileMonitor/ProfileMonitor.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ProfileMonitor/ProfileMonitor.class.php
@@ -15,7 +15,7 @@
1616 }
1717
1818 public function execute( $par ) {
19 - global $wgOut, $wgRequest;
 19+ global $wgOut, $wgRequest, $wgExtensionAssetsPath;
2020
2121 wfLoadExtensionMessages( 'ProfileMonitor' );
2222
@@ -23,6 +23,8 @@
2424
2525 $process = $wgRequest->getText( 'process' );
2626 $wild = $wgRequest->getCheck( 'wildcard' );
 27+
 28+ $wgOut->addExtensionStyle( $wgExtensionAssetsPath . '/ProfileMonitor/ProfileMonitor.css' );
2729 $wgOut->addHTML( $this->makeSearchForm( $process, $wild ) );
2830
2931 if( $wgRequest->getCheck( 'submit' ) ) {
Index: trunk/extensions/ProfileMonitor/ProfileMonitor.php
@@ -9,7 +9,6 @@
1010 * @author Rob Church <robchur@gmail.com>
1111 */
1212
13 -$wgExtensionFunctions[] = 'efProfileMonitor';
1413 $wgExtensionCredits['specialpage'][] = array(
1514 'path' => __FILE__,
1615 'name' => 'ProfileMonitor',
@@ -23,16 +22,3 @@
2423 $wgExtensionAliasesFiles['ProfileMonitor'] = $dir . 'ProfileMonitor.alias.php';
2524 $wgAutoloadClasses['ProfileMonitor'] = $dir . 'ProfileMonitor.class.php';
2625 $wgSpecialPages['Profiling'] = 'ProfileMonitor';
27 -
28 -function efProfileMonitor() {
29 - $wgHooks['SkinTemplateSetupPageCss'][] = 'efProfileMonitorCss';
30 -}
31 -
32 -function efProfileMonitorCss( &$css ) {
33 - global $wgTitle;
34 - if( $wgTitle->isSpecial( 'Profiling' ) ) {
35 - $file = dirname( __FILE__ ) . '/ProfileMonitor.css';
36 - $css .= "/*<![CDATA[*/\n" . htmlspecialchars( file_get_contents( $file ) ) . "\n/*]]>*/";
37 - }
38 - return true;
39 -}

Status & tagging log