r51084 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51083‎ | r51084 | r51085 >
Date:20:35, 27 May 2009
Author:siebrand
Status:resolved (Comments)
Tags:
Comment:
Fix a usability issue on protect and [file ]delete forms. "Edit ... reasons" link now contains action=edit to save a click.
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/FileDeleteForm.php (modified) (history)
  • /trunk/phase3/includes/ProtectionForm.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ProtectionForm.php
@@ -447,8 +447,13 @@
448448 $out .= Xml::closeElement( 'fieldset' );
449449
450450 if ( $wgUser->isAllowed( 'editinterface' ) ) {
451 - $linkTitle = Title::makeTitleSafe( NS_MEDIAWIKI, 'protect-dropdown' );
452 - $link = $wgUser->getSkin()->Link ( $linkTitle, wfMsgHtml( 'protect-edit-reasonlist' ) );
 451+ $title = Title::newFromText( 'protect-dropdown', NS_MEDIAWIKI );
 452+ $link = $wgUser->getSkin()->link(
 453+ $title,
 454+ wfMsgHtml( 'protect-edit-reasonlist' ),
 455+ array(),
 456+ array( 'action' => 'edit' )
 457+ );
453458 $out .= '<p class="mw-protect-editreasons">' . $link . '</p>';
454459 }
455460
Index: trunk/phase3/includes/Article.php
@@ -2469,7 +2469,13 @@
24702470
24712471 if( $wgUser->isAllowed( 'editinterface' ) ) {
24722472 $skin = $wgUser->getSkin();
2473 - $link = $skin->makeLink ( 'MediaWiki:Deletereason-dropdown', wfMsgHtml( 'delete-edit-reasonlist' ) );
 2473+ $title = Title::newFromText( 'Deletereason-dropdown', NS_MEDIAWIKI );
 2474+ $link = $skin->link(
 2475+ $title,
 2476+ wfMsgHtml( 'delete-edit-reasonlist' ),
 2477+ array(),
 2478+ array( 'action' => 'edit' )
 2479+ );
24742480 $form .= '<p class="mw-delete-editreasons">' . $link . '</p>';
24752481 }
24762482
Index: trunk/phase3/includes/FileDeleteForm.php
@@ -194,7 +194,13 @@
195195
196196 if ( $wgUser->isAllowed( 'editinterface' ) ) {
197197 $skin = $wgUser->getSkin();
198 - $link = $skin->makeLink ( 'MediaWiki:Filedelete-reason-dropdown', wfMsgHtml( 'filedelete-edit-reasonlist' ) );
 198+ $title = Title::newFromText( 'filedelete-reason-dropdown', NS_MEDIAWIKI );
 199+ $link = $skin->link(
 200+ $title,
 201+ wfMsgHtml( 'filedelete-edit-reasonlist' ),
 202+ array(),
 203+ array( 'action' => 'edit' )
 204+ );
199205 $form .= '<p class="mw-filedelete-editreasons">' . $link . '</p>';
200206 }
201207

Follow-up revisions

RevisionCommit summaryAuthorDate
r51493Follow-up to r51084:...siebrand07:33, 5 June 2009
r51502Fix for r51493, r51084 and realted: use Title::makeTitle() rather than Title:...ialex13:12, 5 June 2009

Comments

#Comment by Splarka (talk | contribs)   23:29, 4 June 2009

if $wgCapitalLinks is false, the protect and filedelete links link to the lowercase version of these messages.

$title = Title::newFromText( 'Protect-dropdown', NS_MEDIAWIKI );
$title = Title::newFromText( 'Filedelete-reason-dropdown', NS_MEDIAWIKI );
#Comment by Siebrand (talk | contribs)   07:34, 5 June 2009

Fixed in r51493. Thanks.

Status & tagging log