Index: trunk/phase3/includes/HistoryPage.php |
— | — | @@ -401,44 +401,35 @@ |
402 | 402 | ) . "\n"; |
403 | 403 | |
404 | 404 | if ( $wgUser->isAllowed( 'deleterevision' ) ) { |
405 | | - $this->preventClickjacking(); |
406 | | - $float = $wgContLang->alignEnd(); |
407 | | - # Note bug #20966, <button> is non-standard in IE<8 |
408 | | - $element = Html::element( 'button', |
409 | | - array( |
410 | | - 'type' => 'submit', |
411 | | - 'name' => 'revisiondelete', |
412 | | - 'value' => '1', |
413 | | - 'style' => "float: $float;", |
414 | | - 'class' => 'mw-history-revisiondelete-button', |
415 | | - ), |
416 | | - wfMsg( 'showhideselectedversions' ) |
417 | | - ) . "\n"; |
418 | | - $s .= $element; |
419 | | - $this->buttons .= $element; |
| 405 | + $s .= $this->getRevisionButton( 'revisiondelete', 'showhideselectedversions' ); |
420 | 406 | } |
421 | 407 | if ( $wgUser->isAllowed( 'revisionmove' ) ) { |
422 | | - $this->preventClickjacking(); |
423 | | - $float = $wgContLang->alignEnd(); |
424 | | - # Note bug #20966, <button> is non-standard in IE<8 |
425 | | - $element = Html::element( 'button', |
426 | | - array( |
427 | | - 'type' => 'submit', |
428 | | - 'name' => 'revisionmove', |
429 | | - 'value' => '1', |
430 | | - 'style' => "float: $float;", |
431 | | - 'class' => 'mw-history-revisionmove-button', |
432 | | - ), |
433 | | - wfMsg( 'revisionmoveselectedversions' ) |
434 | | - ) . "\n"; |
435 | | - $s .= $element; |
436 | | - $this->buttons .= $element; |
| 408 | + $s .= $this->getRevisionButton( 'revisionmove', 'revisionmoveselectedversions' ); |
437 | 409 | } |
438 | 410 | $this->buttons .= '</div>'; |
439 | 411 | $s .= '</div><ul id="pagehistory">' . "\n"; |
440 | 412 | return $s; |
441 | 413 | } |
442 | 414 | |
| 415 | + private function getRevisionButton( $name, $msg ) { |
| 416 | + global $wgContLang; |
| 417 | + $this->preventClickjacking(); |
| 418 | + $float = $wgContLang->alignEnd(); |
| 419 | + # Note bug #20966, <button> is non-standard in IE<8 |
| 420 | + $element = Html::element( 'button', |
| 421 | + array( |
| 422 | + 'type' => 'submit', |
| 423 | + 'name' => $name, |
| 424 | + 'value' => '1', |
| 425 | + 'style' => "float: $float;", |
| 426 | + 'class' => "mw-history-$name-button", |
| 427 | + ), |
| 428 | + wfMsg( 'revisionmoveselectedversions' ) |
| 429 | + ) . "\n"; |
| 430 | + $this->buttons .= $element; |
| 431 | + return $element; |
| 432 | + } |
| 433 | + |
443 | 434 | function getEndBody() { |
444 | 435 | if ( $this->lastRow ) { |
445 | 436 | $latest = $this->counter == 1 && $this->mIsFirst; |