MINOR Code formatting fixes for CurrencyField

This commit is contained in:
Sean Harvey 2012-04-12 12:11:22 +12:00
parent fd3de5158d
commit 9cf1686786

View File

@ -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,7 +65,6 @@ 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 = '<i>'._t('CurrencyField.CURRENCYSYMBOL', '$').'0.00</i>';
}
@ -104,7 +97,6 @@ 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 = '<i>'._t('CurrencyField.CURRENCYSYMBOL', '$').'0.00</i>';
}