[LON-CAPA-cvs] cvs: loncom(GCI_3) /interface lonhtmlcommon.pm
raeburn
raeburn@source.lon-capa.org
Mon, 04 Oct 2010 19:43:31 -0000
raeburn Mon Oct 4 19:43:31 2010 EDT
Modified files: (Branch: GCI_3)
/loncom/interface lonhtmlcommon.pm
Log:
- Customization for GCI_3
- Elimination of Main Menu for Concept Tests.
- First item in breadcrumbs is Contents instead of Main Menu.
- Second arg passed to &render_advtools() is legend, to create
legend in tertiary menu.
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.253.2.3 loncom/interface/lonhtmlcommon.pm:1.253.2.4
--- loncom/interface/lonhtmlcommon.pm:1.253.2.3 Mon Oct 4 19:19:15 2010
+++ loncom/interface/lonhtmlcommon.pm Mon Oct 4 19:43:30 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.253.2.3 2010/10/04 19:19:15 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.253.2.4 2010/10/04 19:43:30 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1382,20 +1382,28 @@
return unless($last);
} else {
my $description = 'Menu';
+ my $href = '/adm/menu';
+ my $tooltip = 'Go to main menu';
my $no_mt_descr = 0;
if ((exists($env{'request.course.id'})) &&
- ($env{'request.course.id'} ne '') &&
- ($env{'course.'.$env{'request.course.id'}.'.description'} ne '')) {
- $description =
- $env{'course.'.$env{'request.course.id'}.'.description'};
- $no_mt_descr = 1;
+ ($env{'request.course.id'} ne '')) {
+
+ if ((&Apache::loncommon::needs_gci_custom()) || ($env{'user.domain'} eq 'gcitest')) {
+ $href = '/adm/navmaps';
+ $tooltip = 'Contents';
+ }
+ if ($env{'course.'.$env{'request.course.id'}.'.description'} 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) {
+ $menulink = { href => $href,
+ title => $tooltip,
+ target => '_top',
+ text => $description,
+ no_mt => $no_mt_descr, };
+ if ($last) {
#$last set, so we have some crumbs
unshift(@Crumbs,$menulink);
} else {
@@ -1433,7 +1441,7 @@
# last breadcrumb is the first order heading of a page
# for course breadcrumbs it's just bold
$links .= htmltag( 'li', htmltag($CourseBreadcrumbs ? 'b' : 'h1',
- $lasttext), {title => $lasttext});
+ $lasttext), {title => $lasttext});
my $icons = '';
$faq = $last->{'faq'} if (exists($last->{'faq'}));
@@ -1568,7 +1576,7 @@
{ listattr => { class=>'LC_breadcrumb_tools_outerlist' } });
}
-=item render_advtools(\$breadcrumbs)
+=item render_advtools(\$breadcrumbs,$legend)
Creates html for advanced tools (category advtools) and inserts \$breadcrumbs
at the correct position.
@@ -1580,12 +1588,15 @@
=cut
sub render_advtools {
- my ($breadcrumbs) = @_;
+ my ($breadcrumbs,$legend) = @_;
return unless (defined $tools{'advtools'})
and (scalar(@{$tools{'advtools'}}) > 0);
-
+ my $args;
+ if ($legend) {
+ $args = {legend => $legend};
+ }
$$breadcrumbs .= Apache::loncommon::head_subbox(
- funclist_from_array($tools{'advtools'}) );
+ funclist_from_array($tools{'advtools'},$args));
}
} # End of scope for @Crumbs