24 $this->_template=
"<%tagName% %properties%>%tabs%</%tagName%>%content%";
25 $this->
setProperty(
"class",
"nav nav-".$this->_tabsType);
28 protected function addTab_($tab, $index=
null) {
30 $tab->setMTagName(
"li");
36 array_splice($this->tabs, $index, 0, $inserted);
42 $size=\sizeof($this->tabs);
43 for ($i=0;$i<$size;$i++){
44 $this->tabs[$i]->setActive($i==$index);
49 $this->tabs[$index]->disable();
52 public function addTab($element, $index=
null) {
55 if (is_string($element)) {
56 $tab=
new HtmlTabItem(
"tab-".$this->identifier.
"-".$iid, $element);
58 } elseif (\is_array($element)) {
59 $tab=
new HtmlTabItem(
"tab-".$this->identifier.
"-".$iid);
60 $tab->fromArray($element);
73 $array=parent::fromArray($array);
79 foreach (
$tabs as $tab ) {
99 $this->
setProperty(
"class",
"nav nav-".$this->_tabsType.
" ".$this->stacked);
100 return parent::compile($js, $view);
108 $this->_bsComponent=
new Tabs($js);
109 foreach ( $this->tabs as $tab ) {
110 $this->_bsComponent->addTab($tab->run($js));
118 foreach ( $this->tabs as $tab ) {
120 $tabContent->addTabItem($tab->getHref());
122 foreach ( $tab->getItems() as $dropdownItem ) {
123 $tabContent->addTabItem($dropdownItem->getHref());
135 $this->content->getTabItem($index);
139 $tabContentItem=$this->content->getTabItem($index);
140 if (isset($tabContentItem))
141 $tabContentItem->setContent($text);
149 if ($index<
sizeof($this->content->get))
154 if (
sizeof($this->content->getTabItems())>0) {
155 $this->content->getTabItem(0)->addToProperty(
"class",
"fade in");
157 for($index=0; $index<$size; $index++) {
158 $this->content->getTabItem($index)->addToProperty(
"class",
"fade");
163 public function on($event, $jsCode,$stopPropagation=
false,$preventDefault=
false){
164 foreach ($this->tabs as $tab){
165 $tab->on($event,$jsCode,$stopPropagation,$preventDefault);
172 $this->stacked=
"nav-stacked";
173 else $this->stacked=
"";
180 $this->
addTab($function($object));
Composant Twitter Bootstrap Tab.
Twitter Bootstrap HTML Dropdown component.
__construct($identifier, $tagName="ul")
run(JsUtils $js)
SimpleExtComponent\Ajax\common\html\BaseHtmlrun()\Ajax\common\html\BaseHtmlrun()
setTabstype($_tabsType="tabs")
compile(JsUtils $js=NULL, &$view=NULL)
addTab_($tab, $index=null)
addTab($element, $index=null)
on($event, $jsCode, $stopPropagation=false, $preventDefault=false)
setStacked($stacked=true)
setContentToTab($index, $text)
fromDatabaseObject($object, $function)
Twitter Bootstrap HTML TabContent component.
Inner element for Twitter Bootstrap HTML Dropdown component.
addEventsOnRun(JsUtils $js=NULL)
setProperty($name, $value)