--- loncom/interface/lonmenu.pm 2012/08/03 22:38:35 1.369.2.18
+++ loncom/interface/lonmenu.pm 2012/09/12 05:14:17 1.387
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.369.2.18 2012/08/03 22:38:35 raeburn Exp $
+# $Id: lonmenu.pm,v 1.387 2012/09/12 05:14:17 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -117,9 +117,9 @@ Same as primary_menu() but operates on @
=item create_submenu()
-Creates XHTML for unordered list of sub-menu items which belong to a
+Creates XHTML for unordered list of sub-menu items which belong to a
particular top-level menu item. Uses hover pseudo class in css to display
-dropdown list when mouse hovers over top-level item. Support for IE6
+dropdown list when mouse hovers over top-level item. Support for IE6
(no hover psuedo class) via LC_hoverable class for
tag for top-
level item, which employs jQuery to handle behavior on mouseover.
@@ -131,26 +131,6 @@ Inputs: 4 - (a) link and (b) target for
This gets called in order to register a URL in the body of the document
-=item loadevents()
-
-=item unloadevents()
-
-=item startupremote()
-
-=item setflags()
-
-=item maincall()
-
-=item load_remote_msg()
-
-=item get_menu_name()
-
-=item reopenmenu()
-
-=item open()
-
-Open the menu
-
=item clear()
=item switch()
@@ -202,7 +182,7 @@ use HTML::Entities();
use Apache::lonwishlist();
use vars qw(@desklines %category_names %category_members %category_positions
- $readdesk @primary_menu %primary_submenu @secondary_menu %secondary_submenu);
+ $readdesk @primary_menu %primary_submenu @secondary_menu);
my @inlineremote;
@@ -267,10 +247,10 @@ sub primary_menu {
my @primsub;
if (ref($primary_submenu{$title}) eq 'ARRAY') {
foreach my $item (@{$primary_submenu{$title}}) {
- next if (($item->[2] eq 'wishlist') && (!$env{'user.adv'}));
+ next if (($item->[2] eq 'wishlist') && (!$env{'user.adv'}));
next if (($item->[2] eq 'reqcrs') && (!&check_for_rcrs()));
- next if ((($item->[2] eq 'portfolio') ||
- ($item->[2] eq 'blog')) &&
+ next if ((($item->[2] eq 'portfolio') ||
+ ($item->[2] eq 'blog')) &&
(!&Apache::lonnet::usertools_access('','',$item->[2],
undef,'tools')));
push(@primsub,$item);
@@ -338,12 +318,12 @@ sub secondary_menu {
: '');
my $canedit = &Apache::lonnet::allowed('mdc', $env{'request.course.id'});
my $canviewroster = $env{'course.'.$env{'request.course.id'}.'.student_classlist_view'};
- my $canviewgrps = &Apache::lonnet::allowed('vcg', $crs_sec);
- my $canmodifyuser = &Apache::lonnet::allowed('cst', $crs_sec);
- my $canviewwnew = &Apache::lonnet::allowed('whn', $crs_sec);
+ my $canviewgrps = &Apache::lonnet::allowed('vcg', $crs_sec);
+ my $canmodifyuser = &Apache::lonnet::allowed('cst', $crs_sec);
+ my $canviewwnew = &Apache::lonnet::allowed('whn', $crs_sec);
my $canmodpara = &Apache::lonnet::allowed('opa', $crs_sec);
my $canvgr = &Apache::lonnet::allowed('vgr', $crs_sec);
- my $canmgr = &Apache::lonnet::allowed('mgr', $crs_sec);
+ my $canmgr = &Apache::lonnet::allowed('mgr', $crs_sec);
my $author = &getauthor();
my %groups = &Apache::lonnet::get_active_groups(
@@ -359,10 +339,6 @@ sub secondary_menu {
&& !$env{'request.course.id'};
next if $$menuitem[4] =~ /^mdc/
&& !$canedit;
- next if $$menuitem[4] eq 'mdcCourse'
- && ($crstype eq 'Community');
- next if $$menuitem[4] eq 'mdcCommunity'
- && ($crstype eq 'Course');
next if $$menuitem[4] eq 'nvgr'
&& $canvgr;
next if $$menuitem[4] eq 'vgr'
@@ -379,45 +355,19 @@ sub secondary_menu {
&& !$canviewwnew;
next if $$menuitem[4] eq 'opa'
&& !$canmodpara;
- next if $$menuitem[4] eq 'nvcg'
- && ($canviewgrps || !%groups);
+ next if $$menuitem[4] =~ /showgroups$/
+ && !$canviewgrps
+ && !%groups;
next if $$menuitem[4] eq 'author'
&& !$author;
- my $title = $menuitem->[3];
- if (defined($secondary_submenu{$title})) {
- my ($link,$target);
- if ($menuitem->[0] ne '') {
- $link = $menuitem->[0];
- $target = '_top';
- } else {
- $link = '#';
- }
- my @scndsub;
- if (ref($secondary_submenu{$title}) eq 'ARRAY') {
- foreach my $item (@{$secondary_submenu{$title}}) {
- if (ref($item) eq 'ARRAY') {
- next if ($item->[2] eq 'vgr' && !$canvgr);
- next if ($item->[2] eq 'opa' && !$canmodpara);
- next if ($item->[2] eq 'cst' && !$canmodifyuser);
- next if ($item->[2] eq 'mgr' && !$canmgr);
- next if ($item->[2] eq 'vcg' && !$canviewgrps);
- push(@scndsub,$item);
- }
- }
- if (@scndsub > 0) {
- $menu .= &create_submenu($link,$target,$title,\@scndsub);
- } elsif ($link) {
- $menu .= '