r96167 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96166‎ | r96167 | r96168 >
Date:00:37, 3 September 2011
Author:preilly
Status:ok (Comments)
Tags:
Comment:
add page link as $1 in feedback notice message
Modified paths:
  • /trunk/extensions/MobileFrontend/MobileFrontend.i18n.php (modified) (history)
  • /trunk/extensions/MobileFrontend/MobileFrontend.php (modified) (history)
  • /trunk/extensions/MobileFrontend/views/information/leave_feedback.html.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/MobileFrontend.i18n.php
@@ -59,7 +59,7 @@
6060 'mobile-frontend-featured-article' => 'Today\'s Featured Article',
6161 'mobile-frontend-news-items' => 'In The News',
6262 'mobile-frontend-leave-feedback-title' => 'Leave feedback about Mobile Frontend',
63 - 'mobile-frontend-leave-feedback-notice' => 'Your feedback will be posted publicly, along with your user name, browser version and operating system to the page ',
 63+ 'mobile-frontend-leave-feedback-notice' => 'Your feedback will be posted publicly, along with your user name, browser version and operating system to the page $1',
6464 'mobile-frontend-leave-feedback-subject' => 'Subject',
6565 'mobile-frontend-leave-feedback-message' => 'Message',
6666 'mobile-frontend-leave-feedback-cancel' => 'Cancel',
Index: trunk/extensions/MobileFrontend/MobileFrontend.php
@@ -65,7 +65,7 @@
6666 );
6767
6868 class ExtMobileFrontend {
69 - const VERSION = '0.5.53';
 69+ const VERSION = '0.5.54';
7070
7171 /**
7272 * @var DOMDocument
@@ -206,7 +206,14 @@
207207 self::$messages['mobile-frontend-copyright'] = $copyright;
208208
209209 foreach ( self::$messageKeys as $messageKey ) {
210 - self::$messages[$messageKey] = wfMsg( $messageKey );
 210+
 211+ if ( $messageKey == 'mobile-frontend-leave-feedback-notice' ) {
 212+ $scriptUrl = wfScript();
 213+ $linkText = wfMsg( 'mobile-frontend-leave-feedback-link-text' );
 214+ self::$messages[$messageKey] = wfMsg( $messageKey, "&quot;<a href=\"{$scriptUrl}?title=MobileFrontend_Extension_Feedback\" target=\"_blank\">{$linkText}</a>&quot;" );
 215+ } else {
 216+ self::$messages[$messageKey] = wfMsg( $messageKey );
 217+ }
211218 }
212219
213220 self::$dir = $wgContLang->getDir();
Index: trunk/extensions/MobileFrontend/views/information/leave_feedback.html.php
@@ -1,7 +1,5 @@
22 <?php
33
4 -$scriptUrl = wfScript();
5 -
64 $leaveFeedbackHtml = <<<EOT
75 <form action='{$feedbackPostURL}' method='post'>
86 <input type="hidden" name="edittoken" value="{$editToken}"/>
@@ -11,7 +9,7 @@
1210 </div>
1311 <div>
1412 <div>
15 - <div><p><small>{$notice} "<a href="{$scriptUrl}?title=MobileFrontend_Extension_Feedback" target="_blank">{$linkText}</a>"</small>
 13+ <div><p><small>{$notice}</small>
1614 </p></div>
1715 <div><p>{$subject}:<br><input type="text" name="subject" maxlength="60" style="width:40%;"></p>
1816 </div>

Follow-up revisions

RevisionCommit summaryAuthorDate
r96352fix for r96167 title hackpreilly17:12, 6 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r96128fix two part messagepreilly17:11, 2 September 2011

Comments

#Comment by Dantman (talk | contribs)   01:53, 3 September 2011
  • I think those "'s should be moved into the message.
  • The whole hardcoded <a, ?title= is horrid, while were at it by using wfMsg for $linkText doesn't that make 'mobile-frontend-leave-feedback-link-text' end up as html, not text.

One of these perhaps: <script lang=php> Linker::link( Title::newFromText( 'MobileFrontend Extension Feedback' ), htmlspecialchars( $linkText ), array( 'target' => '_blank' ) ) Html::element( 'a', array( 'href' => Title::newFromText( 'MobileFrontend Extension Feedback' )->getFullURL(), 'target' => '_blank' ), $linkText ); </script>

Actually while I'm at it. Shouldn't 'MobileFrontend Extension Feedback' be given a message of it's own too.

#Comment by Preilly (talk | contribs)   17:19, 6 September 2011

This should now be fixed in r96352.

Status & tagging log