Index: trunk/extensions/ApprovedRevs/SpecialApprovedRevs.php |
— | — | @@ -144,18 +144,43 @@ |
145 | 145 | $pageLink = $skin->makeLinkObj( $title ); |
146 | 146 | if ( $this->mMode == 'unapproved' ) { |
147 | 147 | return $pageLink; |
| 148 | + } elseif ( $this->mMode == 'notlatest' ) { |
| 149 | + $diffLink = Xml::element( 'a', |
| 150 | + array( 'href' => $title->getLocalUrl( |
| 151 | + array( |
| 152 | + 'diff' => $result->latest_id, |
| 153 | + 'oldid' => $result->rev_id |
| 154 | + ) |
| 155 | + ) ), |
| 156 | + wfMsg( 'approvedrevs-difffromlatest' ) |
| 157 | + ); |
| 158 | + return "$pageLink ($diffLink)"; |
148 | 159 | } else { |
| 160 | + global $wgUser, $wgOut, $wgLang; |
149 | 161 | if ( $result->rev_id == $result->latest_id ) { |
150 | 162 | $class = "approvedRevIsLatest"; |
151 | 163 | } else { |
152 | 164 | $class = "approvedRevNotLatest"; |
153 | 165 | } |
154 | | - return $pageLink . ' (' . |
155 | | - Xml::element( 'span', |
156 | | - array ( 'class' => $class ), |
157 | | - wfMsg( 'approvedrevs-revisionnumber', $result->rev_id ) |
158 | | - ) . |
159 | | - ')'; |
| 166 | + $additionalInfo = Xml::element( 'span', |
| 167 | + array ( 'class' => $class ), |
| 168 | + wfMsg( 'approvedrevs-revisionnumber', $result->rev_id ) |
| 169 | + ); |
| 170 | + |
| 171 | + // Get data on the most recent approval from the |
| 172 | + // 'approval' log, and display it if it's there. |
| 173 | + $sk = $wgUser->getSkin(); |
| 174 | + $loglist = new LogEventsList( $sk, $wgOut ); |
| 175 | + $pager = new LogPager( $loglist, array( 'approval' ), '', $title->getText() ); |
| 176 | + $pager->mLimit = 1; |
| 177 | + $pager->doQuery(); |
| 178 | + $row = $pager->mResult->fetchObject(); |
| 179 | + if ( !empty( $row ) ) { |
| 180 | + $time = $wgLang->timeanddate( wfTimestamp( TS_MW, $row->log_timestamp ), true ); |
| 181 | + $userLink = $sk->userLink( $row->log_user, $row->user_name ); |
| 182 | + $additionalInfo .= ', ' . wfMsg( 'approvedrevs-approvedby', $userLink, $time ); |
| 183 | + } |
| 184 | + return "$pageLink ($additionalInfo)"; |
160 | 185 | } |
161 | 186 | } |
162 | 187 | } |