diff --git a/gulliver/system/class.xmlform.php b/gulliver/system/class.xmlform.php index f0e152e85..be26b67e0 100755 --- a/gulliver/system/class.xmlform.php +++ b/gulliver/system/class.xmlform.php @@ -3806,7 +3806,17 @@ class XmlForm_Field_CheckGroup extends XmlForm_Field $i = 0; $html = ''; foreach ($this->options as $optionName => $option) { - $html .= ''; + $swCheked = 0; + + foreach ($value as $index2 => $value2) { + if (strlen($value2 . "") > 0 && $value2 == $optionName) { + $swCheked = 1; + break; + } + } + + $html = $html . "name . "][" . $optionName . "]\" name=\"form[" . $this->name . "][]\" value=\"" . $optionName . "\"" . (($swCheked == 1) ? " checked=\"checked\" " : "") . ">"; + if (++ $i == count( $this->options )) { $html .= '      ' . $this->renderHint(); } @@ -3816,8 +3826,17 @@ class XmlForm_Field_CheckGroup extends XmlForm_Field } elseif ($this->mode === 'view') { $html = ''; foreach ($this->options as $optionName => $option) { - $html .= '
'; - $html .= ''; + $swCheked = 0; + + foreach ($value as $index2 => $value2) { + if (strlen($value2 . "") > 0 && $value2 == $optionName) { + $swCheked = 1; + break; + } + } + + $html = $html . "name . "][" . $optionName . "]\" value=\"" . $optionName . "\"" . (($swCheked == 1) ? " checked=\"checked\" " : "") . " disabled=\"disabled\">
"; + $html = $html . "name . "][]\" value=\"" . (($swCheked == 1) ? $optionName : "") . "\">"; } return $html; } else {