Index: trunk/extensions/ArticleAssessmentPilot/ArticleAssessmentPilot.php |
— | — | @@ -38,4 +38,7 @@ |
39 | 39 | 'version' => '0.1.0', |
40 | 40 | 'descriptionmsg' => 'articleassessment-desc', |
41 | 41 | 'url' => 'http://www.mediawiki.org/wiki/Extension:ArticleAssessmentPilot' |
42 | | -); |
\ No newline at end of file |
| 42 | +); |
| 43 | + |
| 44 | +//Array of page id's for which to include the rating stuffs on |
| 45 | +$wgArticleAssessmentPages = array(); |
\ No newline at end of file |
Index: trunk/extensions/ArticleAssessmentPilot/ArticleAssessmentPilot.hooks.php |
— | — | @@ -17,9 +17,9 @@ |
18 | 18 | array( 'src' => 'js/jquery.tipsy.js', 'version' => 1 ), |
19 | 19 | array( 'src' => 'js/jquery.stars.js', 'version' => 1 ), |
20 | 20 | ); |
21 | | - |
22 | 21 | |
23 | 22 | private static $messages = array(); |
| 23 | + private static $scripts = array(); |
24 | 24 | |
25 | 25 | /* Static Functions */ |
26 | 26 | public static function schema() { |
— | — | @@ -118,18 +118,22 @@ |
119 | 119 | public static function addMessages( $messages ) { |
120 | 120 | self::$messages = array_merge( self::$messages, $messages ); |
121 | 121 | } |
122 | | - |
123 | | - |
| 122 | + |
124 | 123 | public static function addCode( &$data, $skin ) { |
125 | 124 | $title = $skin->getTitle(); |
126 | 125 | |
127 | | - // check if this page should have the form |
128 | | - |
129 | 126 | // Chances are we only want to be rating Mainspace, right? |
130 | 127 | if ( $title->getNamespace() !== NS_MAIN ) { |
131 | 128 | return true; |
132 | 129 | } |
133 | 130 | |
| 131 | + global $wgArticleAssessmentPages; |
| 132 | + |
| 133 | + // check if this page should have the form |
| 134 | + if ( !array_key_exists( $title->getArticleId() , $wgArticleAssessmentPages ) ) { |
| 135 | + return true; |
| 136 | + } |
| 137 | + |
134 | 138 | // write the form |
135 | 139 | |
136 | 140 | // if user has no cookie, set cookie |