| @@ 24-35 (lines=12) @@ | ||
| 21 | * @param string $cssStyle btn-default, btn-primary... |
|
| 22 | * @param string $onClick JS Code for click event |
|
| 23 | */ |
|
| 24 | public function __construct($identifier, $value="", $cssStyle=null, $onClick=null) { |
|
| 25 | parent::__construct($identifier, "button"); |
|
| 26 | $this->setProperty("class", "btn btn-default"); |
|
| 27 | $this->setProperty("role", "button"); |
|
| 28 | $this->content=$value; |
|
| 29 | if (isset($cssStyle)) { |
|
| 30 | $this->setStyle($cssStyle); |
|
| 31 | } |
|
| 32 | if (isset($onClick)) { |
|
| 33 | $this->onClick($onClick); |
|
| 34 | } |
|
| 35 | } |
|
| 36 | ||
| 37 | /** |
|
| 38 | * Set the button value |
|
| @@ 17-29 (lines=13) @@ | ||
| 14 | class HtmlButtongroups extends HtmlBsDoubleElement { |
|
| 15 | protected $elements; |
|
| 16 | ||
| 17 | public function __construct($identifier, $elements=array(), $cssStyle=NULL, $size=NULL, $tagName="div") { |
|
| 18 | parent::__construct($identifier, $tagName); |
|
| 19 | $this->_template="<%tagName% id='%identifier%' %properties%>%elements%</%tagName%>"; |
|
| 20 | $this->setProperty("class", "btn-group"); |
|
| 21 | $this->setRole("group"); |
|
| 22 | $this->addElements($elements); |
|
| 23 | if (isset($cssStyle)) { |
|
| 24 | $this->setStyle($cssStyle); |
|
| 25 | } |
|
| 26 | if (isset($size)) { |
|
| 27 | $this->setSize($size); |
|
| 28 | } |
|
| 29 | } |
|
| 30 | ||
| 31 | /** |
|
| 32 | * define the buttons size |
|