r96376 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96375‎ | r96376 | r96377 >
Date:21:51, 6 September 2011
Author:preilly
Status:ok
Tags:
Comment:
add confirmation notice after feedback submission
Modified paths:
  • /trunk/extensions/MobileFrontend/MobileFrontend.i18n.php (modified) (history)
  • /trunk/extensions/MobileFrontend/MobileFrontend.php (modified) (history)
  • /trunk/extensions/MobileFrontend/views/layout/application.html.php (modified) (history)
  • /trunk/extensions/MobileFrontend/views/notices/notice_1.html.php (added) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/MobileFrontend.i18n.php
@@ -67,6 +67,7 @@
6868 'mobile-frontend-leave-feedback-link-text' => 'MobileFrontend Extension feedback',
6969 'mobile-frontend-leave-feedback' => 'Mobile site feedback',
7070 'mobile-frontend-feedback-page' => 'Project:Mobile Extension Feedback',
 71+ 'mobile-frontend-leave-feedback-thanks' => 'Thanks, for your feedback!',
7172 );
7273
7374 /** Message documentation (Message documentation)
Index: trunk/extensions/MobileFrontend/MobileFrontend.php
@@ -65,7 +65,7 @@
6666 );
6767
6868 class ExtMobileFrontend {
69 - const VERSION = '0.5.57';
 69+ const VERSION = '0.5.58';
7070
7171 /**
7272 * @var DOMDocument
@@ -103,6 +103,7 @@
104104 public static $disableMobileSiteURL;
105105 public static $viewNormalSiteURL;
106106 public static $currentURL;
 107+ public static $displayNoticeId;
107108
108109 public static $messageKeys = array(
109110 'mobile-frontend-show-button',
@@ -141,6 +142,7 @@
142143 'mobile-frontend-leave-feedback-link-text',
143144 'mobile-frontend-leave-feedback',
144145 'mobile-frontend-feedback-page',
 146+ 'mobile-frontend-leave-feedback-thanks',
145147 );
146148
147149 public $itemsToRemove = array(
@@ -280,6 +282,7 @@
281283 $action = $wgRequest->getText( 'action' );
282284 self::$disableImages = $wgRequest->getText( 'disableImages', 0 );
283285 self::$enableImages = $wgRequest->getText( 'enableImages', 0 );
 286+ self::$displayNoticeId = $wgRequest->getText( 'noticeid', '' );
284287
285288 if ( self::$disableImages == 1 ) {
286289 $wgRequest->response()->setcookie( 'disableImages', 1 );
@@ -360,7 +363,7 @@
361364 $article->doEdit( $rawtext, '' );
362365 }
363366
364 - $location = str_replace( '&mobileaction=leave_feedback_post', '', $wgRequest->getFullRequestURL() );
 367+ $location = str_replace( '&mobileaction=leave_feedback_post', '', $wgRequest->getFullRequestURL() . '&noticeid=1' );
365368 $wgRequest->response()->header( 'Location: ' . $location );
366369 wfProfileOut( __METHOD__ );
367370 exit();
@@ -494,6 +497,7 @@
495498 $this->getMsg();
496499 $editToken = $wgUser->editToken();
497500
 501+ $htmlTitle = self::$messages['mobile-frontend-leave-feedback'];
498502 $title = self::$messages['mobile-frontend-leave-feedback-title'];
499503 $notice = self::$messages['mobile-frontend-leave-feedback-notice'];
500504 $subject = self::$messages['mobile-frontend-leave-feedback-subject'];
@@ -924,6 +928,13 @@
925929 }
926930
927931 if ( $this->contentFormat == 'XHTML' && self::$format != 'json' ) {
 932+ if ( !empty( self::$displayNoticeId ) ) {
 933+ $noticePagePath = 'views/notices/notice_' . intval( self::$displayNoticeId ) . '.html.php';
 934+ if ( file_exists( dirname(__FILE__) . '/' . $noticePagePath ) ) {
 935+ require( $noticePagePath );
 936+ }
 937+ }
 938+
928939 //header( 'Content-Type: application/xhtml+xml; charset=utf-8' );
929940 require( 'views/layout/_search_webkit.html.php' );
930941 require( 'views/layout/_footmenu_default.html.php' );
Index: trunk/extensions/MobileFrontend/views/notices/notice_1.html.php
@@ -0,0 +1,9 @@
 2+<?php
 3+
 4+$thanks = self::$messages['mobile-frontend-leave-feedback-thanks'];
 5+
 6+$noticeHtml = <<<EOT
 7+ <div class='mwm-message mwm-notice'>
 8+ {$thanks}
 9+ </div>
 10+EOT;
Property changes on: trunk/extensions/MobileFrontend/views/notices/notice_1.html.php
___________________________________________________________________
Added: svn:eol-style
111 + native
Index: trunk/extensions/MobileFrontend/views/layout/application.html.php
@@ -10,6 +10,8 @@
1111 $appleTouchIconTag = "";
1212 }
1313
 14+$noticeHtml = empty( $noticeHtml ) ? '' : $noticeHtml;
 15+
1416 $cssFileName = ( isset( self::$device['css_file_name'] ) ) ? self::$device['css_file_name'] : 'default';
1517
1618 $applicationHtml = <<<EOT
@@ -38,6 +40,7 @@
3941 <body>
4042 {$searchWebkitHtml}
4143 <div class='show' id='content_wrapper'>
 44+ {$noticeHtml}
4245 {$contentHtml}
4346 </div>
4447 {$footerHtml}

Status & tagging log