r41829 - Code Review

From MediaWiki.org

Jump to: navigation, search
Repository:MediaWiki
Revision:r41828 | r41829 (on ViewVC) | r41830 >
Date:02:29, 8 October 2008
Author:aaron
Status:resolved (Comments)
Tags:
Comment:(bug 11904) Add edit links to template list on edit form
Modified paths:

Diff [purge]

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>';
 		}

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

Views
Toolbox