';
+ my ($component,$component_help,$menulink,$helplink,$css_class,$no_mt, $CourseBreadcrumbs) = @_;
#
+ $css_class ||= 'LC_breadcrumbs';
+
# Make the faq and bug data cascade
- my $faq = '';
- my $bug = '';
- my $help='';
+ my $faq = '';
+ my $bug = '';
+ my $help = '';
+ # Crumb Symbol
+ my $crumbsymbol = '»';
# The last breadcrumb does not have a link, so handle it separately.
my $last = pop(@Crumbs);
#
# The first one should be the course or a menu link
- if (!defined($menulink)) { $menulink=1; }
+ if (!defined($menulink)) { $menulink=1; }
if ($menulink) {
my $description = 'Menu';
+ my $no_mt_descr = 0;
if (exists($env{'request.course.id'}) &&
$env{'request.course.id'} ne '') {
$description =
$env{'course.'.$env{'request.course.id'}.'.description'};
+ $no_mt_descr = 1;
+ }
+ $menulink = { href =>'/adm/menu',
+ title =>'Go to main menu',
+ target =>'_top',
+ text =>$description,
+ no_mt =>$no_mt_descr, };
+ if($last) {
+ #$last set, so we have some crumbs
+ unshift(@Crumbs,$menulink);
+ } else {
+ #only menulink crumb present
+ $last = $menulink;
}
- unshift(@Crumbs,{
- href =>'/adm/menu',
- title =>'Go to main menu',
- target =>'_top',
- text =>$description,
- });
}
- my $links .=
- join('->',
+ my $links = join "",
map {
- $faq = $_->{'faq'} if (exists($_->{'faq'}));
- $bug = $_->{'bug'} if (exists($_->{'bug'}));
+ $faq = $_->{'faq'} if (exists($_->{'faq'}));
+ $bug = $_->{'bug'} if (exists($_->{'bug'}));
$help = $_->{'help'} if (exists($_->{'help'}));
- my $result = '{'target'}) && $_->{'target'} ne '') {
- $result .= 'target="'.$_->{'target'}.'" ';
- }
- if ($_->{'no_mt'}) {
- $result .='title="'.$_->{'title'}.'">'.
- $_->{'text'}.'';
- } else {
- $result .='title="'.&mt($_->{'title'}).'">'.
- &mt($_->{'text'}).'';
- }
- $result;
- } @Crumbs
- );
- $links .= '->' if ($links ne '');
- if ($last->{'no_mt'}) {
- $links .= ''.$last->{'text'}.'';
- } else {
- $links .= ''.&mt($last->{'text'}).'';
- }
- #
+
+ my $result = htmltag( 'a',
+ $_->{no_mt} ?
+ $_->{text} : mt($_->{text}),
+ {
+ href => $_->{href},
+ title => $_->{no_mt} ?
+ $_->{title} : mt($_->{title}),
+ target => $_->{target},
+ });
+ $result = htmltag( 'li', "$result $crumbsymbol");
+ } @Crumbs;
+
+ #should the last Element be translated?
+ $links .= htmltag( 'li',
+ htmltag( 'b',
+ $last->{'no_mt'} ?
+ $last->{'text'} : mt($last->{'text'}) ));
+
my $icons = '';
- $faq = $last->{'faq'} if (exists($last->{'faq'}));
- $bug = $last->{'bug'} if (exists($last->{'bug'}));
+ $faq = $last->{'faq'} if (exists($last->{'faq'}));
+ $bug = $last->{'bug'} if (exists($last->{'bug'}));
$help = $last->{'help'} if (exists($last->{'help'}));
$component_help=($component_help?$component_help:$help);
# if ($faq ne '') {
@@ -1282,29 +1424,36 @@ returns: nothing
# if ($bug ne '') {
# $icons .= &Apache::loncommon::help_open_bug($bug);
# }
- if ($faq ne '' || $component_help ne '' || $bug ne '') {
- $icons .= &Apache::loncommon::help_open_menu($component,
- $component_help,
- $faq,$bug);
- }
- #
- $Str .= $links.' | ';
- #
- if (defined($component)) {
- $Str .= ''.
- &mt($component);
- if ($icons ne '') {
- $Str .= ' '.$icons;
- }
- $Str .= ' | ';
+ if ($faq ne '' || $component_help ne '' || $bug ne '') {
+ $icons .= &Apache::loncommon::help_open_menu($component,
+ $component_help,
+ $faq,$bug);
}
- $Str .= '