@@ 13-32 (lines=20) @@ | ||
10 | * @author jc |
|
11 | * @version 1.001 |
|
12 | */ |
|
13 | class HtmlFormCheckbox extends HtmlFormInput { |
|
14 | ||
15 | public function __construct($identifier, $label=NULL,$value=NULL,$type=NULL) { |
|
16 | parent::__construct($identifier, $label, "checkbox", $value=NULL); |
|
17 | if(isset($label)){ |
|
18 | $this->swapLabel(); |
|
19 | $label=$this->getLabel(); |
|
20 | $label->setClass="hidden"; |
|
21 | $label->setProperty("tabindex",0); |
|
22 | } |
|
23 | $this->setClass("ui checkbox"); |
|
24 | if(isset($type)) |
|
25 | $this->setType($type); |
|
26 | $this->wrap("<div class='field'>","</div>"); |
|
27 | } |
|
28 | ||
29 | public function setType($checkboxType){ |
|
30 | return $this->addToPropertyCtrl("class", $checkboxType, CheckboxType::getConstants()); |
|
31 | } |
|
32 | } |
@@ 12-27 (lines=16) @@ | ||
9 | * @author jc |
|
10 | * @version 1.001 |
|
11 | */ |
|
12 | class HtmlFormRadio extends HtmlFormInput { |
|
13 | ||
14 | public function __construct($identifier, $name=NULL,$label=NULL,$value=NULL) { |
|
15 | parent::__construct($identifier, $label, "radio", $value=NULL); |
|
16 | if(isset($name)) |
|
17 | $this->getField()->setProperty("name", $name); |
|
18 | if(isset($label)){ |
|
19 | $this->swapLabel(); |
|
20 | $label=$this->getLabel(); |
|
21 | $label->setClass="hidden"; |
|
22 | $label->setProperty("tabindex",0); |
|
23 | } |
|
24 | $this->setClass("ui radio checkbox"); |
|
25 | $this->wrap("<div class='field'>","</div>"); |
|
26 | } |
|
27 | } |