diff options
author | deva <deva> | 2009-04-25 09:36:19 +0000 |
---|---|---|
committer | deva <deva> | 2009-04-25 09:36:19 +0000 |
commit | 13426bcaab9cdbeebd9ac85fad5fe9fd0e8cbc5a (patch) | |
tree | fa356b28f623836251423e16ef071852c1d56bc6 /utils/forms.php | |
parent | 9854238d0d44ea269d97509d6d35f49d3b46e834 (diff) |
New ImageComboBox. Added icons to news.
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; } } |