r66964 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66963‎ | r66964 | r66965 >
Date:13:35, 27 May 2010
Author:mkroetzsch
Status:deferred
Tags:
Comment:
allow "plain" output format for numbers with units (Bug 23679)
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_DV_Linear.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_DV_Number.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DV_Linear.php
@@ -131,9 +131,9 @@
132132 $printunit = $unit;
133133 }
134134
135 - $this->m_caption = smwfNumberFormat( $value );
 135+ $this->m_caption = ( $this->m_outformat != '-' ? smwfNumberFormat( $value ) : $value );
136136 if ( $printunit != '' ) {
137 - $this->m_caption .= ' ' . $printunit;
 137+ $this->m_caption .= ( $this->m_outformat != '-' ? ' ' : ' ' ) . $printunit;
138138 }
139139 $this->m_wikivalue = $this->m_caption;
140140 $this->m_unitin = $unit;
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DV_Number.php
@@ -273,9 +273,9 @@
274274 */
275275 protected function makeUserValue() {
276276 $this->convertToMainUnit();
277 - $this->m_caption = ( $this->m_outformat != '-' ? smwfNumberFormat( $this->m_value ):$this->m_value );
 277+ $this->m_caption = ( $this->m_outformat != '-' ? smwfNumberFormat( $this->m_value ) : $this->m_value );
278278 if ( $this->m_unit != '' ) {
279 - $this->m_caption .= ' ' . $this->m_unit;
 279+ $this->m_caption .= ( $this->m_outformat != '-' ? ' ' : ' ' ) . $this->m_unit;
280280 }
281281 $this->m_wikivalue = $this->m_caption;
282282 $this->m_unitin = $this->m_unit;

Status & tagging log