From 9cf1686786ab411beddd1a69ee0be2f6a7593c09 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Thu, 12 Apr 2012 12:11:22 +1200 Subject: [PATCH] MINOR Code formatting fixes for CurrencyField --- forms/CurrencyField.php | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/forms/CurrencyField.php b/forms/CurrencyField.php index 2d2d0ac05..9ef8c48dc 100644 --- a/forms/CurrencyField.php +++ b/forms/CurrencyField.php @@ -37,15 +37,9 @@ class CurrencyField extends TextField { * Create a new class for this field */ function performReadonlyTransformation() { - $field = new CurrencyField_Readonly($this->name, $this->title, $this->value); $field -> addExtraClass($this->extraClass()); return $field; - - /* - $this is-a object and cant be passed as_a string of the first parameter of formfield constructor. - return new CurrencyField_Readonly($this); - */ } function validate($validator) { @@ -71,9 +65,8 @@ class CurrencyField_Readonly extends ReadonlyField{ if($this->value){ $val = $this->dontEscape ? $this->value : Convert::raw2xml($this->value); $val = _t('CurrencyField.CURRENCYSYMBOL', '$') . number_format(preg_replace('/[^0-9.]/',"",$val), 2); - - }else { - $val = ''._t('CurrencyField.CURRENCYSYMBOL', '$').'0.00'; + } else { + $val = ''._t('CurrencyField.CURRENCYSYMBOL', '$').'0.00'; } $valforInput = $this->value ? Convert::raw2att($val) : ""; return "extraClass()."\" id=\"" . $this->id() . "\">$valname."\" value=\"".$valforInput."\" />"; @@ -104,9 +97,8 @@ class CurrencyField_Disabled extends CurrencyField{ if($this->value){ $val = $this->dontEscape ? $this->value : Convert::raw2xml($this->value); $val = _t('CurrencyField.CURRENCYSYMBOL', '$') . number_format(preg_replace('/[^0-9.]/',"",$val), 2); - - }else { - $val = ''._t('CurrencyField.CURRENCYSYMBOL', '$').'0.00'; + } else { + $val = ''._t('CurrencyField.CURRENCYSYMBOL', '$').'0.00'; } $valforInput = $this->value ? Convert::raw2att($val) : ""; return "name."\" value=\"".$valforInput."\" />";