diff --git a/gulliver/system/class.xmlform.php b/gulliver/system/class.xmlform.php index f3a4fee1b..2f5b56ea2 100644 --- a/gulliver/system/class.xmlform.php +++ b/gulliver/system/class.xmlform.php @@ -1557,11 +1557,12 @@ class XmlForm_Field_Textarea extends XmlForm_Field { $html .= $this->htmlentities($v, ENT_COMPAT, 'utf-8'); $html .= ''; }else{ //VIEW MODE + $html .= '
' . $this->htmlentities($v, ENT_COMPAT, 'utf-8') . '
'; $html .= ''; @@ -2111,9 +2112,16 @@ class XmlForm_Field_Link extends XmlForm_Field { $target = G::replaceDataField ( $this->target, $owner->values ); $value = G::replaceDataField ( $this->value, $owner->values ); $label = G::replaceDataField ( $this->label, $owner->values ); - $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' ) . ''; - - $html .= $this->renderHint(); + 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' ) . ''; + $html .= $this->renderHint(); + } else { + $html = $this->htmlentities ( $this->value === '' ? $label : $value, ENT_QUOTES, 'utf-8' ); + $html .= 'name.']" '; + $html .= 'name="form['.$this->name.']" '; + $html .= 'type="hidden" value="' . $this->htmlentities ( $link, ENT_QUOTES, 'utf-8' ) . '" />'; + } return $html; } @@ -2133,7 +2141,15 @@ class XmlForm_Field_Link extends XmlForm_Field { $target = G::replaceDataField ( $this->target, $_aData_ ); $value = G::replaceDataField ( $this->value, $_aData_ ); $label = G::replaceDataField ( $this->label, $_aData_ ); - $html = 'htmlentities ( $link, ENT_QUOTES, 'utf-8' ) . '\'' . 'id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $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' ) . ''; + if ($this->mode == 'edit'){ + $html = 'htmlentities ( $link, ENT_QUOTES, 'utf-8' ) . '\'' . 'id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $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 ( $this->value === '' ? $label : $value, ENT_QUOTES, 'utf-8' ); + $html .= 'name . '][' . $r . '][' . $this->name . ']" '; + $html .= 'name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" '; + $html .= 'type="hidden" value="' . $this->htmlentities ( $link, ENT_QUOTES, 'utf-8' ) . '" />'; + } $result [] = $html; $r ++; } @@ -2331,15 +2347,15 @@ class XmlForm_Field_Checkbox extends XmlForm_Field return $res; } elseif ($this->mode === 'view') { if ($this->labelOnRight) { - $html = "" . $this->label . ''; + $html = "" . $this->label . ''; } else { - $html = ""; - } - if($this->hint){ - $html .= ' - - '; + $html = ""; } +// if($this->hint){ +// $html .= ' +// +// '; +// } return $html; } } @@ -2418,7 +2434,7 @@ class XmlForm_Field_Button extends XmlForm_Field $re = "style}\" class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='button' value=\"{$label}\" " . (($this->onclick) ? 'onclick="' . htmlentities ( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; return $re; } elseif ($this->mode === 'view') { - return "style}\" disabled='disabled' class='module_app_button___gray module_app_buttonDisabled___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='button' value=\"{$label}\" " . (($this->onclick) ? 'onclick="' . htmlentities ( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; + return "style};display:none\" disabled='disabled' class='module_app_button___gray module_app_buttonDisabled___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='button' value=\"{$label}\" " . (($this->onclick) ? 'onclick="' . htmlentities ( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; } else { return $this->htmlentities ( $value, ENT_COMPAT, 'utf-8' ); } @@ -2444,7 +2460,15 @@ class XmlForm_Field_Reset extends XmlForm_Field $onclick = G::replaceDataField ( $this->onclick, $owner->values ); $mode = ($this->mode == 'view') ? ' disabled="disabled"' : ''; //return ''; - return "style}\" $mode class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='reset' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities ( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; +// return "style}\" $mode class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='reset' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities ( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; + if ($this->mode === 'edit') { + return "style}\" $mode class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='reset' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities ( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; + } elseif ($this->mode === 'view') { + return "style};display:none\" $mode class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='reset' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities ( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; + } else { + return $this->htmlentities ( $value, ENT_COMPAT, 'utf-8' ); + } + } } /** @@ -2469,7 +2493,7 @@ class XmlForm_Field_Submit extends XmlForm_Field { // return 'label .'\' disabled/>'; return "style}\" class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='submit' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities ( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; } elseif ($this->mode === 'view') { - return "style}\" disabled='disabled' class='module_app_button___gray module_app_buttonDisabled___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='submit' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities ( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; + return "style};display:none\" disabled='disabled' class='module_app_button___gray module_app_buttonDisabled___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='submit' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities ( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; } else { return $this->htmlentities ( $value, ENT_COMPAT, 'utf-8' ); }