From: urs_hunkler Date: Sun, 4 Mar 2007 17:16:00 +0000 (+0000) Subject: merged tabs routine changes to resolve IE6 + 7 tabs issues X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=d11a1daa5ff4c8bf843744bfc1cd8c17b9b6698e;p=moodle.git merged tabs routine changes to resolve IE6 + 7 tabs issues --- diff --git a/lib/weblib.php b/lib/weblib.php index 77cd020183..c9bc82a08b 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -5576,36 +5576,42 @@ function convert_tree_to_html($tree, $row=0) { foreach ($tree as $tab) { $count--; // countdown to zero + $liclass = ''; + if ($first && ($count == 0)) { // Just one in the row - $str .= '
  • '; + $liclass = 'first last'; $first = false; } else if ($first) { - $str .= '
  • '; + $liclass = 'first'; $first = false; } else if ($count == 0) { - $str .= '
  • '; - } else { - $str .= '
  • '; + $liclass = 'last'; } - if ($tab->selected) { - $linkclass = ' class="here selected"'; - } else if ($tab->active) { - $linkclass = ' class="here active"'; - } else { - $linkclass = ''; + if ((empty($tab->subtree)) && (!empty($tab->selected))) { + $liclass .= (empty($liclass)) ? 'onerow' : ' onerow'; } if ($tab->inactive || $tab->active || ($tab->selected && !$tab->linkedwhenselected)) { - $str .= ''.$tab->text.''; + if ($tab->selected) { + $liclass .= (empty($liclass)) ? 'here selected' : ' here selected'; + } else if ($tab->active) { + $liclass .= (empty($liclass)) ? 'here active' : ' here active'; + } + } + + $str .= (!empty($liclass)) ? '
  • ' : '
  • '; + + if ($tab->inactive || $tab->active || ($tab->selected && !$tab->linkedwhenselected)) { + $str .= ''.$tab->text.''; } else { - $str .= ''.$tab->text.''; + $str .= ''.$tab->text.''; } if (!empty($tab->subtree)) { $str .= convert_tree_to_html($tab->subtree, $row+1); } else if ($tab->selected) { - $str .= ''."\n"; + $str .= '
     
    '."\n"; } $str .= '
  • '."\n";