Index: trunk/extensions/ArticleFeedbackv5/sql/ArticleFeedbackv5.sql |
— | — | @@ -44,7 +44,10 @@ |
45 | 45 | -- Flag a message as requiring oversight, being hidden ,or being deleted |
46 | 46 | af_needs_oversight boolean NOT NULL DEFAULT FALSE, |
47 | 47 | af_is_deleted boolean NOT NULL DEFAULT FALSE, |
48 | | - af_is_hidden boolean NOT NULL DEFAULT FALSE |
| 48 | + af_is_hidden boolean NOT NULL DEFAULT FALSE, |
| 49 | + -- Keep track of number of activities (hide/show/flag/unflag) |
| 50 | + -- should be equivalent to counting rows in logging table |
| 51 | + af_activity_count integer unsigned NOT NULL DEFAULT 0 |
49 | 52 | ) /*$wgDBTableOptions*/; |
50 | 53 | CREATE INDEX /*i*/af_page_user_token_id ON /*_*/aft_article_feedback (af_page_id, af_user_id, af_user_anon_token, af_id); |
51 | 54 | CREATE INDEX /*i*/af_revision_id ON /*_*/aft_article_feedback (af_revision_id); |
Index: trunk/extensions/ArticleFeedbackv5/sql/alter.sql |
— | — | @@ -125,3 +125,6 @@ |
126 | 126 | |
127 | 127 | -- Added 2/1 (greg) |
128 | 128 | CREATE INDEX /*_*/af_net_helpfulness_af_id ON /*_*/aft_article_feedback (af_id, af_net_helpfulness); |
| 129 | + |
| 130 | +-- Added 2/14 (emsmith) |
| 131 | +ALTER TABLE /*_*/aft_article_feedback ADD COLUMN af_activity_count integer unsigned NOT NULL DEFAULT 0; |
Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php |
— | — | @@ -321,7 +321,7 @@ |
322 | 322 | 'right-aftv5-see-deleted-feedback' => 'View deleted feedback', |
323 | 323 | 'right-aftv5-see-hidden-feedback' => 'View hidden feedback', |
324 | 324 | |
325 | | - // Log types |
| 325 | + /* Log types */ |
326 | 326 | 'articlefeedbackv5-log-name' => 'Article Feedback Activity Log', |
327 | 327 | 'articlefeedbackv5-log-header' => 'This is the log of activity taken on feedback items collected for articles using Article Feedback.', |
328 | 328 | 'articlefeedbackv5-log-oversight' => 'changed the feedback [[$1]] status to oversight', |
— | — | @@ -334,6 +334,25 @@ |
335 | 335 | 'articlefeedbackv5-log-flag' => 'flagged the feedback [[$1]] as abuse', |
336 | 336 | 'articlefeedbackv5-log-unflag' => 'unflagged the feedback [[$1]] as abuse', |
337 | 337 | |
| 338 | + /* Activity Pane phrases */ |
| 339 | + 'articlefeedbackv5-activity-pane-header' => 'Activity Log', |
| 340 | + 'articlefeedbackv5-activity-help-item' => '?', |
| 341 | + 'articlefeedbackv5-activity-close-item' => 'X', |
| 342 | + 'articlefeedbackv5-activity-feedback-info' => 'Feedback Post #$1 by', |
| 343 | + 'articlefeedbackv5-activity-feedback-date' => 'Posted on $1', |
| 344 | + 'articlefeedbackv5-activity-permalink' => 'permalink', |
| 345 | + 'articlefeedbackv5-activity-request' => 'requested oversight on', |
| 346 | + 'articlefeedbackv5-activity-unrequest' => 'unrequested oversight on', |
| 347 | + 'articlefeedbackv5-activity-decline' => 'declined oversight on', |
| 348 | + 'articlefeedbackv5-activity-hidden' => 'hid this post on', |
| 349 | + 'articlefeedbackv5-activity-flag' => 'flagged this post on', |
| 350 | + 'articlefeedbackv5-activity-unhidden' => 'unhid this post on', |
| 351 | + 'articlefeedbackv5-activity-unflag' => 'unflagged this post on', |
| 352 | + 'articlefeedbackv5-activity-oversight' => 'oversighted this post on', |
| 353 | + 'articlefeedbackv5-activity-unoversight' => 'removed oversight on this post on', |
| 354 | + 'articlefeedbackv5-activity-count' => '$1 actions on this post', |
| 355 | + 'articlefeedbackv5-activity-more' => 'Show more Activity', |
| 356 | + |
338 | 357 | /* EmailCapture */ |
339 | 358 | 'articlefeedbackv5-emailcapture-response-body' => 'Hello! |
340 | 359 | |
Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.php |
— | — | @@ -244,6 +244,7 @@ |
245 | 245 | 'Arthur Richards', |
246 | 246 | 'Timo Tijhof', |
247 | 247 | 'Ryan Kaldari', |
| 248 | + 'Elizabeth M Smith', |
248 | 249 | ), |
249 | 250 | 'version' => '0.0.1', |
250 | 251 | 'descriptionmsg' => 'articlefeedbackv5-desc', |
— | — | @@ -257,6 +258,7 @@ |
258 | 259 | $wgAutoloadClasses['ApiViewRatingsArticleFeedbackv5'] = $dir . 'api/ApiViewRatingsArticleFeedbackv5.php'; |
259 | 260 | $wgAutoloadClasses['ApiViewFeedbackArticleFeedbackv5'] = $dir . 'api/ApiViewFeedbackArticleFeedbackv5.php'; |
260 | 261 | $wgAutoloadClasses['ApiFlagFeedbackArticleFeedbackv5'] = $dir . 'api/ApiFlagFeedbackArticleFeedbackv5.php'; |
| 262 | +$wgAutoloadClasses['ApiViewActivityArticleFeedbackv5'] = $dir . 'api/ApiViewActivityArticleFeedbackv5.php'; |
261 | 263 | $wgAutoloadClasses['ArticleFeedbackv5Hooks'] = $dir . 'ArticleFeedbackv5.hooks.php'; |
262 | 264 | $wgAutoloadClasses['SpecialArticleFeedbackv5'] = $dir . 'SpecialArticleFeedbackv5.php'; |
263 | 265 | $wgExtensionMessagesFiles['ArticleFeedbackv5'] = $dir . 'ArticleFeedbackv5.i18n.php'; |
— | — | @@ -276,6 +278,7 @@ |
277 | 279 | // API Registration |
278 | 280 | $wgAPIListModules['articlefeedbackv5-view-ratings'] = 'ApiViewRatingsArticleFeedbackv5'; |
279 | 281 | $wgAPIListModules['articlefeedbackv5-view-feedback'] = 'ApiViewFeedbackArticleFeedbackv5'; |
| 282 | +$wgAPIListModules['articlefeedbackv5-view-activity'] = 'ApiViewActivityArticleFeedbackv5'; |
280 | 283 | $wgAPIModules['articlefeedbackv5-flag-feedback'] = 'ApiFlagFeedbackArticleFeedbackv5'; |
281 | 284 | $wgAPIModules['articlefeedbackv5'] = 'ApiArticleFeedbackv5'; |
282 | 285 | |
Index: trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5Utils.php |
— | — | @@ -245,6 +245,21 @@ |
246 | 246 | $log = new LogPage( 'articlefeedbackv5' ); |
247 | 247 | // comments become the notes section from the feedback |
248 | 248 | $log->addEntry( $type, $title, $notes ); |
| 249 | + |
| 250 | + // update our log count by 1 |
| 251 | + $dbw = wfGetDB( DB_MASTER ); |
| 252 | + $dbw->begin(); |
| 253 | + |
| 254 | + $dbw->update( |
| 255 | + 'aft_article_feedback', |
| 256 | + array( 'af_activity_count = af_activity_count + 1' ), |
| 257 | + array( |
| 258 | + 'af_id' => $itemId |
| 259 | + ), |
| 260 | + __METHOD__ |
| 261 | + ); |
| 262 | + |
| 263 | + $dbw->commit(); |
249 | 264 | } |
250 | 265 | } |
251 | 266 | |
Index: trunk/extensions/ArticleFeedbackv5/api/ApiViewActivityArticleFeedbackv5.php |
— | — | @@ -0,0 +1,379 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | + * ApiViewActivityArticleFeedbackv5 class
|
| 5 | + *
|
| 6 | + * @package ArticleFeedback
|
| 7 | + * @subpackage Api
|
| 8 | + * @author Elizabeth M Smith <elizabeth@omniti.com>
|
| 9 | + * @version $Id$
|
| 10 | + */
|
| 11 | +
|
| 12 | +/**
|
| 13 | + * This class pulls the aggregated ratings for display in Bucket #5
|
| 14 | + *
|
| 15 | + * @package ArticleFeedback
|
| 16 | + * @subpackage Api
|
| 17 | + */
|
| 18 | +class ApiViewActivityArticleFeedbackv5 extends ApiQueryBase {
|
| 19 | +
|
| 20 | + /**
|
| 21 | + * Constructor
|
| 22 | + */
|
| 23 | + public function __construct( $query, $moduleName ) {
|
| 24 | + parent::__construct( $query, $moduleName, 'af' );
|
| 25 | + }
|
| 26 | +
|
| 27 | + /**
|
| 28 | + * Execute the API call: Pull max 25 activity log items for page
|
| 29 | + */
|
| 30 | + public function execute() {
|
| 31 | + global $wgUser; // we need to check permissions in here
|
| 32 | + global $wgLang; // timestamp formats
|
| 33 | +
|
| 34 | + // If we can't hide, we can't see activity, return an empty string
|
| 35 | + // front-end should never let you get here, but just in case
|
| 36 | + if( !$wgUser->isAllowed( 'aftv5-hide-feedback' )) {
|
| 37 | + return;
|
| 38 | + }
|
| 39 | +
|
| 40 | + // These are our valid activity log actions
|
| 41 | + $valid = array( 'oversight', 'unoversight', 'hidden', 'unhidden',
|
| 42 | + 'decline', 'request', 'unrequest','flag','unflag' );
|
| 43 | +
|
| 44 | + // get our parameter information
|
| 45 | + $params = $this->extractRequestParams();
|
| 46 | + $feedbackId = $params['feedbackid'];
|
| 47 | + $limit = $params['limit'];
|
| 48 | + $continue = $params['continue'];
|
| 49 | +
|
| 50 | + // fetch our activity database information
|
| 51 | + $feedback = $this->fetchFeedback( $feedbackId );
|
| 52 | +
|
| 53 | + // get the string title for the page
|
| 54 | + $page = Title::newFromID( $feedback->af_page_id );
|
| 55 | + $title = $page->getPartialURL();
|
| 56 | +
|
| 57 | + // get our activities
|
| 58 | + $activities = $this->fetchActivity( $title, $feedbackId, $limit, $continue);
|
| 59 | +
|
| 60 | + // overwrite previous continue for new value
|
| 61 | + $continue = null;
|
| 62 | +
|
| 63 | + // generate our html
|
| 64 | + $html = '';
|
| 65 | +
|
| 66 | + // <div class="articleFeedbackv5-activity-pane">
|
| 67 | + $html .= Html::openElement( 'div', array(
|
| 68 | + 'class' => 'articleFeedbackv5-activity-pane'
|
| 69 | + ) );
|
| 70 | +
|
| 71 | + // <div class="articleFeedbackv5-activity-header">
|
| 72 | + $html .= Html::openElement( 'div', array(
|
| 73 | + 'class' => 'articleFeedbackv5-activity-header'
|
| 74 | + ) );
|
| 75 | +
|
| 76 | + // <h1>Activity Log</h1>
|
| 77 | + $html .= Html::element( 'h1', array(),
|
| 78 | + wfMessage( 'articlefeedbackv5-activity-pane-header' )->text() );
|
| 79 | +
|
| 80 | + // <div id="articlefeedbackv5-activity-pane-help">?</div>
|
| 81 | + $html .= Html::element( 'div', array(
|
| 82 | + 'id' => 'articlefeedbackv5-activity-pane-help'),
|
| 83 | + wfMessage( 'articlefeedbackv5-activity-help-item' )->text() );
|
| 84 | +
|
| 85 | + // <div id="articlefeedbackv5-activity-pane-close">X</div>
|
| 86 | + $html .= Html::element( 'div', array(
|
| 87 | + 'id' => 'articlefeedbackv5-activity-pane-close'),
|
| 88 | + wfMessage( 'articlefeedbackv5-activity-close-item' )->text() );
|
| 89 | +
|
| 90 | + // </div> for class="articleFeedbackv5-activity-header"
|
| 91 | + $html .= Html::closeElement( 'div' );
|
| 92 | +
|
| 93 | + // <div class="articleFeedbackv5-activity-feedback">
|
| 94 | + $html .= Html::openElement( 'div', array(
|
| 95 | + 'class' => 'articleFeedbackv5-activity-feedback'
|
| 96 | + ) );
|
| 97 | +
|
| 98 | + // <div>Feedback Post #{$feedbackid} by {$user_link}</div>
|
| 99 | + $html .= Html::openElement( 'div', array() );
|
| 100 | + $html .= wfMessage( 'articlefeedbackv5-activity-feedback-info',
|
| 101 | + array($feedback->af_id))->text()
|
| 102 | + . $this->getUserLink($feedback->af_user_id, $feedback->af_user_ip);
|
| 103 | + $html .= Html::closeElement( 'div' );
|
| 104 | +
|
| 105 | + //<div>Posted on {$date} (UTC)</div>
|
| 106 | + $html .= Html::element( 'div', array(),
|
| 107 | + wfMessage( 'articlefeedbackv5-activity-feedback-date',
|
| 108 | + array( $wgLang->timeanddate( $feedback->af_created ) ))->text() );
|
| 109 | +
|
| 110 | + // <div class="articleFeedbackv5-activity-feedback-permalink">
|
| 111 | + $html .= Html::openElement( 'div', array(
|
| 112 | + 'class' => 'articleFeedbackv5-activity-feedback-permalink'
|
| 113 | + ) );
|
| 114 | +
|
| 115 | + // <a href="{$permalink}">permalink</a>
|
| 116 | + $html .= Linker::link(
|
| 117 | + SpecialPage::getTitleFor( 'ArticleFeedbackv5', $title . '/'. $feedback->af_id ),
|
| 118 | + wfMessage( 'articlefeedbackv5-activity-permalink' )->text());
|
| 119 | +
|
| 120 | + // </div> for class="articleFeedbackv5-activity-feedback-permalink"
|
| 121 | + $html .= Html::closeElement( 'div' );
|
| 122 | +
|
| 123 | + // </div> for class="articleFeedbackv5-activity-feedback"
|
| 124 | + $html .= Html::closeElement( 'div' );
|
| 125 | +
|
| 126 | + //<div class="articleFeedbackv5-activity-count">$n actions on this post</div>
|
| 127 | + $html .= Html::element( 'div', array('class' => 'articleFeedbackv5-activity-count'),
|
| 128 | + wfMessage( 'articlefeedbackv5-activity-count',
|
| 129 | + array( $feedback->af_activity_count ))->text() );
|
| 130 | +
|
| 131 | + // divs of activity items
|
| 132 | + foreach($activities as $item) {
|
| 133 | +
|
| 134 | + // if we do not have a valid action, skip this item
|
| 135 | + if ( !in_array( $item->log_action, $valid )) {
|
| 136 | + continue;
|
| 137 | + }
|
| 138 | +
|
| 139 | + // <div class="articleFeedbackv5-activity-item">
|
| 140 | + $html .= Html::openElement( 'div', array(
|
| 141 | + 'class' => 'articleFeedbackv5-activity-item'
|
| 142 | + ) );
|
| 143 | +
|
| 144 | + // $user $did_something_on $date
|
| 145 | + $html .= $this->getUserLink($item->log_user, $item->log_user_text)
|
| 146 | + . Html::element( 'div', array(),
|
| 147 | + wfMessage( 'articlefeedbackv5-activity-' . $item->log_action,
|
| 148 | + array())->text() )
|
| 149 | + . $wgLang->timeanddate( $item->log_timestamp );
|
| 150 | +
|
| 151 | + // optional: <div class="articleFeedbackv5-activity-notes">$notes</div>
|
| 152 | + if (!empty($item->log_comment)) {
|
| 153 | + $html .= Html::element( 'div',
|
| 154 | + array('class' => 'articlefeedbackv5-activity-notes'),
|
| 155 | + $item->log_comment);
|
| 156 | + }
|
| 157 | +
|
| 158 | + // </div> for class="articleFeedbackv5-activity-item"
|
| 159 | + $html .= Html::closeElement( 'div' );
|
| 160 | +
|
| 161 | + // the last item's log_id should be the continue;
|
| 162 | + $continue = $item->log_id;
|
| 163 | + }
|
| 164 | +
|
| 165 | + // figure out if we have more based on our new continue value
|
| 166 | + $more = $this->fetchHasMore($title, $feedbackId, $continue);
|
| 167 | +
|
| 168 | + //optional <div class="articleFeedbackv5-activity-more">Show more Activity</div>
|
| 169 | + if ($more) {
|
| 170 | + $html .= Html::element( 'div', array('class' => 'articleFeedbackv5-activity-more'),
|
| 171 | + wfMessage( 'articlefeedbackv5-activity-more', array())->text() );
|
| 172 | + }
|
| 173 | +
|
| 174 | + // </div> for class="articleFeedbackv5-activity-pane"
|
| 175 | + $html .= Html::closeElement( 'div' );
|
| 176 | +
|
| 177 | + // finally add our generated html data
|
| 178 | + $result = $this->getResult();
|
| 179 | + $result->addValue( $this->getModuleName(), 'limit', $limit );
|
| 180 | + $result->addValue( $this->getModuleName(), 'activity', $html );
|
| 181 | +
|
| 182 | + // continue only goes in if it's not empty
|
| 183 | + if ($continue > 0) {
|
| 184 | + $result->addValue( $this->getModuleName(), 'continue', $continue );
|
| 185 | + }
|
| 186 | +
|
| 187 | + // more only goes in if there are more entries
|
| 188 | + if ($more) {
|
| 189 | + $result->addValue( $this->getModuleName(), 'more', $more );
|
| 190 | + }
|
| 191 | + }
|
| 192 | +
|
| 193 | + /**
|
| 194 | + * Sees if there are additional activity rows to view
|
| 195 | + *
|
| 196 | + * @param string $title the title of the page
|
| 197 | + * @param int $feedbackId identifier for the feedback item we are fetching activity for
|
| 198 | + * @param mixed $continue used for offsets
|
| 199 | + * @return bool true if there are more rows, or false
|
| 200 | + */
|
| 201 | + protected function fetchHasMore( $title, $feedbackId, $continue = null ) {
|
| 202 | + $dbr = wfGetDB( DB_SLAVE );
|
| 203 | +
|
| 204 | + $feedback = $dbr->selectField(
|
| 205 | + array( 'logging' ),
|
| 206 | + array( 'log_id'),
|
| 207 | + array(
|
| 208 | + 'log_type' => 'articlefeedbackv5',
|
| 209 | + 'log_title' => "ArticleFeedbackv5/$title/$feedbackId",
|
| 210 | + 'log_id < ' . intval($continue)
|
| 211 | + ),
|
| 212 | + __METHOD__,
|
| 213 | + array(
|
| 214 | + 'LIMIT' => 1
|
| 215 | + )
|
| 216 | + );
|
| 217 | +
|
| 218 | + return ( (bool) $feedback );
|
| 219 | + }
|
| 220 | +
|
| 221 | + /**
|
| 222 | + * Gets some base feedback information
|
| 223 | + *
|
| 224 | + * @param int $feedbackId identifier for the feedback item we are fetching activity for
|
| 225 | + * @return int total number of activity items for feedback item
|
| 226 | + */
|
| 227 | + protected function fetchFeedback( $feedbackId ) {
|
| 228 | + $dbr = wfGetDB( DB_SLAVE );
|
| 229 | +
|
| 230 | + $feedback = $dbr->selectRow(
|
| 231 | + array( 'aft_article_feedback' ),
|
| 232 | + array( 'af_id',
|
| 233 | + 'af_page_id',
|
| 234 | + 'af_user_id',
|
| 235 | + 'af_user_ip',
|
| 236 | + 'af_created',
|
| 237 | + 'af_activity_count'),
|
| 238 | + array(
|
| 239 | + 'af_id' => $feedbackId,
|
| 240 | + ),
|
| 241 | + __METHOD__,
|
| 242 | + array(
|
| 243 | + 'LIMIT' => 1
|
| 244 | + )
|
| 245 | + );
|
| 246 | +
|
| 247 | + return $feedback;
|
| 248 | + }
|
| 249 | +
|
| 250 | + /**
|
| 251 | + * Gets the last 25 (or a requested continuance) of activity rows taken
|
| 252 | + * from the log table
|
| 253 | + *
|
| 254 | + * @param string $title the title of the page
|
| 255 | + * @param int $feedbackId identifier for the feedback item we are fetching activity for
|
| 256 | + * @param int $limit total limit number
|
| 257 | + * @param mixed $continue used for offsets
|
| 258 | + * @return array db record rows
|
| 259 | + */
|
| 260 | + protected function fetchActivity( $title, $feedbackId, $limit = 25, $continue = null) {
|
| 261 | +
|
| 262 | + $where = array (
|
| 263 | + 'log_type' => 'articlefeedbackv5',
|
| 264 | + 'log_title' => "ArticleFeedbackv5/$title/$feedbackId"
|
| 265 | + );
|
| 266 | +
|
| 267 | + if ( null !== $continue ) {
|
| 268 | + $where[] = 'log_id < ' . intval($continue);
|
| 269 | + }
|
| 270 | +
|
| 271 | + $dbr = wfGetDB( DB_SLAVE );
|
| 272 | + $activity = $dbr->select(
|
| 273 | + array( 'logging' ),
|
| 274 | + array( 'log_id',
|
| 275 | + 'log_action',
|
| 276 | + 'log_timestamp',
|
| 277 | + 'log_user',
|
| 278 | + 'log_user_text',
|
| 279 | + 'log_title',
|
| 280 | + 'log_comment'),
|
| 281 | + $where,
|
| 282 | + __METHOD__,
|
| 283 | + array(
|
| 284 | + 'LIMIT' => ($limit + 1),
|
| 285 | + 'ORDER BY' => 'log_timestamp DESC'
|
| 286 | + )
|
| 287 | + );
|
| 288 | +
|
| 289 | + return $activity;
|
| 290 | + }
|
| 291 | +
|
| 292 | + /**
|
| 293 | + * Gets the allowed parameters
|
| 294 | + *
|
| 295 | + * @return array the params info, indexed by allowed key
|
| 296 | + */
|
| 297 | + public function getAllowedParams() {
|
| 298 | + return array(
|
| 299 | + 'feedbackid' => array(
|
| 300 | + ApiBase::PARAM_REQUIRED => true,
|
| 301 | + ApiBase::PARAM_TYPE => 'integer',
|
| 302 | + ),
|
| 303 | + 'limit' => array(
|
| 304 | + ApiBase::PARAM_DFLT => 25,
|
| 305 | + ApiBase::PARAM_TYPE => 'limit',
|
| 306 | + ApiBase::PARAM_MIN => 1,
|
| 307 | + ApiBase::PARAM_MAX => ApiBase::LIMIT_BIG1,
|
| 308 | + ApiBase::PARAM_MAX2 => ApiBase::LIMIT_BIG2
|
| 309 | + ),
|
| 310 | + 'continue' => null,
|
| 311 | + );
|
| 312 | + }
|
| 313 | +
|
| 314 | + /**
|
| 315 | + * Gets the parameter descriptions
|
| 316 | + *
|
| 317 | + * @return array the descriptions, indexed by allowed key
|
| 318 | + */
|
| 319 | + public function getParamDescription() {
|
| 320 | + return array(
|
| 321 | + 'feedbackid' => 'ID to get feedback activity for',
|
| 322 | + 'limit' => 'How many activity results to return',
|
| 323 | + 'continue' => 'When more results are available, use this to continue',
|
| 324 | + );
|
| 325 | + }
|
| 326 | +
|
| 327 | + /**
|
| 328 | + * Gets the api descriptions
|
| 329 | + *
|
| 330 | + * @return array the description as the first element in an array
|
| 331 | + */
|
| 332 | + public function getDescription() {
|
| 333 | + return array(
|
| 334 | + 'List article feedback activity for a specified page'
|
| 335 | + );
|
| 336 | + }
|
| 337 | +
|
| 338 | + /**
|
| 339 | + * Gets an example
|
| 340 | + *
|
| 341 | + * @return array the example as the first element in an array
|
| 342 | + */
|
| 343 | + protected function getExamples() {
|
| 344 | + return array(
|
| 345 | + 'api.php?action=query&list=articlefeedbackv5-view-activity&affeedbackid=1',
|
| 346 | + );
|
| 347 | + }
|
| 348 | +
|
| 349 | + /**
|
| 350 | + * Gets the version info
|
| 351 | + *
|
| 352 | + * @return string the SVN version info
|
| 353 | + */
|
| 354 | + public function getVersion() {
|
| 355 | + return __CLASS__ . ': $Id$';
|
| 356 | + }
|
| 357 | +
|
| 358 | + /**
|
| 359 | + * Creates a user link for a log row
|
| 360 | + *
|
| 361 | + * @param stdClass $item row from log table db
|
| 362 | + * @return string the SVN version info
|
| 363 | + */
|
| 364 | + protected function getUserLink($user_id, $user_ip) {
|
| 365 | + $userId = (int) $user_id;
|
| 366 | + if ( $userId !== 0 ) { // logged-in users
|
| 367 | + $user = User::newFromId( $userId );
|
| 368 | + } else { // IP users
|
| 369 | + $userText = $user_ip;
|
| 370 | + $user = User::newFromName( $userText, false );
|
| 371 | + }
|
| 372 | +
|
| 373 | + $element = Linker::userLink(
|
| 374 | + $user->getId(),
|
| 375 | + $user->getName()
|
| 376 | + );
|
| 377 | + return $element;
|
| 378 | + }
|
| 379 | +}
|
| 380 | +
|
Property changes on: trunk/extensions/ArticleFeedbackv5/api/ApiViewActivityArticleFeedbackv5.php |
___________________________________________________________________ |
Added: svn:keywords |
1 | 381 | + Id |