Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MINOR Code formatting fixes for CurrencyField

  • Loading branch information...
commit 9cf1686786ab411beddd1a69ee0be2f6a7593c09 1 parent fd3de51
@halkyon halkyon authored
Showing with 4 additions and 12 deletions.
  1. +4 −12 forms/CurrencyField.php
View
16 forms/CurrencyField.php
@@ -37,15 +37,9 @@ function Type() {
* 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 @@ function Field($properties = array()) {
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>';
+ } else {
+ $val = '<i>'._t('CurrencyField.CURRENCYSYMBOL', '$').'0.00</i>';
}
$valforInput = $this->value ? Convert::raw2att($val) : "";
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()) {
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>';
+ } else {
+ $val = '<i>'._t('CurrencyField.CURRENCYSYMBOL', '$').'0.00</i>';
}
$valforInput = $this->value ? Convert::raw2att($val) : "";
return "<input class=\"text\" type=\"text\" disabled=\"disabled\" name=\"".$this->name."\" value=\"".$valforInput."\" />";
Please sign in to comment.
Something went wrong with that request. Please try again.