Skip to content
This repository
Browse code

MINOR Code formatting fixes for CurrencyField

  • Loading branch information...
commit 9cf1686786ab411beddd1a69ee0be2f6a7593c09 1 parent fd3de51
Sean Harvey authored April 12, 2012

Showing 1 changed file with 4 additions and 12 deletions. Show diff stats Hide diff stats

  1. 16  forms/CurrencyField.php
16  forms/CurrencyField.php
@@ -37,15 +37,9 @@ function Type() {
37 37
 	 * Create a new class for this field
38 38
 	 */
39 39
 	function performReadonlyTransformation() {
40  
-		
41 40
 		$field = new CurrencyField_Readonly($this->name, $this->title, $this->value);
42 41
 		$field -> addExtraClass($this->extraClass());
43 42
 		return $field;
44  
-		
45  
-		/*
46  
-		$this is-a object and cant be passed as_a string of the first parameter of formfield constructor.
47  
-		return new CurrencyField_Readonly($this);
48  
-		*/
49 43
 	}
50 44
 
51 45
 	function validate($validator) {
@@ -71,9 +65,8 @@ function Field($properties = array()) {
71 65
 		if($this->value){
72 66
 			$val = $this->dontEscape ? $this->value : Convert::raw2xml($this->value);
73 67
 			$val = _t('CurrencyField.CURRENCYSYMBOL', '$') . number_format(preg_replace('/[^0-9.]/',"",$val), 2);
74  
-			
75  
-		}else {
76  
-		        $val = '<i>'._t('CurrencyField.CURRENCYSYMBOL', '$').'0.00</i>';
  68
+		} else {
  69
+			$val = '<i>'._t('CurrencyField.CURRENCYSYMBOL', '$').'0.00</i>';
77 70
 		}
78 71
 		$valforInput = $this->value ? Convert::raw2att($val) : "";
79 72
 		return "<span class=\"readonly ".$this->extraClass()."\" id=\"" . $this->id() . "\">$val</span><input type=\"hidden\" name=\"".$this->name."\" value=\"".$valforInput."\" />";
@@ -104,9 +97,8 @@ function Field($properties = array()) {
104 97
 		if($this->value){
105 98
 			$val = $this->dontEscape ? $this->value : Convert::raw2xml($this->value);
106 99
 			$val = _t('CurrencyField.CURRENCYSYMBOL', '$') . number_format(preg_replace('/[^0-9.]/',"",$val), 2);
107  
-			
108  
-		}else {
109  
-		        $val = '<i>'._t('CurrencyField.CURRENCYSYMBOL', '$').'0.00</i>';
  100
+		} else {
  101
+			$val = '<i>'._t('CurrencyField.CURRENCYSYMBOL', '$').'0.00</i>';
110 102
 		}
111 103
 		$valforInput = $this->value ? Convert::raw2att($val) : "";
112 104
 		return "<input class=\"text\" type=\"text\" disabled=\"disabled\" name=\"".$this->name."\" value=\"".$valforInput."\" />";

0 notes on commit 9cf1686

Please sign in to comment.
Something went wrong with that request. Please try again.