Index: trunk/phase3/includes/RecentChange.php |
— | — | @@ -585,6 +585,10 @@ |
586 | 586 | return isset( $this->mAttribs[$name] ) ? $this->mAttribs[$name] : NULL; |
587 | 587 | } |
588 | 588 | |
| 589 | + public function getAttributes() { |
| 590 | + return $this->mAttribs; |
| 591 | + } |
| 592 | + |
589 | 593 | /** |
590 | 594 | * Gets the end part of the diff URL associated with this object |
591 | 595 | * Blank if no diff link should be displayed |
Index: trunk/phase3/includes/api/ApiQueryRecentChanges.php |
— | — | @@ -82,6 +82,23 @@ |
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
| 86 | + * Sets internal state to include the desired properties in the output. |
| 87 | + * @param $prop associative array of properties, only keys are used here |
| 88 | + */ |
| 89 | + public function initProperties( $prop ) { |
| 90 | + $this->fld_comment = isset ($prop['comment']); |
| 91 | + $this->fld_user = isset ($prop['user']); |
| 92 | + $this->fld_flags = isset ($prop['flags']); |
| 93 | + $this->fld_timestamp = isset ($prop['timestamp']); |
| 94 | + $this->fld_title = isset ($prop['title']); |
| 95 | + $this->fld_ids = isset ($prop['ids']); |
| 96 | + $this->fld_sizes = isset ($prop['sizes']); |
| 97 | + $this->fld_redirect = isset($prop['redirect']); |
| 98 | + $this->fld_patrolled = isset($prop['patrolled']); |
| 99 | + $this->fld_loginfo = isset($prop['loginfo']); |
| 100 | + } |
| 101 | + |
| 102 | + /** |
86 | 103 | * Generates and outputs the result of this query based upon the provided parameters. |
87 | 104 | */ |
88 | 105 | public function execute() { |
— | — | @@ -164,16 +181,7 @@ |
165 | 182 | $prop = array_flip($params['prop']); |
166 | 183 | |
167 | 184 | /* Set up internal members based upon params. */ |
168 | | - $this->fld_comment = isset ($prop['comment']); |
169 | | - $this->fld_user = isset ($prop['user']); |
170 | | - $this->fld_flags = isset ($prop['flags']); |
171 | | - $this->fld_timestamp = isset ($prop['timestamp']); |
172 | | - $this->fld_title = isset ($prop['title']); |
173 | | - $this->fld_ids = isset ($prop['ids']); |
174 | | - $this->fld_sizes = isset ($prop['sizes']); |
175 | | - $this->fld_redirect = isset($prop['redirect']); |
176 | | - $this->fld_patrolled = isset($prop['patrolled']); |
177 | | - $this->fld_loginfo = isset($prop['loginfo']); |
| 185 | + $this->initProperties( $prop ); |
178 | 186 | |
179 | 187 | global $wgUser; |
180 | 188 | if($this->fld_patrolled && !$wgUser->useRCPatrol() && !$wgUser->useNPPatrol()) |
— | — | @@ -245,9 +253,9 @@ |
246 | 254 | * |
247 | 255 | * @param $row The row from which to extract the data. |
248 | 256 | * @return An array mapping strings (descriptors) to their respective string values. |
249 | | - * @access private |
| 257 | + * @access public |
250 | 258 | */ |
251 | | - private function extractRowInfo($row) { |
| 259 | + public function extractRowInfo($row) { |
252 | 260 | /* If page was moved somewhere, get the title of the move target. */ |
253 | 261 | $movedToTitle = false; |
254 | 262 | if (isset($row->rc_moved_to_title) && $row->rc_moved_to_title !== '') |