r106908 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106907‎ | r106908 | r106909 >
Date:00:48, 21 December 2011
Author:rmoen
Status:deferred
Tags:markashelpful 
Comment:
trim unneeded html returns from MarkAsHelpfulUtil.php follow up to r106906
Modified paths:
  • /trunk/extensions/MarkAsHelpful/includes/MarkAsHelpfulUtil.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MarkAsHelpful/includes/MarkAsHelpfulUtil.php
@@ -25,11 +25,15 @@
2626 }
2727 }
2828
29 - return '<div class="mw-mah-wrapper">' . $html . '</div>';
 29+ return $html;
3030
3131 }
3232
3333 private static function otherMarkedTemplate( $helpfulUserList ) {
 34+ if ( count( $helpfulUserList ) == 0 ) {
 35+ return '';
 36+ }
 37+
3438 $userList = '';
3539
3640 foreach ( $helpfulUserList as $val ) {
@@ -43,9 +47,11 @@
4448 }
4549
4650 return <<<HTML
 51+ <div class='mw-mah-wrapper'>
4752 <span class='mah-helpful-marked-state'>
4853 $data
4954 </span>
 55+ </div>
5056 HTML;
5157 }
5258
@@ -54,19 +60,23 @@
5561 $undoLinkText = wfMessage( 'mah-undo-mark-text' )->escaped();
5662
5763 return <<<HTML
58 - <span class='mah-helpful-marked-state'>
59 - $mahMarkedText
60 - </span>
61 - &nbsp;(<a class='markashelpful-undo'>$undoLinkText</a>)
 64+ <div class='mw-mah-wrapper'>
 65+ <span class='mah-helpful-marked-state'>
 66+ $mahMarkedText
 67+ </span>
 68+ &nbsp;(<a class='markashelpful-undo'>$undoLinkText</a>)
 69+ </div>
6270 HTML;
6371 }
6472
6573 private static function requestToMarkTemplate() {
6674 $mahLinkText = wfMessage( 'mah-mark-text' )->escaped();
6775 return <<<HTML
68 - <a class='mah-helpful-state markashelpful-mark'>
69 - $mahLinkText
70 - </a>
 76+ <div class='mw-mah-wrapper'>
 77+ <a class='mah-helpful-state markashelpful-mark'>
 78+ $mahLinkText
 79+ </a>
 80+ </div>
7181 HTML;
7282 }
7383

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r106906updated the template and moved template generation for different cases to ind...bsitu00:35, 21 December 2011

Status & tagging log