r48801 - Code Review

From MediaWiki.org

Jump to: navigation, search
Repository:MediaWiki
Revision:r48800 | r48801 (on ViewVC) | r48802 >
Date:10:11, 25 March 2009
Author:raymond
Status:ok
Tags:
Comment:Add a class if 'missingsummary' is triggered to allow styling of the summary line
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
===================================================================
--- trunk/phase3/includes/EditPage.php	(revision 48800)
+++ trunk/phase3/includes/EditPage.php	(revision 48801)
@@ -1363,10 +1363,14 @@
 		if ( $this->section == 'new' ) {
 			$commentsubject = '';
 			if ( !$wgRequest->getBool( 'nosummary' ) ) {
+				# Add a class if 'missingsummary' is triggered to allow styling of the summary line
+				$summaryClass = $this->missingSummary ? 'mw-summarymissed' : 'mw-summary';
+
 				$commentsubject =
 					Xml::tags( 'label', array( 'for' => 'wpSummary' ), $subject );
 				$commentsubject =
-					Xml::tags( 'span', array( 'id' => 'wpSummaryLabel' ), $commentsubject );
+					Xml::tags( 'span', array( 'class' => $summaryClass, 'id' => "wpSummaryLabel" ),
+						$commentsubject );
 				$commentsubject .= ' ';
 				$commentsubject .= Xml::input( 'wpSummary',
 									60,
@@ -1385,10 +1389,13 @@
 		} else {
 			$commentsubject = '';
 
+			# Add a class if 'missingsummary' is triggered to allow styling of the summary line
+			$summaryClass = $this->missingSummary ? 'mw-summarymissed' : 'mw-summary';
+
 			$editsummary = Xml::tags( 'label', array( 'for' => 'wpSummary' ), $summary );
-			$editsummary =
-				Xml::tags( 'span', array( 'id' => 'wpSummaryLabel' ), $editsummary ) . ' ';
-				
+			$editsummary = Xml::tags( 'span',  array( 'class' => $summaryClass, 'id' => "wpSummaryLabel" ),
+					$editsummary ) . ' ';
+
 			$editsummary .= Xml::input( 'wpSummary',
 				60,
 				$summarytext,
@@ -1397,11 +1404,11 @@
 					'maxlength' => '200',
 					'tabindex' => '1'
 				) );
-			
+
 			// No idea where this is closed.
 			$editsummary = Xml::openElement( 'div', array( 'class' => 'editOptions' ) )
 							. $editsummary . '<br/>';
-				
+
 			$summarypreview = '';
 			if ( $summarytext && $this->preview ) {
 				$summarypreview =
Index: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES	(revision 48800)
+++ trunk/phase3/RELEASE-NOTES	(revision 48801)
@@ -149,7 +149,9 @@
 * Added $wgUserrightsInterwikiDelimiter to allow changing the delimiter
   used in Special:UserRights to denote the user should be searched for
   on a different database
-  
+* Add a class if 'missingsummary' is triggered to allow styling of the summary
+  line
+
 === Bug fixes in 1.15 ===
 * (bug 16968) Special:Upload no longer throws useless warnings.
 * (bug 17000) Special:RevisionDelete now checks if the database is locked

Status & tagging log

Views
Toolbox