diff options
Diffstat (limited to 'utils/forms.php')
-rw-r--r-- | utils/forms.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/utils/forms.php b/utils/forms.php index 8f2238e..3d1050a 100644 --- a/utils/forms.php +++ b/utils/forms.php @@ -209,22 +209,22 @@ class ImageComboBox { public function render($indent = "") { + $width = 64; $str = $indent . "<div class=\"input\">\n"; $str .= $indent . " <div class=\"label\">".$this->label."</div>\n"; $str .= $indent . " <div class=\"widget\">\n"; - $str .= $indent . " <select name=\"vars[".$this->name."]\">\n"; + $str .= $indent . " <div style=\"width:200px;overflow:scroll;\">\n"; + $str .= $indent . " <div style=\"width:".($width + 6)*sizeof($this->values)."px;\">\n"; + $str .= $indent . " <input id=\"".$this->name."\" name=\"vars[".$this->name."]\" type=\"hidden\" value=\"".$this->value."\"/>\n"; foreach($this->values as $k => $v) { - $str .= $indent . " <optgroup style=\"background-image: url(".$v."); height: 100px; width: 100px;\"/>\n"; - $str .= $indent . " <option value=\"".$k."\""; - if($v == $value) $str .= " selected"; - $str .=">".$k."</option>\n"; - $str .= $indent . " </optgroup>\n"; + $str .= $indent . " <img src=\"".$v."\" style=\"max-width:".$width."px;\"\n"; + $str .= $indent . " onclick=\"document.getElementById('".$this->name."').value='".$v."'\"/>\n"; } - - $str .= $indent . " </select>\n"; - $str .= $indent . " </div>\n"; - $str .= $indent . "</div>\n"; + $str .= $indent . " </div>\n"; // box + $str .= $indent . " </div>\n"; // overflow + $str .= $indent . " </div>\n"; // widget + $str .= $indent . "</div>\n"; // input return $str; } } |