From 2832bc3292cde83f51c455161e3739272e077326 Mon Sep 17 00:00:00 2001 From: Tim Laqua Date: Wed, 19 Dec 2007 02:15:35 +0000 Subject: [PATCH] Only hooking BeforePageDisplay when special page is executed - no reason to include CSS otherwise. --- ContributionScores.php | 1 - ContributionScores_body.php | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ContributionScores.php b/ContributionScores.php index 7555cae..0664976 100644 --- a/ContributionScores.php +++ b/ContributionScores.php @@ -24,7 +24,6 @@ $contribScoreReports = null; $wgAutoloadClasses['ContributionScores'] = CONTRIBUTIONSCORES_PATH . '/ContributionScores_body.php'; $wgSpecialPages['ContributionScores'] = 'ContributionScores'; -$wgHooks['BeforePageDisplay'][] = 'efContributionScores_addHeadScripts'; if( version_compare( $wgVersion, '1.11', '>=' ) ) { $wgExtensionMessagesFiles['ContributionScores'] = CONTRIBUTIONSCORES_PATH . '/ContributionScores.i18n.php'; diff --git a/ContributionScores_body.php b/ContributionScores_body.php index d454c65..8ffb09b 100644 --- a/ContributionScores_body.php +++ b/ContributionScores_body.php @@ -107,7 +107,9 @@ class ContributionScores extends IncludableSpecialPage } function execute( $par ) { - global $wgRequest, $wgVersion, $wgOut; + global $wgRequest, $wgVersion, $wgOut, $wgHooks; + + $wgHooks['BeforePageDisplay'][] = 'efContributionScores_addHeadScripts'; if( version_compare( $wgVersion, '1.11', '>=' ) ) wfLoadExtensionMessages( 'ContributionScores' );