r72030 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72029‎ | r72030 | r72031 >
Date:16:17, 31 August 2010
Author:reedy
Status:deferred
Tags:
Comment:
Add missing static class variable

Add $wgArticleAssessmentPages, some rough limitation for what to include the rating stuff on, based on article id
Modified paths:
  • /trunk/extensions/ArticleAssessmentPilot/ArticleAssessmentPilot.hooks.php (modified) (history)
  • /trunk/extensions/ArticleAssessmentPilot/ArticleAssessmentPilot.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleAssessmentPilot/ArticleAssessmentPilot.php
@@ -38,4 +38,7 @@
3939 'version' => '0.1.0',
4040 'descriptionmsg' => 'articleassessment-desc',
4141 '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 @@
1818 array( 'src' => 'js/jquery.tipsy.js', 'version' => 1 ),
1919 array( 'src' => 'js/jquery.stars.js', 'version' => 1 ),
2020 );
21 -
2221
2322 private static $messages = array();
 23+ private static $scripts = array();
2424
2525 /* Static Functions */
2626 public static function schema() {
@@ -118,18 +118,22 @@
119119 public static function addMessages( $messages ) {
120120 self::$messages = array_merge( self::$messages, $messages );
121121 }
122 -
123 -
 122+
124123 public static function addCode( &$data, $skin ) {
125124 $title = $skin->getTitle();
126125
127 - // check if this page should have the form
128 -
129126 // Chances are we only want to be rating Mainspace, right?
130127 if ( $title->getNamespace() !== NS_MAIN ) {
131128 return true;
132129 }
133130
 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+
134138 // write the form
135139
136140 // if user has no cookie, set cookie

Status & tagging log