Index: trunk/phase3/includes/SpecialUndelete.php |
— | — | @@ -675,7 +675,7 @@ |
676 | 676 | } |
677 | 677 | |
678 | 678 | /* private */ function showHistory() { |
679 | | - global $wgLang, $wgUser, $wgOut; |
| 679 | + global $wgLang, $wgContLang, $wgUser, $wgOut; |
680 | 680 | |
681 | 681 | $sk = $wgUser->getSkin(); |
682 | 682 | if ( $this->mAllowed ) { |
— | — | @@ -701,10 +701,10 @@ |
702 | 702 | # List all stored revisions |
703 | 703 | $revisions = $archive->listRevisions(); |
704 | 704 | $files = $archive->listFiles(); |
705 | | - |
| 705 | + |
706 | 706 | $haveRevisions = $revisions && $revisions->numRows() > 0; |
707 | 707 | $haveFiles = $files && $files->numRows() > 0; |
708 | | - |
| 708 | + |
709 | 709 | # Batch existence check on user and talk pages |
710 | 710 | if( $haveRevisions ) { |
711 | 711 | $batch = new LinkBatch(); |
— | — | @@ -729,7 +729,7 @@ |
730 | 730 | $titleObj = SpecialPage::getTitleFor( "Undelete" ); |
731 | 731 | $action = $titleObj->getLocalURL( "action=submit" ); |
732 | 732 | # Start the form here |
733 | | - $top = wfOpenElement( 'form', array( 'method' => 'post', 'action' => $action, 'id' => 'undelete' ) ); |
| 733 | + $top = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action, 'id' => 'undelete' ) ); |
734 | 734 | $wgOut->addHtml( $top ); |
735 | 735 | } |
736 | 736 | |
— | — | @@ -746,21 +746,40 @@ |
747 | 747 | ), LogViewer::NO_ACTION_LINK |
748 | 748 | ); |
749 | 749 | $logViewer->showList( $wgOut ); |
750 | | - |
| 750 | + |
751 | 751 | if( $this->mAllowed && ( $haveRevisions || $haveFiles ) ) { |
752 | 752 | # Format the user-visible controls (comment field, submission button) |
753 | 753 | # in a nice little table |
754 | | - $table = '<fieldset><table><tr>'; |
755 | | - $table .= '<td colspan="2">' . wfMsgWikiHtml( 'undeleteextrahelp' ) . '</td></tr><tr>'; |
756 | | - $table .= '<td align="right"><strong>' . wfMsgHtml( 'undeletecomment' ) . '</strong></td>'; |
757 | | - $table .= '<td>' . wfInput( 'wpComment', 50, $this->mComment ) . '</td>'; |
758 | | - $table .= '</tr><tr><td> </td><td>'; |
759 | | - $table .= wfSubmitButton( wfMsg( 'undeletebtn' ), array( 'name' => 'restore' ) ); |
760 | | - $table .= wfElement( 'input', array( 'type' => 'reset', 'value' => wfMsg( 'undeletereset' ) ) ); |
761 | | - $table .= '</td></tr></table></fieldset>'; |
| 754 | + $align = $wgContLang->isRtl() ? 'left' : 'right'; |
| 755 | + $table = |
| 756 | + Xml::openElement( 'fieldset' ) . |
| 757 | + Xml::openElement( 'table' ) . |
| 758 | + "<tr> |
| 759 | + <td colspan='2'>" . |
| 760 | + wfMsgWikiHtml( 'undeleteextrahelp' ) . |
| 761 | + "</td> |
| 762 | + </tr> |
| 763 | + <tr> |
| 764 | + <td align='$align'>" . |
| 765 | + Xml::label( wfMsg( 'undeletecomment' ), 'wpComment' ) . |
| 766 | + "</td> |
| 767 | + <td>" . |
| 768 | + Xml::input( 'wpComment', 50, $this->mComment ) . |
| 769 | + "</td> |
| 770 | + </tr> |
| 771 | + <tr> |
| 772 | + <td> </td> |
| 773 | + <td>" . |
| 774 | + Xml::submitButton( wfMsg( 'undeletebtn' ), array( 'name' => 'restore', 'id' => 'mw-undelete-submit' ) ) . |
| 775 | + Xml::element( 'input', array( 'type' => 'reset', 'value' => wfMsg( 'undeletereset' ), 'id' => 'mw-undelete-reset' ) ) . |
| 776 | + "</td> |
| 777 | + </tr>" . |
| 778 | + Xml::closeElement( 'table' ) . |
| 779 | + Xml::closeElement( 'fieldset' ); |
| 780 | + |
762 | 781 | $wgOut->addHtml( $table ); |
763 | 782 | } |
764 | | - |
| 783 | + |
765 | 784 | $wgOut->addHTML( "<h2>" . htmlspecialchars( wfMsg( "history" ) ) . "</h2>\n" ); |
766 | 785 | |
767 | 786 | if( $haveRevisions ) { |
— | — | @@ -770,7 +789,7 @@ |
771 | 790 | while( $row = $revisions->fetchObject() ) { |
772 | 791 | $ts = wfTimestamp( TS_MW, $row->ar_timestamp ); |
773 | 792 | if ( $this->mAllowed ) { |
774 | | - $checkBox = wfCheck( "ts$ts" ); |
| 793 | + $checkBox = Xml::check( "ts$ts" ); |
775 | 794 | $pageLink = $sk->makeKnownLinkObj( $titleObj, |
776 | 795 | $wgLang->timeanddate( $ts, true ), |
777 | 796 | "target=$target×tamp=$ts" ); |
— | — | @@ -789,7 +808,7 @@ |
790 | 809 | } |
791 | 810 | $comment = $sk->commentBlock( $row->ar_comment ); |
792 | 811 | $wgOut->addHTML( "<li>$checkBox $pageLink . . $userLink $stxt $comment</li>\n" ); |
793 | | - |
| 812 | + |
794 | 813 | } |
795 | 814 | $revisions->free(); |
796 | 815 | $wgOut->addHTML("</ul>"); |
— | — | @@ -797,14 +816,13 @@ |
798 | 817 | $wgOut->addWikiText( wfMsg( "nohistory" ) ); |
799 | 818 | } |
800 | 819 | |
801 | | - |
802 | 820 | if( $haveFiles ) { |
803 | 821 | $wgOut->addHtml( "<h2>" . wfMsgHtml( 'filehist' ) . "</h2>\n" ); |
804 | 822 | $wgOut->addHtml( "<ul>" ); |
805 | 823 | while( $row = $files->fetchObject() ) { |
806 | 824 | $ts = wfTimestamp( TS_MW, $row->fa_timestamp ); |
807 | 825 | if ( $this->mAllowed && $row->fa_storage_key ) { |
808 | | - $checkBox = wfCheck( "fileid" . $row->fa_id ); |
| 826 | + $checkBox = Xml::check( "fileid" . $row->fa_id ); |
809 | 827 | $key = urlencode( $row->fa_storage_key ); |
810 | 828 | $target = urlencode( $this->mTarget ); |
811 | 829 | $pageLink = $sk->makeKnownLinkObj( $titleObj, |
— | — | @@ -828,12 +846,13 @@ |
829 | 847 | $files->free(); |
830 | 848 | $wgOut->addHTML( "</ul>" ); |
831 | 849 | } |
832 | | - |
| 850 | + |
833 | 851 | if ( $this->mAllowed ) { |
834 | 852 | # Slip in the hidden controls here |
835 | | - $misc = wfHidden( 'target', $this->mTarget ); |
836 | | - $misc .= wfHidden( 'wpEditToken', $wgUser->editToken() ); |
837 | | - $wgOut->addHtml( $misc . '</form>' ); |
| 853 | + $misc = Xml::hidden( 'target', $this->mTarget ); |
| 854 | + $misc .= Xml::hidden( 'wpEditToken', $wgUser->editToken() ); |
| 855 | + $misc .= Xml::closeElement( 'form' ); |
| 856 | + $wgOut->addHtml( $misc ); |
838 | 857 | } |
839 | 858 | |
840 | 859 | return true; |