diff --git a/gulliver/system/class.xmlform.php b/gulliver/system/class.xmlform.php index 8be33485e..726f94741 100644 --- a/gulliver/system/class.xmlform.php +++ b/gulliver/system/class.xmlform.php @@ -1003,15 +1003,10 @@ class XmlForm_Field_Text extends XmlForm_Field_SimpleText $html .= $this->NSRequiredValue().' '; $html .= '/>'; }else{ //VIEW MODE - $html .= $this->htmlentities($value, ENT_QUOTES, 'utf-8'); - $html .= 'name . ']" '; - $html .= 'name="form[' . $this->name . ']" '; - $html .= 'type="hidden" value="'.$this->htmlentities($value, ENT_QUOTES, 'utf-8').'" />'; + $html .= ''.$this->htmlentities($value, ENT_QUOTES, 'utf-8').''; } - $html .= $this->renderHint(); - + $html .= $this->renderHint(); return $html; } @@ -1189,10 +1184,9 @@ class XmlForm_Field_Suggest extends XmlForm_Field_SimpleText //by neyek return $str; } - } elseif ($this->mode === 'view') { - return 'htmlentities ( $value, ENT_COMPAT, 'utf-8' ) . '\' style="display:none;' . htmlentities ( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities ( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>' . $this->htmlentities ( $value, ENT_COMPAT, 'utf-8' ); } else { - return $this->htmlentities ( $value, ENT_COMPAT, 'utf-8' ); + $html = ''.$this->htmlentities($value, ENT_QUOTES, 'utf-8').''; + return $html; } } /** @@ -1395,12 +1389,10 @@ class XmlForm_Field_Password extends XmlForm_Field { $html .= $this->renderHint(); return $html; } - } elseif ($this->mode === 'view') { - $html= 'htmlentities ( $value, ENT_COMPAT, 'utf-8' ) . '\' readOnly="readOnly"/>'; - $html.= $this->htmlentities ( str_repeat ( '*', 10 ), ENT_COMPAT, 'utf-8' ); - return $html; } else { - return $this->htmlentities ( str_repeat ( '*', 10 ), ENT_COMPAT, 'utf-8' ); + //return $this->htmlentities ( str_repeat ( '*', 10 ), ENT_COMPAT, 'utf-8' ); + $html = ''.$this->htmlentities ( str_repeat ( '*', 10 ), ENT_COMPAT, 'utf-8' ).''; + return $html; } } } @@ -1457,12 +1449,8 @@ class XmlForm_Field_Textarea extends XmlForm_Field { $html .= 'class="'.$className.'" >'; $html .= $this->htmlentities($value, ENT_COMPAT, 'utf-8'); $html .= ''; - }else{ //VIEW MODE - $html .= '
' . $this->htmlentities($value, ENT_QUOTES, 'utf-8') . ''; - $html .= 'name . ']" '; - $html .= 'name="form[' . $this->name . ']" '; - $html .= 'type="hidden" value="'.$this->htmlentities($value, ENT_QUOTES, 'utf-8').'" />'; + }else{ //VIEW MODE + $html .= '
' . $this->htmlentities($value, ENT_QUOTES, 'utf-8') . ''; } @@ -1562,11 +1550,8 @@ class XmlForm_Field_Currency extends XmlForm_Field_SimpleText { $html .= $this->NSGridType().' '; $html .= '/>'; }else{ //VIEW MODE - $html .= $this->htmlentities($value, ENT_COMPAT, 'utf-8'); - $html .= 'name . ']" '; - $html .= 'name="form[' . $this->name . ']" '; - $html .= 'type="hidden" value="'.$this->htmlentities($value, ENT_COMPAT, 'utf-8').'" />'; + + $html .= ''.$this->htmlentities($value, ENT_QUOTES, 'utf-8').''; } $html .= $this->renderHint(); @@ -1630,11 +1615,7 @@ class XmlForm_Field_Percentage extends XmlForm_Field_SimpleText { $html .= $this->NSRequiredValue().' '; $html .= '/>'; }else{ //VIEW MODE - $html .= $this->htmlentities($value, ENT_COMPAT, 'utf-8'); - $html .= 'name . ']" '; - $html .= 'name="form[' . $this->name . ']" '; - $html .= 'type="hidden" value="'.$this->htmlentities($value, ENT_COMPAT, 'utf-8').'" />'; + $html .= ''.$this->htmlentities($value, ENT_QUOTES, 'utf-8').''; } $html .= $this->renderHint(); @@ -1947,11 +1928,10 @@ class XmlForm_Field_YesNo extends XmlForm_Field $html .= 'type="hidden" value="'.(($value==='0')? '0':'1').'" />'; } }else{ //VIEW MODE + + $html .= ''; $html .= ($value==='0') ? G::LoadTranslation('ID_NO_VALUE') : G::LoadTranslation('ID_YES_VALUE'); - $html .= 'name.']" '; - $html .= 'name="form['.$this->name.']" '; - $html .= 'type="hidden" value="'.(($value==='0')? '0':'1').'" />'; + $html .= ''; } $html .= $this->renderHint(); @@ -2034,11 +2014,10 @@ class XmlForm_Field_Link extends XmlForm_Field { if($this->mode === 'edit'){ $html = 'htmlentities ( $link, ENT_QUOTES, 'utf-8' ) . '\'' . 'id="form[' . $this->name . ']" name="form[' . $this->name . ']"' . (($this->onclick) ? ' onclick="' . htmlentities ( $onclick, ENT_QUOTES, 'utf-8' ) . '"' : '') . (($this->target) ? ' target="' . htmlentities ( $target, ENT_QUOTES, 'utf-8' ) . '"' : '') . '>' . $this->htmlentities ( $this->value === '' ? $label : $value, ENT_QUOTES, 'utf-8' ) . ''; } else { - $html = $this->htmlentities ( $link, ENT_QUOTES, 'utf-8' ); - $html .= 'name . ']" '; - $html .= 'name="form[' . $this->name . ']" '; - $html .= 'type="hidden" value="'. $this->htmlentities ( $link, ENT_QUOTES, 'utf-8' ) .'" />'; + $html = ""; + $html .= ''; + $html .= $this->htmlentities ( $link, ENT_QUOTES, 'utf-8' ); + $html .= ''; } $html .= $this->renderHint(); @@ -2125,11 +2104,10 @@ class XmlForm_Field_File extends XmlForm_Field { $html .= ''; } } else { //VIEW MODE - $html = $this->htmlentities($value, ENT_QUOTES, 'utf-8'); - $html .= 'name . ']" '; - $html .= 'name="form[' . $this->name . ']" '; - $html .= 'type="hidden" value="'.$this->htmlentities($value, ENT_QUOTES, 'utf-8').'" />'; + $html = ""; + $html .= ''; + $html .= $this->htmlentities($value, ENT_QUOTES, 'utf-8'); + $html .= ''; } $html .= $this->renderHint(); @@ -2271,21 +2249,20 @@ class XmlForm_Field_Checkbox extends XmlForm_Field // $res = "" . $this->label ; return $res; - } elseif ($this->mode === 'view') { - if ($this->labelOnRight) { - $html = "" . $this->label . ''; - } else { - $html = $this->htmlentities($value, ENT_QUOTES, 'utf-8'); - $html .= 'name . ']" '; - $html .= 'name="form[' . $this->name . ']" '; - $html .= 'type="hidden" value="'.$this->htmlentities($value, ENT_QUOTES, 'utf-8').'" />'; - } + } + else { + if ($this->labelOnRight) { + $html = "" . $this->label . ''; + } + else { + $html = $this->htmlentities($value, ENT_QUOTES, 'utf-8'); + $html .= 'name . ']" '; + $html .= 'name="form[' . $this->name . ']" '; + $html .= 'type="hidden" value="'.$this->htmlentities($value, ENT_QUOTES, 'utf-8').'" />'; + } $html .= $this->renderHint(); return $html; - - } else { - return $this->htmlentities ( $value, ENT_COMPAT, 'utf-8' ); } } @@ -2573,7 +2550,7 @@ class XmlForm_Field_Dropdown extends XmlForm_Field { if ($this->renderMode == '') $this->renderMode = $this->mode; if (!$onlyValue){ //Render Field if not defined onlyValue - if ($this->renderMode == 'edit'){ //EDIT MODE + if ($this->renderMode == 'edit') { //EDIT MODE $readOnlyField = ($this->readonly == 1 || $this->readonly == '1') ? 'disabled' : ''; $html = '