Index: trunk/phase3/includes/SpecialUndelete.php |
— | — | @@ -701,7 +701,8 @@ |
702 | 702 | $wgOut->addHTML( "<ul>\n" ); |
703 | 703 | while( $row = $result->fetchObject() ) { |
704 | 704 | $title = Title::makeTitleSafe( $row->ar_namespace, $row->ar_title ); |
705 | | - $link = $sk->makeKnownLinkObj( $undelete, htmlspecialchars( $title->getPrefixedText() ), 'target=' . $title->getPrefixedUrl() ); |
| 705 | + $link = $sk->makeKnownLinkObj( $undelete, htmlspecialchars( $title->getPrefixedText() ), |
| 706 | + 'target=' . $title->getPrefixedUrl() ); |
706 | 707 | #$revs = wfMsgHtml( 'undeleterevisions', $wgLang->formatNum( $row->count ) ); |
707 | 708 | $revs = wfMsgExt( 'undeleterevisions', |
708 | 709 | array( 'parseinline' ), |
— | — | @@ -1019,7 +1020,7 @@ |
1020 | 1021 | |
1021 | 1022 | while( $row = $revisions->fetchObject() ) { |
1022 | 1023 | $remaining--; |
1023 | | - $wgOut->addHTML( $this->formatRevisionRow( $row , $sk ) ); |
| 1024 | + $wgOut->addHTML( $this->formatRevisionRow( $row, $earliestLiveTime, $remaining, $sk ) ); |
1024 | 1025 | } |
1025 | 1026 | $revisions->free(); |
1026 | 1027 | $wgOut->addHTML("</ul>"); |
— | — | @@ -1048,7 +1049,7 @@ |
1049 | 1050 | return true; |
1050 | 1051 | } |
1051 | 1052 | |
1052 | | - private function formatRevisionRow( $row, $sk ) { |
| 1053 | + private function formatRevisionRow( $row, $earliestLiveTime, $remaining, $sk ) { |
1053 | 1054 | global $wgUser, $wgLang; |
1054 | 1055 | |
1055 | 1056 | $rev = new Revision( array( |
— | — | @@ -1071,9 +1072,11 @@ |
1072 | 1073 | # Last link |
1073 | 1074 | if( !$rev->userCan( Revision::DELETED_TEXT ) ) { |
1074 | 1075 | $last = wfMsgHtml('diff'); |
| 1076 | + } else if( $remaining > 0 || ($earliestLiveTime && $ts > $earliestLiveTime) ) { |
| 1077 | + $last = $sk->makeKnownLinkObj( $titleObj, wfMsgHtml('diff'), |
| 1078 | + "target=" . $this->mTargetObj->getPrefixedUrl() . "×tamp=$ts&diff=prev" ); |
1075 | 1079 | } else { |
1076 | | - $last = $sk->makeKnownLinkObj( $titleObj, wfMsgHtml('diff'), |
1077 | | - "target=" . $this->mTarget . "×tamp=" . $row->ar_timestamp . "&diff=prev" ); |
| 1080 | + $last = wfMsgHtml('diff'); |
1078 | 1081 | } |
1079 | 1082 | } else { |
1080 | 1083 | $checkBox = ''; |
— | — | @@ -1095,10 +1098,10 @@ |
1096 | 1099 | // If revision was hidden from sysops |
1097 | 1100 | $del = wfMsgHtml('rev-delundel'); |
1098 | 1101 | } else { |
| 1102 | + $ts = wfTimestamp( TS_MW, $row->ar_timestamp ); |
1099 | 1103 | $del = $sk->makeKnownLinkObj( $revdel, |
1100 | 1104 | wfMsgHtml('rev-delundel'), |
1101 | | - 'target=' . urlencode( $this->mTarget ) . |
1102 | | - '&artimestamp=' . urlencode( $row->ar_timestamp ) ); |
| 1105 | + 'target=' . $this->mTargetObj->getPrefixedUrl() . "&artimestamp=$ts" ); |
1103 | 1106 | // Bolden oversighted content |
1104 | 1107 | if( $rev->isDeleted( Revision::DELETED_RESTRICTED ) ) |
1105 | 1108 | $del = "<strong>$del</strong>"; |
— | — | @@ -1143,8 +1146,8 @@ |
1144 | 1147 | } else { |
1145 | 1148 | $del = $sk->makeKnownLinkObj( $revdel, |
1146 | 1149 | wfMsgHtml('rev-delundel'), |
1147 | | - 'target=' . urlencode( $this->mTarget ) . |
1148 | | - '&fileid=' . urlencode( $row->fa_id ) ); |
| 1150 | + 'target=' . $this->mTargetObj->getPrefixedUrl() . |
| 1151 | + '&fileid=' . $row->fa_id ); |
1149 | 1152 | // Bolden oversighted content |
1150 | 1153 | if( $file->isDeleted( File::DELETED_RESTRICTED ) ) |
1151 | 1154 | $del = "<strong>$del</strong>"; |
— | — | @@ -1176,7 +1179,8 @@ |
1177 | 1180 | if( !$rev->userCan(Revision::DELETED_TEXT) ) { |
1178 | 1181 | return '<span class="history-deleted">' . $wgLang->timeanddate( $ts, true ) . '</span>'; |
1179 | 1182 | } else { |
1180 | | - $link = $sk->makeKnownLinkObj( $titleObj, $wgLang->timeanddate( $ts, true ), "target={$this->mTarget}×tamp=$ts" ); |
| 1183 | + $link = $sk->makeKnownLinkObj( $titleObj, $wgLang->timeanddate( $ts, true ), |
| 1184 | + "target=".$this->mTargetObj->getPrefixedUrl()."×tamp=$ts" ); |
1181 | 1185 | if( $rev->isDeleted(Revision::DELETED_TEXT) ) |
1182 | 1186 | $link = '<span class="history-deleted">' . $link . '</span>'; |
1183 | 1187 | return $link; |
— | — | @@ -1193,7 +1197,8 @@ |
1194 | 1198 | if( !$file->userCan(File::DELETED_FILE) ) { |
1195 | 1199 | return '<span class="history-deleted">' . $wgLang->timeanddate( $ts, true ) . '</span>'; |
1196 | 1200 | } else { |
1197 | | - $link = $sk->makeKnownLinkObj( $titleObj, $wgLang->timeanddate( $ts, true ), "target={$this->mTarget}&file=$key" ); |
| 1201 | + $link = $sk->makeKnownLinkObj( $titleObj, $wgLang->timeanddate( $ts, true ), |
| 1202 | + "target=".$this->mTargetObj->getPrefixedUrl()."&file=$key" ); |
1198 | 1203 | if( $file->isDeleted(File::DELETED_FILE) ) |
1199 | 1204 | $link = '<span class="history-deleted">' . $link . '</span>'; |
1200 | 1205 | return $link; |