--- loncom/interface/lonhtmlcommon.pm 2009/06/08 18:04:45 1.222 +++ loncom/interface/lonhtmlcommon.pm 2009/06/11 16:48:33 1.224 @@ -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.224 2009/06/11 16:48:33 bisitz 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 { @@ -2221,6 +2205,105 @@ sub generate_menu { return $div->(join('', @categories), {class => "LC_columnSection"}); } +############################################## +############################################## + +=pod + +=item &start_funclist + +Start list of available functions + +Typically used to offer a simple list of available functions +at top or bottom of page. +All available functions/actions for the current page +should be included in this list. + +If the optional headline text is not provided, a default text will be used. + + +Related routines: +=over 4 +add_item_funclist +end_funclist +=back + + +Inputs: (optional) headline text + +Returns: HTML code with function list start + +=cut + +############################################## +############################################## + +sub start_funclist { + my($legendtext)=@_; + $legendtext=&mt('Functions') if !$legendtext; + return "
\n$legendtext\n" + .'\n
\n"; +} + 1; __END__