NTKButton.php 606 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. class NTKButton
  3. {
  4. function NTKButton($id, $label, $action)
  5. {
  6. $this->id = $id;
  7. $this->label = $label;
  8. $this->action = $action;
  9. }
  10. function getHtml()
  11. {
  12. $actions = "";
  13. $html = "";
  14. $actions .= " onclick=\"$this->action\"";
  15. $actions .= " onmousedown=\"this.className = 'button_down'\"";
  16. $actions .= " onmouseup=\"this.className = 'button'\"";
  17. $actions .= " onmouseover=\"this.className = 'button_over'\"";
  18. $actions .= " onmouseout=\"this.className = 'button'\"";
  19. $html .= "<div id=\"$this->id\" class=\"button\" $actions>$this->label</span>\n";
  20. return $html;
  21. }
  22. }
  23. ?>