diff --git a/etemplate/inc/class.etemplate_widget_tabbox.inc.php b/etemplate/inc/class.etemplate_widget_tabbox.inc.php index e10091e0c0..58f10bf1af 100644 --- a/etemplate/inc/class.etemplate_widget_tabbox.inc.php +++ b/etemplate/inc/class.etemplate_widget_tabbox.inc.php @@ -17,15 +17,19 @@ class etemplate_widget_tabbox extends etemplate_widget { /** - * Fill additional tabs - * - * @param string $cname - */ - public function beforeSendToClient($cname) - { + * Fill additional tabs + * + * @param string $cname + */ + public function beforeSendToClient($cname) + { if($this->attrs['tabs']) { - $this->children[1]->children = array(); + // add_tabs toggles replacing or adding to existing tabs + if(!$this->attrs['add_tabs']) + { + $this->children[1]->children = array(); + } foreach($this->attrs['tabs'] as $tab) { if($tab['id']) @@ -68,7 +72,12 @@ class etemplate_widget_tabbox extends etemplate_widget } // Make sure additional tabs are processed - $this->children[1]->children = array(); + + // add_tabs toggles replacing or adding to existing tabs + if(!$this->attrs['add_tabs']) + { + $this->children[1]->children = array(); + } foreach($this->attrs['tabs'] as $tab) { if($tab['id'] && $content[$tab['id']]) @@ -82,6 +91,12 @@ class etemplate_widget_tabbox extends etemplate_widget $tab_valid = $content[$tab['id']]; */ } + else + { + $template= clone etemplate_widget_template::instance($tab['template']); + $this->children[1]->children[] = $template; + unset($template); + } } $valid = $value; }