diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index 9d8a1bd6b..3ec6ac8ca 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -570,9 +570,13 @@ class e_form /** * Render Bootstrap Tabs * - * @param $array - * @param $options - * @return string + * @param array $array + * @param array $options = [ + * 'active' => (string|int) - array key of the active tab. + * 'fade' => (bool) - use fade effect or not. + * 'class' => (string) - custom css class of the tab content container + * ] + * @return string html * @example * $array = array( * 'home' => array('caption' => 'Home', 'text' => 'some tab content' ), @@ -581,14 +585,23 @@ class e_form */ public function tabs($array, $options = array()) { - $initTab = varset($options['active'],false); - $id = !empty($options['id']) ? 'id="'.$options['id'].'"' : ''; + $initTab = varset($options['active'], false); + + if(is_numeric($initTab)) + { + $initTab = 'tab-'.$initTab; + } + + $id = !empty($options['id']) ? 'id="'.$options['id'].'" ' : ''; + $toggle = ($this->_bootstrap > 3) ? 'data-bs-toggle="tab"' : 'data-toggle="tab"'; + $text =' -