00001 <?php
00002
00008 class TKButton extends TKAbstractButton {
00014 public function __construct($caption) {
00015 parent::__construct($caption);
00016
00017 $this->addProperty('type', self::PROP_STRING);
00018 }
00019
00021 protected function renderComponent($class, $style, $events, $id) {
00022 if($this->get('disabled') === true)
00023 $disabled = " disabled=\"disabled\"";
00024 else
00025 $disabled = "";
00026 if($this->get('type'))
00027 $type = " type=\"" . $this->getType() . "\"'";
00028 else
00029 $type = "";
00030 $collect = "<button $id$class[0]$style[0]$events$disabled$type>";
00031 $collect .= $this->getCaption();
00032 $collect .= "</button>\n";
00033
00034 return $collect;
00035 }
00036
00038 public static function createFromXML($attrs, $contents, $node) {
00039 $obj = new TKButton("$contents");
00040 self::convertStdAttributes($obj, $attrs);
00041 self::convertStdEvents($obj, $node);
00042 return $obj;
00043 }
00044 }
00045
00046 ?>