--- loncom/interface/lonmenu.pm 2016/04/02 04:30:20 1.443
+++ loncom/interface/lonmenu.pm 2016/05/04 05:54:51 1.447
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.443 2016/04/02 04:30:20 raeburn Exp $
+# $Id: lonmenu.pm,v 1.447 2016/05/04 05:54:51 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -124,9 +124,13 @@ dropdown list when mouse hovers over top
(no hover psuedo class) via LC_hoverable class for
tag for top-
level item, which employs jQuery to handle behavior on mouseover.
-Inputs: 4 - (a) link and (b) target for anchor href in top level item,
- (c) title for text wrapped by anchor tag in top level item.
- (d) reference to array of arrays of sub-menu items.
+Inputs: 6 - (a) link and (b) target for anchor href in top level item,
+ (c) title for text wrapped by anchor tag in top level item,
+ (d) reference to array of arrays of sub-menu items,
+ (e) boolean to indicate whether to call &mt() to translate
+ name of menu item,
+ (f) optional class for element in primary menu, for which
+ sub menu is being generated.
The underlying datastructure used in (d) contains data from mydesk.tab.
It consists of an array which has an array for each item appearing in
@@ -534,13 +538,13 @@ sub secondary_menu {
}
sub create_submenu {
- my ($link,$target,$title,$submenu,$translate) = @_;
+ my ($link,$target,$title,$submenu,$translate,$addclass) = @_;
return unless (ref($submenu) eq 'ARRAY');
my $disptarget;
if ($target ne '') {
$disptarget = ' target="'.$target.'"';
}
- my $menu = ''.
+ my $menu = ''.
''.
''.$title.
''.
@@ -560,7 +564,7 @@ sub create_submenu {
# see perldoc create_submenu documentation for further information
sub build_submenu {
my ($target, $submenu, $translate, $first_level) = @_;
- if (!defined(@{$submenu})) {
+ unless (@{$submenu}) {
return '';
}
@@ -840,11 +844,27 @@ ENDMENUITEMS
$menuitems = "c&3&1";
if (($crstype ne 'Placement') || ($env{'request.role.adv'})) {
$menuitems.="
-s&2&1&back.png&&&gopost('/adm/flip','back:'+currentURL)&Previous content resource&&1";
+s&2&1&back.png&&&gopost('/adm/flip','back:'+currentURL)&Previous content resource&&1
+s&2&3&forw.png&&&gopost('/adm/flip','forward:'+currentURL)&Next content resource&&3";
+ } else {
+# Suppress display of backward arrow for Placement Tests
+# Suppress display of forward arrow for Placement Tests if this is the last resource.
+ my $showforw = 1;
+ if ($env{'request.symb'}) {
+ my $navmap = Apache::lonnavmaps::navmap->new();
+ if (ref($navmap)) {
+ if (&Apache::lonplacementtest::is_lastres($env{'request.symb'},$navmap)) {
+ $showforw = 0;
+ }
+ }
+ }
+ if ($showforw) {
+ $menuitems.="
+s&2&3&forw.png&&&gopost('/adm/flip','forward:'+currentURL)&Next content resource&&3";
+ }
}
$menuitems .= (<'.
+ &mt('Test is [_1]% complete',$complete).'';
+}
+
# ================================================================ Main Program
BEGIN {