r41829 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41828‎ | r41829 | r41830 >
Date:02:29, 8 October 2008
Author:aaron
Status:old (Comments)
Tags:
Comment:
(bug 11904) Add edit links to template list on edit form
Modified paths:
  • /trunk/phase3/includes/Linker.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Linker.php
@@ -1639,7 +1639,12 @@
16401640 } else {
16411641 $protected = '';
16421642 }
1643 - $outText .= '<li>' . $sk->link( $titleObj ) . ' ' . $protected . '</li>';
 1643+ if( $titleObj->quickUserCan( 'edit' ) ) {
 1644+ $editLink = $sk->makeLinkObj( $titleObj, wfMsg('editold'), 'action=edit' );
 1645+ } else {
 1646+ $editLink = $sk->makeLinkObj( $titleObj, wfMsg('viewsourceold'), 'action=edit' );
 1647+ }
 1648+ $outText .= '<li>' . $sk->link( $titleObj ) . ' (' . $editLink . ') ' . $protected . '</li>';
16441649 }
16451650 $outText .= '</ul>';
16461651 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r41924Tweak r41829 to use new messagesaaron06:16, 10 October 2008

Comments

#Comment by Brion VIBBER (talk | contribs)   20:51, 8 October 2008

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.

#Comment by Voice of All (talk | contribs)   06:16, 10 October 2008

Fixed r41924

Status & tagging log