HCE Project DC service web UI  0.2
Hierarchical Cluster Engine DC service web UI
 All Classes Namespaces Files Functions Variables Pages
TbFormButtonElement.php
Go to the documentation of this file.
1 <?php
11 class TbFormButtonElement extends CFormElement {
12 
17  public $name;
18 
19  private $_on;
20 
29  public function getOn()
30  {
31  return $this->_on;
32  }
33 
37  public function setOn($value)
38  {
39  $this->_on = preg_split('/[\s,]+/', $value, -1, PREG_SPLIT_NO_EMPTY);
40  }
41 
45  public function render()
46  {
48  $attributes['htmlOptions']['name'] = $this->name;
49 
50  return $this->getParent()->getOwner()->widget('TbButton', $attributes, true);
51  }
52 
59  protected function evaluateVisible()
60  {
61  return empty($this->_on) || in_array($this->getParent()->getModel()->getScenario(), $this->_on);
62  }
63 }