1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-18 12:21:45 +02:00

Issue #539 - validation of user-extended elements will automatically switch tabs when an error is found.

This commit is contained in:
Cameron
2014-10-06 17:32:36 -07:00
parent 877fad903a
commit ad0491c901
4 changed files with 69 additions and 30 deletions

View File

@@ -208,6 +208,11 @@ class e_form
$c = 0;
foreach($array as $key=>$tab)
{
if(is_numeric($key))
{
$key = 'tab-'.$this->name2id($tab['caption']);
}
$active = ($c == 0) ? ' class="active"' : '';
$text .= '<li'.$active.'><a href="#'.$key.'" data-toggle="tab">'.$tab['caption'].'</a></li>';
$c++;
@@ -222,6 +227,11 @@ class e_form
$c=0;
foreach($array as $key=>$tab)
{
if(is_numeric($key))
{
$key = 'tab-'.$this->name2id($tab['caption']);
}
$active = ($c == 0) ? ' active' : '';
$text .= '<div class="tab-pane'.$active.'" id="'.$key.'">'.$tab['text'].'</div>';
$c++;