--- loncom/interface/lonhtmlcommon.pm 2008/12/17 12:59:49 1.196 +++ loncom/interface/lonhtmlcommon.pm 2009/01/22 14:44:40 1.200 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.196 2008/12/17 12:59:49 harmsja Exp $ +# $Id: lonhtmlcommon.pm,v 1.200 2009/01/22 14:44:40 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1278,6 +1278,8 @@ Inputs: $component (the large text on th $menulink (boolean, controls whether to include a link to /adm/menu) $helplink (if 'nohelp' don't include the orange help link) $css_class (optional name for the class to apply to the table for CSS) + $no_mt (optional flag, 1 if &mt() is _not_ to be applied to $component + when including the text on the right. Returns a string containing breadcrumbs for the current page. =item clear_breadcrumbs @@ -1303,17 +1305,18 @@ returns: nothing my @Crumbs; sub breadcrumbs { - my ($component,$component_help,$menulink,$helplink,$css_class) = @_; + my ($component,$component_help,$menulink,$helplink,$css_class,$no_mt) = @_; # $css_class ||= 'LC_breadcrumbs'; - my $Str = "\n".''; + $Str1 .= $links.''; # if (defined($component)) { - $Str .= '
    '; + my $Str1 = '
      '; + my $Str = ''; # # Make the faq and bug data cascade my $faq = ''; my $bug = ''; my $help=''; # Crumb Symbol - my $crumbsymbol = ' ▶ '; + my $crumbsymbol = '▶ '; # The last breadcrumb does not have a link, so handle it separately. my $last = pop(@Crumbs); # @@ -1336,31 +1339,31 @@ returns: nothing no_mt =>$no_mt_descr, }); } - my $links .= - join($crumbsymbol, + my $links .= '
    1. '. + join('
    2. '.$crumbsymbol, map { $faq = $_->{'faq'} if (exists($_->{'faq'})); $bug = $_->{'bug'} if (exists($_->{'bug'})); $help = $_->{'help'} if (exists($_->{'help'})); - my $result = '
    3. {'href'}.'" '; if (defined($_->{'target'}) && $_->{'target'} ne '') { $result .= 'target="'.$_->{'target'}.'" '; } if ($_->{'no_mt'}) { $result .='title="'.$_->{'title'}.'">'. - $_->{'text'}.'
    4. '; + $_->{'text'}.''; } else { $result .='title="'.&mt($_->{'title'}).'">'. - &mt($_->{'text'}).''; + &mt($_->{'text'}).''; } $result; } @Crumbs - ); - $links .= $crumbsymbol if ($links ne ''); + ).''; + $links .= '
    5. '.$crumbsymbol if ($links ne ''); if ($last->{'no_mt'}) { - $links .= '
    6. '.$last->{'text'}.'
    7. '; + $links .= ''.$last->{'text'}.''; } else { - $links .= '
    8. '.&mt($last->{'text'}).'
    9. '; + $links .= ''.&mt($last->{'text'}).''; } # my $icons = ''; @@ -1380,23 +1383,27 @@ returns: nothing $faq,$bug); } # - $Str .= $links.'
'. - &mt($component); + $Str .= "\n".'' + .''; + $Str .= '
'; + if ($no_mt) { + $Str .= $component; + } else { + $Str .= &mt($component); + } if ($icons ne '') { $Str .= ' '.$icons; } - $Str .= '
'."\n"; } - $Str .= '
'."\n"; # # Return the @Crumbs stack to what we started with push(@Crumbs,$last); shift(@Crumbs); # - return $Str; + return "$Str\n$Str1"; } sub clear_breadcrumbs { @@ -1546,7 +1553,7 @@ sub role_select_row { $output = &row_title($title,$css_class); } $output .= qq| - \n|; foreach my $role (@$roles) { my $plrole; if ($role eq 'ow') { @@ -1673,7 +1680,7 @@ sub status_select_row { $output = &row_title($title,$css_class,'LC_pick_box_select'); } $output .= qq| - \n|; foreach my $status_type (sort(keys(%{$types}))) { $output .= ' '; }