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 = 'name . ']" '; - $html .= 'name="form' . $rowId . '[' . $this->name . ']" '; - $html .= $this->NSGridType().' '; - $html .= 'value="'.$findValue.'" />'; + } + else { + $html = ''.$html.''; + } + + //$html .= 'id="form' . $rowId . '[' . $this->name . ']" '; } }else{ //Render Field showing only value; foreach ($this->option as $optValue => $optName) { @@ -2745,10 +2727,10 @@ class XmlForm_Field_Listbox extends XmlForm_Field $aInput = array(); foreach ( $this->options as $optionName => $option ) { if(in_array ( $optionName, $value ) ) { - $aInput [] = $optionName; + $aInput [] = ''.$this->htmlentities ( $optionName, ENT_QUOTES, 'utf-8' ).''; } } - $sInput = implode(", ", $aInput); + $sInput = implode("
", $aInput); foreach ( $this->option as $optionName => $option ) { $html .= ''; @@ -2756,7 +2738,10 @@ class XmlForm_Field_Listbox extends XmlForm_Field foreach ( $this->sqlOption as $optionName => $option ) { $html .= ''; } - $html = $this->htmlentities ( $sInput, ENT_QUOTES, 'utf-8' ) . $html; + + $html = ''.$sInput. ""; + //$html = $this->htmlentities ( $sInput, ENT_QUOTES, 'utf-8' ) . $html; + return $html; } else { return $this->htmlentities ( $value, ENT_COMPAT, 'utf-8' ); @@ -2912,44 +2897,46 @@ class XmlForm_Field_CheckGroup extends XmlForm_Field * @param string owner * @return string */ - function render($value = NULL, $owner = NULL) - { - if (($this->pmconnection != '') && ($this->pmfield != '') && $value == NULL) { - $value = $this->getPMTableValue($owner); - } - $this->executeSQL ( $owner ); - if (! is_array ( $value )) - $value = explode ( '|', $value ); - if ($this->mode === 'edit') { - $i=0; - $html = ''; - foreach ( $this->options as $optionName => $option ) { - $html .= '' . $option . ''; - if(++$i==count($this->options)){ - $html .= '      '.$this->renderHint(); + function render($value = NULL, $owner = NULL) + { + if (($this->pmconnection != '') && ($this->pmfield != '') && $value == NULL) { + $value = $this->getPMTableValue($owner); } - $html .= '
'; - }//fin for - return $html; - } elseif ($this->mode === 'view') { - $html = ''; - $aInput = array(); - foreach ( $this->options as $optionName => $option ) { - // replaced to $sInput - // $html .= '' . $option . '
'; - if(in_array ( $optionName, $value ) ) { - $aInput [] = $optionName; + $this->executeSQL ( $owner ); + if (! is_array ( $value )){ + $value = explode ( '|', $value ); } - $html .= ''; - } - $sInput = implode(", ", $aInput); - $html = $this->htmlentities ( $sInput, ENT_QUOTES, 'utf-8' ) . $html; - return $html; - } else { - return $this->htmlentities ( $value, ENT_COMPAT, 'utf-8' ); + if ($this->mode === 'edit') { + $i=0; + $html = ''; + foreach ( $this->options as $optionName => $option ) { + $html .= '' . $option . ''; + if(++$i==count($this->options)){ + $html .= '      '.$this->renderHint(); + } + $html .= '
'; + }//fin for + return $html; + } + else { + $html = ''; + $aInput = array(); + foreach ( $this->options as $optionName => $option ) { + if(in_array ( $optionName, $value ) ) { + $aInput [] = ''.$this->htmlentities ( $optionName, ENT_QUOTES, 'utf-8' ).''; + } + } + + $sInput = implode("
", $aInput); + $html = ""; + $html .= ''; + $html .= $sInput; + $html .= ''; + return $html; + } + } - - } + } /* TODO: DEPRECATED */ @@ -3042,6 +3029,7 @@ class XmlForm_Field_Grid extends XmlForm_Field * @param $owner * @return