Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js |
— | — | @@ -56,9 +56,10 @@ |
57 | 57 | // {{{ Properties |
58 | 58 | |
59 | 59 | /** |
60 | | - * Temporary -- this will need to come from the config. |
| 60 | + * Whether we're in debug mode. We'll pull the config value on load, but |
| 61 | + * default it to false for now. |
61 | 62 | */ |
62 | | - $.articleFeedbackv5.debug = true; |
| 63 | + $.articleFeedbackv5.debug = false; |
63 | 64 | |
64 | 65 | /** |
65 | 66 | * The bucket ID is the variation of the Article Feedback form chosen for this |
— | — | @@ -361,14 +362,13 @@ |
362 | 363 | /** |
363 | 364 | * Only certain users can see the expertise checkboxes and email |
364 | 365 | */ |
365 | | - showOptions: 'show' === mw.user.bucket( 'ext.articleFeedback-options', mw.config.get( 'wgArticleFeedbackv5Options' ) ), |
| 366 | + showOptions: 'show' === mw.user.bucket( 'ext.articleFeedbackv5-options', mw.config.get( 'wgArticleFeedbackv5Options' ) ), |
366 | 367 | |
367 | 368 | /** |
368 | | - * Whether we need to load the aggregate ratings the next time the |
369 | | - * button is clicked. This is initially set to true, turned to |
370 | | - * false after the first time, then turned back to true on form |
371 | | - * submission, in case the user wants to go back and see the ratings with |
372 | | - * theirs included. |
| 369 | + * Whether we need to load the aggregate ratings the next time the button is |
| 370 | + * clicked. This is initially set to true, turned to false after the first |
| 371 | + * time, then turned back to true on form submission, in case the user wants |
| 372 | + * to go back and see the ratings with theirs included. |
373 | 373 | */ |
374 | 374 | loadAggregate: true, |
375 | 375 | |
— | — | @@ -1074,10 +1074,14 @@ |
1075 | 1075 | var $block = $( block_tpl ); |
1076 | 1076 | |
1077 | 1077 | // Fill in the link |
1078 | | - $block.find( '.articleFeedbackv5-edit-link' ) |
1079 | | - .attr( 'href', mw.config.get( 'wgArticlePath' ).replace( |
1080 | | - '$1', mw.config.get( 'wgArticleFeedbackv5WhatsThisPage' ) |
1081 | | - ) ); |
| 1078 | + $block.find( '.articleFeedbackv5-edit-cta-link' ) |
| 1079 | + .attr( |
| 1080 | + 'href', |
| 1081 | + mw.config.get( 'wgScript' ) + '?' + $.param( { |
| 1082 | + 'title': mw.config.get( 'wgPageName' ), |
| 1083 | + 'action': 'edit' |
| 1084 | + } ) |
| 1085 | + ); |
1082 | 1086 | |
1083 | 1087 | return $block; |
1084 | 1088 | } |
— | — | @@ -1109,7 +1113,8 @@ |
1110 | 1114 | $.articleFeedbackv5.config = config; |
1111 | 1115 | // Has the user already submitted ratings for this page at this revision? |
1112 | 1116 | $.articleFeedbackv5.alreadySubmitted = $.cookie( $.articleFeedbackv5.prefix( 'submitted' ) ) === 'true'; |
1113 | | - // Go ahead and load the form |
| 1117 | + // Are we in debug mode? |
| 1118 | + $.articleFeedbackv5.debug = mw.config.get( 'wgArticleFeedbackv5Debug' ) ? true : false; |
1114 | 1119 | // When the tool is visible, load the form |
1115 | 1120 | $.articleFeedbackv5.$holder.appear( function () { |
1116 | 1121 | $.articleFeedbackv5.loadForm(); |
— | — | @@ -1172,46 +1177,39 @@ |
1173 | 1178 | // {{{ Form loading methods |
1174 | 1179 | |
1175 | 1180 | /** |
1176 | | - * Loads the appropriate form |
| 1181 | + * Chooses a bucket and loads the appropriate form |
1177 | 1182 | * |
1178 | | - * The load method uses an ajax request to pull down the bucket ID, the |
1179 | | - * feedback ID, and using those, build the form. |
| 1183 | + * If the plugin is in debug mode, you'll be able to pass in a particular |
| 1184 | + * bucket in the url. Otherwise, it will use the core bucketing |
| 1185 | + * (configuration for this module passed in) to choose a bucket. |
1180 | 1186 | */ |
1181 | 1187 | $.articleFeedbackv5.loadForm = function () { |
| 1188 | + // Find out which display bucket they go in: |
| 1189 | + // 1. Requested in query string (debug only) |
| 1190 | + // 2. From cookie (see below) |
| 1191 | + // 3. Core bucketing |
| 1192 | + var knownBuckets = { 1: true, 5: true, 6: true }; |
1182 | 1193 | var requested = mw.util.getParamValue( 'bucket' ); |
1183 | | - $.ajax( { |
1184 | | - 'url': $.articleFeedbackv5.apiUrl, |
1185 | | - 'type': 'GET', |
1186 | | - 'dataType': 'json', |
1187 | | - 'data': { |
1188 | | - 'list': 'articlefeedbackv5', |
1189 | | - 'action': 'query', |
1190 | | - 'format': 'json', |
1191 | | - 'afsubaction': 'newform', |
1192 | | - 'afanontoken': $.articleFeedbackv5.userId, |
1193 | | - 'afpageid': $.articleFeedbackv5.pageId, |
1194 | | - 'afrevid': $.articleFeedbackv5.revisionId, |
1195 | | - 'afbucketrequested': requested |
1196 | | - }, |
1197 | | - 'success': function ( data ) { |
1198 | | - if ( !( 'form' in data ) || !( 'bucketId' in data.form ) ) { |
1199 | | - mw.log( 'ArticleFeedback invalid response error.' ); |
1200 | | - if ( 'error' in data && 'info' in data.error ) { |
1201 | | - console.log(data.error.info); |
1202 | | - } else { |
1203 | | - console.log(data); |
1204 | | - } |
1205 | | - $.articleFeedbackv5.bucketId = 6; // No form |
1206 | | - } else { |
1207 | | - $.articleFeedbackv5.bucketId = data.form.bucketId; |
1208 | | - } |
1209 | | - $.articleFeedbackv5.buildForm( 'form' in data ? data.form.response : null ); |
1210 | | - }, |
1211 | | - 'error': function () { |
1212 | | - mw.log( 'Report loading error' ); |
1213 | | - $.articleFeedbackv5.buildForm(); |
1214 | | - } |
1215 | | - } ); |
| 1194 | + var cookieval = $.cookie( $.articleFeedbackv5.prefix( 'display-bucket' ) ); |
| 1195 | + if ( $.articleFeedbackv5.debug && requested in knownBuckets ) { |
| 1196 | + $.articleFeedbackv5.bucketId = requested; |
| 1197 | + } else if ( cookieval in knownBuckets ) { |
| 1198 | + $.articleFeedbackv5.bucketId = cookieval; |
| 1199 | + } else { |
| 1200 | + $.articleFeedbackv5.bucketId = mw.user.bucket( |
| 1201 | + 'ext.articleFeedbackv5-display', |
| 1202 | + mw.config.get( 'wgArticleFeedbackv5DisplayBuckets' ) |
| 1203 | + ); |
| 1204 | + } |
| 1205 | + // Drop in a cookie to keep track of their display bucket; |
| 1206 | + // use the config to determine how long to hold onto it. |
| 1207 | + var cfg = mw.config.get( 'wgArticleFeedbackv5DisplayBuckets' ); |
| 1208 | + $.cookie( |
| 1209 | + $.articleFeedbackv5.prefix( 'display-bucket' ), |
| 1210 | + $.articleFeedbackv5.bucketId, |
| 1211 | + { 'expires': cfg.expires, 'path': '/' } |
| 1212 | + ); |
| 1213 | + $.articleFeedbackv5.buildForm(); |
1216 | 1214 | }; |
1217 | 1215 | |
1218 | 1216 | /** |
— | — | @@ -1220,7 +1218,9 @@ |
1221 | 1219 | * @param response object any existing answers |
1222 | 1220 | */ |
1223 | 1221 | $.articleFeedbackv5.buildForm = function ( response ) { |
1224 | | - console.log( 'Using bucket #' + $.articleFeedbackv5.bucketId ); |
| 1222 | + if ( $.articleFeedbackv5.debug ) { |
| 1223 | + console.log( 'Using bucket #' + $.articleFeedbackv5.bucketId ); |
| 1224 | + } |
1225 | 1225 | var bucket = $.articleFeedbackv5.currentBucket(); |
1226 | 1226 | if ( !( 'buildForm' in bucket ) ) { |
1227 | 1227 | return; |
Index: trunk/extensions/ArticleFeedbackv5/modules/ext.articleFeedbackv5/ext.articleFeedbackv5.js |
— | — | @@ -5,7 +5,7 @@ |
6 | 6 | |
7 | 7 | // Only track users who have been assigned to the tracking group |
8 | 8 | var tracked = 'track' === mw.user.bucket( |
9 | | - 'ext.articleFeedback-tracking', mw.config.get( 'wgArticleFeedbackv5Tracking' ) |
| 9 | + 'ext.articleFeedbackv5-tracking', mw.config.get( 'wgArticleFeedbackv5Tracking' ) |
10 | 10 | ); |
11 | 11 | |
12 | 12 | /** |
— | — | @@ -16,7 +16,7 @@ |
17 | 17 | */ |
18 | 18 | function prefix( key ) { |
19 | 19 | var version = mw.config.get( 'wgArticleFeedbackv5Tracking' ).version || 0; |
20 | | - return 'ext.articleFeedback@' + version + '-' + key; |
| 20 | + return 'ext.articleFeedbackv5@' + version + '-' + key; |
21 | 21 | } |
22 | 22 | |
23 | 23 | /** |
— | — | @@ -316,7 +316,7 @@ |
317 | 317 | }; |
318 | 318 | |
319 | 319 | /* Load at the bottom of the article */ |
320 | | -var $aftDiv = $( '<div id="mw-articlefeedback"></div>' ).articleFeedbackv5( config ); |
| 320 | +var $aftDiv = $( '<div id="mw-articlefeedbackv5"></div>' ).articleFeedbackv5( config ); |
321 | 321 | |
322 | 322 | // Put on bottom of article before #catlinks (if it exists) |
323 | 323 | // Except in legacy skins, which have #catlinks above the article but inside content-div. |
— | — | @@ -329,14 +329,16 @@ |
330 | 330 | } |
331 | 331 | |
332 | 332 | /* Add link so users can navigate to the feedback tool from the toolbox */ |
333 | | -var $tbAft = $( '<li id="t-articlefeedback"><a href="#mw-articlefeedback"></a></li>' ) |
| 333 | +var $tbAft = $( '<li id="t-articlefeedbackv5"><a href="#mw-articlefeedbackv5"></a></li>' ) |
334 | 334 | .find( 'a' ) |
| 335 | + // TODO: Find out whether this needs to change per bucket. Bucketing |
| 336 | + // logic may need to move out of the jquery component into here. |
335 | 337 | .text( mw.msg( 'articlefeedbackv5-bucket5-form-switch-label' ) ) |
336 | 338 | .click( function() { |
337 | 339 | // Click tracking |
338 | 340 | trackClick( 'toolbox-link' ); |
339 | 341 | // Get the image, set the count and an interval. |
340 | | - var $box = $( '#mw-articlefeedback' ); |
| 342 | + var $box = $( '#mw-articlefeedbackv5' ); |
341 | 343 | var count = 0; |
342 | 344 | var interval = setInterval( function() { |
343 | 345 | // Animate the opacity over .2 seconds |
Index: trunk/extensions/ArticleFeedbackv5/modules/ext.articleFeedbackv5/ext.articleFeedbackv5.startup.js |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | && mw.util.getParamValue( 'diff' ) == null |
22 | 22 | && mw.util.getParamValue( 'oldid' ) == null |
23 | 23 | // Not disabled via preferences |
24 | | - && !mw.user.options.get( 'articlefeedback-disable' ) |
| 24 | + && !mw.user.options.get( 'articlefeedbackv5-disable' ) |
25 | 25 | // Not viewing a redirect |
26 | 26 | && mw.util.getParamValue( 'redirect' ) != 'no' |
27 | 27 | // Not viewing the printable version |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | ) { |
30 | 30 | // Assign a tracking bucket using options from wgArticleFeedbackv5Tracking |
31 | 31 | mw.user.bucket( |
32 | | - 'ext.articleFeedback-tracking', mw.config.get( 'wgArticleFeedbackv5Tracking' ) |
| 32 | + 'ext.articleFeedbackv5-tracking', mw.config.get( 'wgArticleFeedbackv5Tracking' ) |
33 | 33 | ); |
34 | 34 | |
35 | 35 | // Collect categories for intersection tests |
Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.php |
— | — | @@ -41,6 +41,39 @@ |
42 | 42 | // are the smallest increments used. |
43 | 43 | $wgArticleFeedbackv5LotteryOdds = 0; |
44 | 44 | |
| 45 | +// This puts the javascript into debug mode. In debug mode, you can set your |
| 46 | +// own bucket by passing it in the url (e.g., ?bucket=1), and the showstopper |
| 47 | +// error mode will have a useful error message, if one exists, rather than the |
| 48 | +// default message. |
| 49 | +$wgArticleFeedbackv5Debug = true; |
| 50 | + |
| 51 | +// Bucket settings for display options |
| 52 | +$wgArticleFeedbackv5DisplayBuckets = array( |
| 53 | + // Users can fall into one of several display buckets (these are defined in |
| 54 | + // modules/jquery.articlefeedbackv5/jquery.articlefeedbackv5.js). When a |
| 55 | + // user arrives at the page, this config will be used by core bucketing to |
| 56 | + // decide which of the available form options they see. Whenever there's |
| 57 | + // an update to the available buckets, change the version number to ensure |
| 58 | + // the new odds are applied to everyone, not just people who have yet to be |
| 59 | + // placed in a bucket. |
| 60 | + 'buckets' => array( |
| 61 | + '1' => 34, |
| 62 | + '5' => 33, |
| 63 | + '6' => 33, |
| 64 | + ), |
| 65 | + // This version number is added to all tracking event names, so that |
| 66 | + // changes in the software don't corrupt the data being collected. Bump |
| 67 | + // this when you want to start a new "experiment". |
| 68 | + 'version' => 0, |
| 69 | + // Let users be tracked for a month, and then rebucket them, allowing some |
| 70 | + // churn. |
| 71 | + 'expires' => 30, |
| 72 | + // Track the event of users being bucketed - so we can be sure the odds |
| 73 | + // worked out right. |
| 74 | + 'tracked' => true |
| 75 | +); |
| 76 | + |
| 77 | + |
45 | 78 | // Bucket settings for tracking users |
46 | 79 | $wgArticleFeedbackv5Tracking = array( |
47 | 80 | // Not all users need to be tracked, but we do want to track some users over time - these |
Index: trunk/extensions/ArticleFeedbackv5/api/ApiQueryArticleFeedbackv5.php |
— | — | @@ -1,309 +0,0 @@ |
2 | | -<?php |
3 | | -/** |
4 | | - * ApiQueryArticleFeedbackv5 class |
5 | | - * |
6 | | - * @package ArticleFeedback |
7 | | - * @subpackage Api |
8 | | - * @author Greg Chiasson <greg@omniti.com> |
9 | | - * @author Reha Sterbin <reha@omniti.com> |
10 | | - * @version $Id$ |
11 | | - */ |
12 | | - |
13 | | -/** |
14 | | - * This class loads data. The other one saves it. |
15 | | - * |
16 | | - * @package ArticleFeedback |
17 | | - * @subpackage Api |
18 | | - */ |
19 | | -class ApiQueryArticleFeedbackv5 extends ApiQueryBase { |
20 | | - |
21 | | - /** |
22 | | - * Constructor |
23 | | - */ |
24 | | - public function __construct( $query, $moduleName ) { |
25 | | - parent::__construct( $query, $moduleName, 'af' ); |
26 | | - } |
27 | | - |
28 | | - /** |
29 | | - * Execute the API call: initialize a brand new request |
30 | | - * |
31 | | - * JS passes in a page id and, sometimes, a revision id. Return back the |
32 | | - * correct bucket id. |
33 | | - * |
34 | | - * NB: This call used to return a feedback id and any associated answers as |
35 | | - * well as the bucket id (each user was allowed one rating/comment saved |
36 | | - * per page per revision); it no longer does, as per the 11/10 meeting -- |
37 | | - * instead, we'll store everything the user submits. |
38 | | - */ |
39 | | - public function execute() { |
40 | | - $params = $this->extractRequestParams(); |
41 | | - global $wgArticleFeedbackv5RatingTypes, $wgUser; |
42 | | - $params = $this->extractRequestParams(); |
43 | | - $bucket = $this->getBucket( $params ); |
44 | | - $result = $this->getResult(); |
45 | | - |
46 | | - if ( !$params['revid'] ) { |
47 | | - $params['revid'] = ApiArticleFeedbackv5Utils::getRevisionId( $params['pageid'] ); |
48 | | - } |
49 | | - if ( !$params['pageid'] || !$params['revid'] ) { |
50 | | - return null; |
51 | | - } |
52 | | - |
53 | | - // $this->logHit( $params['pageid'], $params['revid'], $bucket ); |
54 | | - |
55 | | - $result->addValue( 'form', 'pageId', $params['pageid'] ); |
56 | | - $result->addValue( 'form', 'bucketId', $bucket ); |
57 | | - |
58 | | - // $feedbackId = $this->getFeedbackId($params, $bucket); |
59 | | - // $result->addValue('form', 'feedbackId', $feedbackId); |
60 | | - } |
61 | | - |
62 | | - /** |
63 | | - * Determine into which bucket this request should fall |
64 | | - * |
65 | | - * @TODO Base this on last 2 digits of IP address per requirements; when we |
66 | | - * have markup, we can add other buckets |
67 | | - * |
68 | | - * @param array $params [optional] the params passed in |
69 | | - * @return int the bucket id |
70 | | - */ |
71 | | - protected function getBucket( $params = array() ) { |
72 | | - $allowedBuckets = array( 1, 5, 6 ); |
73 | | - if ( !empty( $params['bucketrequested'] ) |
74 | | - && is_numeric( $params['bucketrequested'] ) |
75 | | - && in_array( $params['bucketrequested'], $allowedBuckets ) ) { |
76 | | - $bucket = $params['bucketrequested']; |
77 | | -// error_log('Using requested bucket'); |
78 | | - } else { |
79 | | - // Randomize for now; use the designated algorithm later |
80 | | - $bucket = $allowedBuckets[rand( 0, count( $allowedBuckets ) - 1 )]; |
81 | | -// error_log('Using random bucket'); |
82 | | -// error_log(var_export($params, true)); |
83 | | - } |
84 | | - return $bucket; |
85 | | - } |
86 | | - |
87 | | - /** |
88 | | - * Log that this bucket was served for this page and revision |
89 | | - * |
90 | | - * @param $page int the page id |
91 | | - * @param $revision int the revision id |
92 | | - * @param $bucket int the bucket id |
93 | | - */ |
94 | | - private function logHit( $page, $revision, $bucket ) { |
95 | | - $dbr = wfGetDB( DB_SLAVE ); |
96 | | - $dbw = wfGetDB( DB_MASTER ); |
97 | | - $date = date( 'Y-m-d' ); |
98 | | - |
99 | | - if ( !$page && !$revision ) { |
100 | | - return; |
101 | | - } |
102 | | - |
103 | | - // Select hit counter row |
104 | | - $hits = $dbr->selectField( |
105 | | - 'aft_article_hits', |
106 | | - 'aah_hits', |
107 | | - array( |
108 | | - 'aah_page_id' => $page, |
109 | | - 'aah_date' => $date, |
110 | | - 'aah_bucket_id' => $bucket, |
111 | | - ) |
112 | | - ); |
113 | | - |
114 | | - // If there's a row, update it. |
115 | | - if ( $hits ) { |
116 | | - $dbw->update( |
117 | | - 'aft_article_hits', |
118 | | - array( 'aah_hits' => ( $hits + 1 ) ), |
119 | | - array( |
120 | | - 'aah_page_id' => $page, |
121 | | - 'aah_date' => $date, |
122 | | - 'aah_bucket_id' => $bucket, |
123 | | - ) |
124 | | - ); |
125 | | - } else { |
126 | | - // Otherwise, there's no row, insert one. |
127 | | - $dbw->insert('aft_article_hits', array( |
128 | | - 'aah_page_id' => $page, |
129 | | - 'aah_date' => $date, |
130 | | - 'aah_bucket_id' => $bucket, |
131 | | - 'aah_hits' => 1 |
132 | | - )); |
133 | | - } |
134 | | - } |
135 | | - |
136 | | - /** |
137 | | - * Gets the user's feedback for this page. |
138 | | - * |
139 | | - * Only works on userids, NOT IP adderesses. Idea being that IPs can move, |
140 | | - * and we don't want your comments being shown to a different person who |
141 | | - * took your IP. ALSO take revision limit into account. |
142 | | - * |
143 | | - * NB: Mostly deprecated; do not use in new code. |
144 | | - * |
145 | | - * @param $feedbackId the feedback id |
146 | | - * @return array the previous answers |
147 | | - */ |
148 | | - protected function getUserRatings( $feedbackId ) { |
149 | | - global $wgUser; |
150 | | - $dbr = wfGetDB( DB_SLAVE ); |
151 | | - $feedback = array(); |
152 | | - $rows = $dbr->select( |
153 | | - array('aft_article_answer', 'aft_article_field', |
154 | | - 'aft_article_feedback'), |
155 | | - array('aaaa_response_rating', 'aaaa_response_text', |
156 | | - 'aaaa_response_bool', 'aaaa_response_option_id', |
157 | | - 'aaf_name', 'aaf_data_type'), |
158 | | - array( |
159 | | - 'aa_revision >= ' . $this->getRevisionLimit(), |
160 | | - 'aaaa_feedback_id' => $feedbackId, |
161 | | - 'aa_user_id' => $wgUser->getId(), |
162 | | - 'aa_is_submitted' => 1, |
163 | | - ) |
164 | | - ); |
165 | | - |
166 | | - foreach ( $rows as $row ) { |
167 | | - $method = 'response_'.$row->aaf_data_type; |
168 | | - $feeedback[] = array( |
169 | | - 'name' => $row->aaf_name, |
170 | | - 'value' => $row->$method |
171 | | - ); |
172 | | - } |
173 | | - return $feedback; |
174 | | - } |
175 | | - |
176 | | - /** |
177 | | - * Get the revision number of the oldest revision still being counted in |
178 | | - * totals |
179 | | - * |
180 | | - * @param $pageId int ID of page to check revisions for |
181 | | - * @return int oldest valid revision number or 0 of all revisions are valid |
182 | | - */ |
183 | | - protected function getRevisionLimit( $pageId ) { |
184 | | - global $wgArticleFeedbackv5RatingLifetime; |
185 | | - |
186 | | - $revision = $this->getDB()->selectField( |
187 | | - 'revision', |
188 | | - 'rev_id', |
189 | | - array( 'rev_page' => $pageId ), |
190 | | - __METHOD__, |
191 | | - array( |
192 | | - 'ORDER BY' => 'rev_id DESC', |
193 | | - 'LIMIT' => 1, |
194 | | - 'OFFSET' => $wgArticleFeedbackv5RatingLifetime - 1 |
195 | | - ) |
196 | | - ); |
197 | | - if ( $revision ) { |
198 | | - return intval( $revision ); |
199 | | - } |
200 | | - return 0; |
201 | | - } |
202 | | - |
203 | | - /** |
204 | | - * Gets the cache mode |
205 | | - * |
206 | | - * @param $params array the params passed in |
207 | | - * @return string the cache mode ('anon-public-user-private' or 'public') |
208 | | - */ |
209 | | - public function getCacheMode( $params ) { |
210 | | - if ( $params['userrating'] ) { |
211 | | - return 'anon-public-user-private'; |
212 | | - } else { |
213 | | - return 'public'; |
214 | | - } |
215 | | - } |
216 | | - |
217 | | - /** |
218 | | - * TODO |
219 | | - * Gets the allowed parameters |
220 | | - * |
221 | | - * @return array the params info, indexed by allowed key |
222 | | - */ |
223 | | - public function getAllowedParams() { |
224 | | - return array( |
225 | | - 'userrating' => 0, |
226 | | - 'anontoken' => null, |
227 | | - 'bucketrequested' => null, |
228 | | - 'subaction' => array( |
229 | | - ApiBase::PARAM_REQUIRED => false, |
230 | | - ApiBase::PARAM_ISMULTI => false, |
231 | | - ApiBase::PARAM_TYPE => array( 'showratings', 'newform' ), |
232 | | - ), |
233 | | - 'revid' => array( |
234 | | - ApiBase::PARAM_REQUIRED => false, |
235 | | - ApiBase::PARAM_ISMULTI => false, |
236 | | - ApiBase::PARAM_TYPE => 'integer', |
237 | | - ), |
238 | | - 'pageid' => array( |
239 | | - ApiBase::PARAM_REQUIRED => true, |
240 | | - ApiBase::PARAM_ISMULTI => false, |
241 | | - ApiBase::PARAM_TYPE => 'integer', |
242 | | - ), |
243 | | - ); |
244 | | - } |
245 | | - |
246 | | - /** |
247 | | - * TODO |
248 | | - * Gets the parameter descriptions |
249 | | - * |
250 | | - * @return array the descriptions, indexed by allowed key |
251 | | - */ |
252 | | - public function getParamDescription() { |
253 | | - return array( |
254 | | - 'pageid' => 'Page ID to get feedback ratings for', |
255 | | - 'revid' => 'Rev ID to get feedback ratings for', |
256 | | - 'anontoken' => 'Token for anonymous users', |
257 | | - 'bucketrequested' => 'The bucket number requested in the url', |
258 | | - ); |
259 | | - } |
260 | | - |
261 | | - /** |
262 | | - * TODO |
263 | | - * Gets the api descriptions |
264 | | - * |
265 | | - * @return array the description as the first element in an array |
266 | | - */ |
267 | | - public function getDescription() { |
268 | | - return array( |
269 | | - 'List article feedback ratings for a specified page' |
270 | | - ); |
271 | | - } |
272 | | - |
273 | | - /** |
274 | | - * TODO |
275 | | - * Gets any possible errors |
276 | | - * |
277 | | - * @return array the errors |
278 | | - */ |
279 | | - public function getPossibleErrors() { |
280 | | - return array_merge( parent::getPossibleErrors(), array( |
281 | | - array( 'missingparam', 'anontoken' ), |
282 | | - array( 'code' => 'invalidtoken', 'info' => 'The anontoken is not 32 characters' ), |
283 | | - ) |
284 | | - ); |
285 | | - } |
286 | | - |
287 | | - /** |
288 | | - * TODO |
289 | | - * Gets an example |
290 | | - * |
291 | | - * @return array the example as the first element in an array |
292 | | - */ |
293 | | - protected function getExamples() { |
294 | | - return array( |
295 | | - 'api.php?action=query&list=articlefeedbackv5&afpageid=1', |
296 | | - ); |
297 | | - } |
298 | | - |
299 | | - /** |
300 | | - * TODO |
301 | | - * Gets the version info |
302 | | - * |
303 | | - * @return string the SVN version info |
304 | | - */ |
305 | | - public function getVersion() { |
306 | | - return __CLASS__ . ': $Id$'; |
307 | | - } |
308 | | - |
309 | | -} |
310 | | - |
Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.hooks.php |
— | — | @@ -202,6 +202,8 @@ |
203 | 203 | $wgArticleFeedbackv5Categories, |
204 | 204 | $wgArticleFeedbackv5BlacklistCategories, |
205 | 205 | $wgArticleFeedbackv5LotteryOdds, |
| 206 | + $wgArticleFeedbackv5Debug, |
| 207 | + $wgArticleFeedbackv5DisplayBuckets, |
206 | 208 | $wgArticleFeedbackv5Tracking, |
207 | 209 | $wgArticleFeedbackv5Options, |
208 | 210 | $wgArticleFeedbackv5Namespaces; |
— | — | @@ -209,6 +211,8 @@ |
210 | 212 | $vars['wgArticleFeedbackv5Categories'] = $wgArticleFeedbackv5Categories; |
211 | 213 | $vars['wgArticleFeedbackv5BlacklistCategories'] = $wgArticleFeedbackv5BlacklistCategories; |
212 | 214 | $vars['wgArticleFeedbackv5LotteryOdds'] = $wgArticleFeedbackv5LotteryOdds; |
| 215 | + $vars['wgArticleFeedbackv5Debug'] = $wgArticleFeedbackv5Debug; |
| 216 | + $vars['wgArticleFeedbackv5DisplayBuckets'] = $wgArticleFeedbackv5DisplayBuckets; |
213 | 217 | $vars['wgArticleFeedbackv5Tracking'] = $wgArticleFeedbackv5Tracking; |
214 | 218 | $vars['wgArticleFeedbackv5Options'] = $wgArticleFeedbackv5Options; |
215 | 219 | $vars['wgArticleFeedbackv5Namespaces'] = $wgArticleFeedbackv5Namespaces; |