API CHANGE Removed support for undocumented and only partially implemented FormField->reserveNL flag, which is just the opposite of the documented and more frequently used FormField->dontEscape flag.

This commit is contained in:
Ingo Schommer 2011-09-14 10:06:01 +02:00
parent 23adf71e5f
commit b438a0a095
3 changed files with 4 additions and 6 deletions

View File

@ -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 File

@ -394,7 +394,7 @@ class FormField extends RequestHandler {
* 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(

View File

@ -26,9 +26,7 @@ class LookupField extends DropdownField {
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>';
}