Index: trunk/phase3/includes/HistoryPage.php |
— | — | @@ -382,6 +382,19 @@ |
383 | 383 | return $s; |
384 | 384 | } |
385 | 385 | |
| 386 | + function doBatchLookups() { |
| 387 | + # Do a link batch query |
| 388 | + $this->mResult->seek( 0 ); |
| 389 | + $batch = new LinkBatch(); |
| 390 | + # Give some pointers to make (last) links |
| 391 | + foreach ( $this->mResult as $row ) { |
| 392 | + $batch->addObj( Title::makeTitleSafe( NS_USER, $row->rev_user_name ) ); |
| 393 | + $batch->addObj( Title::makeTitleSafe( NS_USER_TALK, $row->rev_user_name ) ); |
| 394 | + } |
| 395 | + $batch->execute(); |
| 396 | + $this->mResult->seek( 0 ); |
| 397 | + } |
| 398 | + |
386 | 399 | /** |
387 | 400 | * Creates begin of history list with a submit button |
388 | 401 | * |
Index: trunk/phase3/includes/Pager.php |
— | — | @@ -325,10 +325,13 @@ |
326 | 326 | * |
327 | 327 | * @return String |
328 | 328 | */ |
329 | | - function getBody() { |
| 329 | + public function getBody() { |
330 | 330 | if ( !$this->mQueryDone ) { |
331 | 331 | $this->doQuery(); |
332 | 332 | } |
| 333 | + # Do any special query batches before display |
| 334 | + $this->doBatchLookups(); |
| 335 | + |
333 | 336 | # Don't use any extra rows returned by the query |
334 | 337 | $numRows = min( $this->mResult->numRows(), $this->mLimit ); |
335 | 338 | |
— | — | @@ -385,12 +388,20 @@ |
386 | 389 | } |
387 | 390 | |
388 | 391 | /** |
| 392 | + * Called from getBody(), before getStartBody() is called. This |
| 393 | + * will be called even if there are no rows in the result set. |
| 394 | + * |
| 395 | + * @return void |
| 396 | + */ |
| 397 | + protected function doBatchLookups() {} |
| 398 | + |
| 399 | + /** |
389 | 400 | * Hook into getBody(), allows text to be inserted at the start. This |
390 | 401 | * will be called even if there are no rows in the result set. |
391 | 402 | * |
392 | 403 | * @return String |
393 | 404 | */ |
394 | | - function getStartBody() { |
| 405 | + protected function getStartBody() { |
395 | 406 | return ''; |
396 | 407 | } |
397 | 408 | |
— | — | @@ -399,7 +410,7 @@ |
400 | 411 | * |
401 | 412 | * @return String |
402 | 413 | */ |
403 | | - function getEndBody() { |
| 414 | + protected function getEndBody() { |
404 | 415 | return ''; |
405 | 416 | } |
406 | 417 | |
— | — | @@ -409,7 +420,7 @@ |
410 | 421 | * |
411 | 422 | * @return String |
412 | 423 | */ |
413 | | - function getEmptyBody() { |
| 424 | + protected function getEmptyBody() { |
414 | 425 | return ''; |
415 | 426 | } |
416 | 427 | |