Permalink
Browse files

API CHANGE Removed support for undocumented and only partially implem…

…ented FormField->reserveNL flag, which is just the opposite of the documented and more frequently used FormField->dontEscape flag.
  • Loading branch information...
1 parent 23adf71 commit b438a0a09571ecfd5b8eb42a44c902af98ba65a6 @chillu chillu committed Sep 14, 2011
Showing with 4 additions and 6 deletions.
  1. +2 −2 forms/CurrencyField.php
  2. +1 −1 forms/FormField.php
  3. +1 −3 forms/LookupField.php
@@ -94,7 +94,7 @@ class CurrencyField_Readonly extends ReadonlyField{
*/
function Field() {
if($this->value){
- $val = $this->dontEscape ? ($this->reserveNL?Convert::raw2xml($this->value):$this->value) : Convert::raw2xml($this->value);
+ $val = $this->dontEscape ? $this->value : Convert::raw2xml($this->value);
$val = _t('CurrencyField.CURRENCYSYMBOL', '$') . number_format(preg_replace('/[^0-9.]/',"",$val), 2);
}else {
@@ -126,7 +126,7 @@ class CurrencyField_Disabled extends CurrencyField{
*/
function Field() {
if($this->value){
- $val = $this->dontEscape ? ($this->reserveNL?Convert::raw2xml($this->value):$this->value) : Convert::raw2xml($this->value);
+ $val = $this->dontEscape ? $this->value : Convert::raw2xml($this->value);
$val = _t('CurrencyField.CURRENCYSYMBOL', '$') . number_format(preg_replace('/[^0-9.]/',"",$val), 2);
}else {
View
@@ -394,7 +394,7 @@ function getTemplate() {
* Our base FormField class just returns a span containing the value. This should be overridden!
*/
function Field() {
- if($this->value) $value = $this->dontEscape ? ($this->reserveNL ? nl2br($this->value) : $this->value) : Convert::raw2xml($this->value);
+ if($this->value) $value = $this->dontEscape ? $this->value : Convert::raw2xml($this->value);
else $value = '<i>(' . _t('FormField.NONE', 'none') . ')</i>';
$attributes = array(
@@ -26,9 +26,7 @@ function Field() {
if(!isset($mappedValue)) $mappedValue = $this->value ? $this->value : "<i>(none)</i>";
if($this->value) {
- $val = $this->dontEscape
- ? ($this->reserveNL?Convert::raw2xml($this->value):$this->value)
- : Convert::raw2xml($this->value);
+ $val = $this->dontEscape ? $this->value : Convert::raw2xml($this->value);
} else {
$val = '<i>(none)</i>';
}

0 comments on commit b438a0a

Please sign in to comment.