--- loncom/interface/lonhtmlcommon.pm 2009/06/08 18:04:45 1.222 +++ loncom/interface/lonhtmlcommon.pm 2009/06/10 13:32:38 1.223 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.222 2009/06/08 18:04:45 bisitz Exp $ +# $Id: lonhtmlcommon.pm,v 1.223 2009/06/10 13:32:38 droeschl Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1314,15 +1314,13 @@ sub htmlareabrowser { =item breadcrumbs Compiles the previously registered breadcrumbs into an series of links. -FAQ and BUG links will be placed on the left side of the table if they -are defined for the last registered breadcrumb. Additionally supports a 'component', which will be displayed on the -right side of the table (without a link). +right side of the breadcrumbs enclosing div (without a link). A link to help for the component will be included if one is specified. All inputs can be undef without problems. -Inputs: $component (the large text on the right side of the table), +Inputs: $component (the text on the right side of the breadcrumbs trail), $component_help $menulink (boolean, controls whether to include a link to /adm/menu) $helplink (if 'nohelp' don't include the orange help link) @@ -1357,20 +1355,13 @@ returns: nothing my ($component,$component_help,$menulink,$helplink,$css_class,$no_mt, $CourseBreadcrumbs) = @_; # $css_class ||= 'LC_breadcrumbs'; - my $Str1 = '
    '; - - if($CourseBreadcrumbs){ - $Str1 = ''; - } else { - $Str1 .= $links.'
'; - } - # - if (defined($component)) { - $Str .= "\n".'' - .'
'; - if ($no_mt) { - $Str .= $component; - } else { - $Str .= &mt($component); - } - if ($icons ne '') { - $Str .= ' '.$icons; - } - $Str .= '
'."\n"; + unless ($CourseBreadcrumbs) { + $links = htmltag('ol', $links, { id => "LC_MenuBreadcrumbs" }); + } else { + $links = htmltag('ul', $links, { id => "LC_CourseBreadcrumbs" }); } - # + + if ($component) { + $links = htmltag('span', + ( $no_mt ? $component : mt($component) ). + ( $icons ? $icons : '' ), + { class => 'LC_breadcrumbs_component' } ) + .$links; + } + + $links = htmltag('div', $links, + { id => "LC_head_subbox" }) unless ($CourseBreadcrumbs) ; + # Return the @Crumbs stack to what we started with push(@Crumbs,$last); shift(@Crumbs); - # Return a table and after that the breadcrumb's line - return "$Str\n$Str1"; + # Return the breadcrumb's line + return "$links"; } sub clear_breadcrumbs {