Index: trunk/phase3/includes/api/ApiQueryRecentChanges.php |
— | — | @@ -180,6 +180,7 @@ |
181 | 181 | $this->fld_sizes = isset ($prop['sizes']); |
182 | 182 | $this->fld_redirect = isset($prop['redirect']); |
183 | 183 | $this->fld_patrolled = isset($prop['patrolled']); |
| 184 | + $this->fld_loginfo = isset($prop['loginfo']); |
184 | 185 | |
185 | 186 | global $wgUser; |
186 | 187 | if($this->fld_patrolled && !$wgUser->isAllowed('patrol')) |
— | — | @@ -198,6 +199,10 @@ |
199 | 200 | $this->addFieldsIf('rc_old_len', $this->fld_sizes); |
200 | 201 | $this->addFieldsIf('rc_new_len', $this->fld_sizes); |
201 | 202 | $this->addFieldsIf('rc_patrolled', $this->fld_patrolled); |
| 203 | + $this->addFieldsIf('rc_logid', $this->fld_loginfo); |
| 204 | + $this->addFieldsIf('rc_log_type', $this->fld_loginfo); |
| 205 | + $this->addFieldsIf('rc_log_action', $this->fld_loginfo); |
| 206 | + $this->addFieldsIf('rc_params', $this->fld_loginfo); |
202 | 207 | if($this->fld_redirect || isset($show['redirect']) || isset($show['!redirect'])) |
203 | 208 | { |
204 | 209 | $this->addTables('page'); |
— | — | @@ -326,6 +331,15 @@ |
327 | 332 | /* Add the patrolled flag */ |
328 | 333 | if ($this->fld_patrolled && $row->rc_patrolled == 1) |
329 | 334 | $vals['patrolled'] = ''; |
| 335 | + |
| 336 | + if ($this->fld_loginfo && $row->rc_type == RC_LOG) { |
| 337 | + $vals['logid'] = $row->rc_logid; |
| 338 | + $vals['logtype'] = $row->rc_log_type; |
| 339 | + $vals['logaction'] = $row->rc_log_action; |
| 340 | + ApiQueryLogEvents::addLogParams($this->getResult(), |
| 341 | + $vals, $row->rc_params, |
| 342 | + $row->rc_log_type); |
| 343 | + } |
330 | 344 | |
331 | 345 | if(!is_null($this->token)) |
332 | 346 | { |
— | — | @@ -395,7 +409,8 @@ |
396 | 410 | 'ids', |
397 | 411 | 'sizes', |
398 | 412 | 'redirect', |
399 | | - 'patrolled' |
| 413 | + 'patrolled', |
| 414 | + 'loginfo', |
400 | 415 | ) |
401 | 416 | ), |
402 | 417 | 'token' => array( |
Index: trunk/phase3/includes/api/ApiQueryLogEvents.php |
— | — | @@ -134,6 +134,46 @@ |
135 | 135 | $this->getResult()->setIndexedTagName($data, 'item'); |
136 | 136 | $this->getResult()->addValue('query', $this->getModuleName(), $data); |
137 | 137 | } |
| 138 | + |
| 139 | + public static function addLogParams($result, &$vals, $params, $type) { |
| 140 | + $params = explode("\n", $params); |
| 141 | + switch ($type) { |
| 142 | + case 'move': |
| 143 | + if (isset ($params[0])) { |
| 144 | + $title = Title :: newFromText($params[0]); |
| 145 | + if ($title) { |
| 146 | + $vals2 = array(); |
| 147 | + ApiQueryBase :: addTitleInfo($vals2, $title, "new_"); |
| 148 | + $vals[$type] = $vals2; |
| 149 | + $params = null; |
| 150 | + } |
| 151 | + } |
| 152 | + break; |
| 153 | + case 'patrol': |
| 154 | + $vals2 = array(); |
| 155 | + list( $vals2['cur'], $vals2['prev'], $vals2['auto'] ) = $params; |
| 156 | + $vals[$type] = $vals2; |
| 157 | + $params = null; |
| 158 | + break; |
| 159 | + case 'rights': |
| 160 | + $vals2 = array(); |
| 161 | + list( $vals2['old'], $vals2['new'] ) = $params; |
| 162 | + $vals[$type] = $vals2; |
| 163 | + $params = null; |
| 164 | + break; |
| 165 | + case 'block': |
| 166 | + $vals2 = array(); |
| 167 | + list( $vals2['duration'], $vals2['flags'] ) = $params; |
| 168 | + $vals[$type] = $vals2; |
| 169 | + $params = null; |
| 170 | + break; |
| 171 | + } |
| 172 | + if (!is_null($params)) { |
| 173 | + $result->setIndexedTagName($params, 'param'); |
| 174 | + $vals = array_merge($vals, $params); |
| 175 | + } |
| 176 | + return $vals; |
| 177 | + } |
138 | 178 | |
139 | 179 | private function extractRowInfo($row) { |
140 | 180 | $vals = array(); |
— | — | @@ -154,43 +194,8 @@ |
155 | 195 | } |
156 | 196 | |
157 | 197 | if ($this->fld_details && $row->log_params !== '') { |
158 | | - $params = explode("\n", $row->log_params); |
159 | | - switch ($row->log_type) { |
160 | | - case 'move': |
161 | | - if (isset ($params[0])) { |
162 | | - $title = Title :: newFromText($params[0]); |
163 | | - if ($title) { |
164 | | - $vals2 = array(); |
165 | | - ApiQueryBase :: addTitleInfo($vals2, $title, "new_"); |
166 | | - $vals[$row->log_type] = $vals2; |
167 | | - $params = null; |
168 | | - } |
169 | | - } |
170 | | - break; |
171 | | - case 'patrol': |
172 | | - $vals2 = array(); |
173 | | - list( $vals2['cur'], $vals2['prev'], $vals2['auto'] ) = $params; |
174 | | - $vals[$row->log_type] = $vals2; |
175 | | - $params = null; |
176 | | - break; |
177 | | - case 'rights': |
178 | | - $vals2 = array(); |
179 | | - list( $vals2['old'], $vals2['new'] ) = $params; |
180 | | - $vals[$row->log_type] = $vals2; |
181 | | - $params = null; |
182 | | - break; |
183 | | - case 'block': |
184 | | - $vals2 = array(); |
185 | | - list( $vals2['duration'], $vals2['flags'] ) = $params; |
186 | | - $vals[$row->log_type] = $vals2; |
187 | | - $params = null; |
188 | | - break; |
189 | | - } |
190 | | - |
191 | | - if (isset($params)) { |
192 | | - $this->getResult()->setIndexedTagName($params, 'param'); |
193 | | - $vals = array_merge($vals, $params); |
194 | | - } |
| 198 | + self::addLogParams($this->getResult(), $vals, |
| 199 | + $row->log_params, $row->log_type); |
195 | 200 | } |
196 | 201 | |
197 | 202 | if ($this->fld_user) { |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -220,6 +220,7 @@ |
221 | 221 | * (bug 15445) Added action=patrol |
222 | 222 | * (bug 15466) Added action=purge |
223 | 223 | * (bug 15486) action=block ignores autoblock parameter |
| 224 | +* (bug 15492) added rcprop=loginfo to list=recentchanges |
224 | 225 | |
225 | 226 | === Languages updated in 1.14 === |
226 | 227 | |