phpMv  -UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
HtmlAccordionMenu.php
Go to the documentation of this file.
1 <?php
2 
4 
6 use Ajax\JsUtils;
8 
9 class HtmlAccordionMenu extends HtmlMenu{
10  protected $params=array();
11 
12  public function __construct( $identifier, $items=array() ){
13  parent::__construct( $identifier, $items);
14  $this->addToProperty("class", "accordion");
15  $this->setVertical();
16  }
17 
22  protected function createItem($value) {
23  $title=$value;
24  $content="";
25  if(\is_array($value)){
26  $title=@$value[0];$content=@$value[1];
27  }
28  $itemO=new HtmlAccordionMenuItem("item-".$this->identifier."-".$this->count(), $title, $content);
29  return $itemO->setClass("item");
30  }
31 
32  /*
33  * (non-PHPdoc)
34  * @see BaseHtml::run()
35  */
36  public function run(JsUtils $js) {
37  if(isset($this->_bsComponent)===false)
38  $this->_bsComponent=$js->semantic()->accordion("#".$this->identifier,$this->params);
39  $this->addEventsOnRun($js);
40  return $this->_bsComponent;
41  }
42 
43  public function setExclusive($value){
44  $this->params["exclusive"]=$value;
45  }
46 }
addToProperty($name, $value, $separator=" ")
addEventsOnRun(JsUtils $js=NULL)
semantic(Semantic $semantic=NULL)
getter or setter of the Semantic-UI variable
Definition: JsUtils.php:159
JQuery PHP library.
Definition: JsUtils.php:23