| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- class NTKImageButton
- {
- function NTKImageButton($id, $icon, $label, $action, $tooltip = "")
- {
- $this->id = $id;
- $this->icon = $icon;
- $this->label = $label;
- $this->action = $action;
- $this->tooltip = $tooltip;
- }
-
- function setTooltip($tooltip)
- {
- $this->tooltip = $tooltip;
- }
-
- function getHtml()
- {
- $actions = "";
- $html = "";
-
- $actions .= " onclick=\"$this->action\"";
- $actions .= " onmousedown=\"this.className = 'imagebutton_down'\"";
- $actions .= " onmouseup=\"this.className = 'imagebutton'\"";
- $actions .= " onmouseover=\"this.className = 'imagebutton_over'\"";
- if($this->tooltip != "")
- {
- $actions .= " onmouseout=\"this.className = 'imagebutton'; ntk_tooltip_stop = true; ntk_hide_tooltip();\"";
- $actions .= " onmousemove=\"ntk_show_tooltip('".$this->tooltip."');\"";
- }
- else
- {
- $actions .= " onmouseout=\"this.className = 'imagebutton';\"";
- $actions .= " onmousemove=\"\"";
- }
-
- $html .= "<div id=\"$this->id\" class=\"imagebutton\" $actions><img src=\"$this->icon\" border=\"0\"></div>\n";
-
- return $html;
- }
- }
- ?>
|