For MediaWiki (recent comments | status changes | tags | authors | states | release notes)
Index: trunk/phase3/includes/Linker.php =================================================================== --- trunk/phase3/includes/Linker.php (revision 41828) +++ trunk/phase3/includes/Linker.php (revision 41829) @@ -1639,7 +1639,12 @@ } else { $protected = ''; } - $outText .= '<li>' . $sk->link( $titleObj ) . ' ' . $protected . '</li>'; + if( $titleObj->quickUserCan( 'edit' ) ) { + $editLink = $sk->makeLinkObj( $titleObj, wfMsg('editold'), 'action=edit' ); + } else { + $editLink = $sk->makeLinkObj( $titleObj, wfMsg('viewsourceold'), 'action=edit' ); + } + $outText .= '<li>' . $sk->link( $titleObj ) . ' (' . $editLink . ') ' . $protected . '</li>'; } $outText .= '</ul>'; }
Seems to work well, but I'm a bit leery of why 'editold' and 'viewsourceold' are used here.
These seem to be meant for the version-specific edit links in diff view, so might well be customized or changed in future to say something like "Edit this version", which wouldn't be suitable.
Either use a more general edit message (used for general edit links, not specifically for diff old version links) or create a new one for this usage.
Fixed r41924