--- loncom/interface/lonhtmlcommon.pm 2009/05/26 20:06:46 1.219 +++ loncom/interface/lonhtmlcommon.pm 2009/06/16 15:17:12 1.225 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.219 2009/05/26 20:06:46 droeschl Exp $ +# $Id: lonhtmlcommon.pm,v 1.225 2009/06/16 15:17:12 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_breadcrumbs" }) 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 { @@ -1830,13 +1814,11 @@ sub course_custom_roles { # sub topic_bar { my ($imgnum,$title) = @_; - return ' -
- '.&mt('Step [_1]',$imgnum).
-              '   - '.$title.' -
-'; + return '
' + .''.&mt('Step [_1]',$imgnum).'' + .' '.$title + .'
'; } ############################################## @@ -2216,13 +2198,112 @@ sub generate_menu { push @categories, $div->($h3->(mt($$category{categorytitle}), {class=>"LC_hcell"}). $ul->(join('' ,@links), {class =>"LC_ListStyleNormal" }), - {class=>"LC_ContentBoxSpecial LC_400Box"}) if scalar(@links); + {class=>"LC_Box LC_400Box"}) if scalar(@links); } # wrap the joined @categories in another
(column layout) 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__