[LON-CAPA-cvs] cvs: loncom(GCI_3) /interface lonmenu.pm
raeburn
raeburn@source.lon-capa.org
Mon, 08 Nov 2010 22:51:23 -0000
raeburn Mon Nov 8 22:51:23 2010 EDT
Modified files: (Branch: GCI_3)
/loncom/interface lonmenu.pm
Log:
- Customization for GCI-3
- Support for pop-up navigation window
- Remove reference to undefined css class.
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.309.2.17 loncom/interface/lonmenu.pm:1.309.2.18
--- loncom/interface/lonmenu.pm:1.309.2.17 Thu Oct 7 15:39:27 2010
+++ loncom/interface/lonmenu.pm Mon Nov 8 22:51:23 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.309.2.17 2010/10/07 15:39:27 raeburn Exp $
+# $Id: lonmenu.pm,v 1.309.2.18 2010/11/08 22:51:23 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -165,6 +165,7 @@
sub primary_menu {
my $menu;
my $custommenu = &Apache::loncommon::needs_gci_custom();
+ my $numdc = &Apache::loncommon::check_for_gci_dc();
# each element of @primary contains following array:
# (link url, icon path, alt text, link text, condition)
foreach my $menuitem (@primary_menu) {
@@ -183,7 +184,8 @@
next if $$menuitem[4] eq 'gci'
&& (!$custommenu || $env{'request.role'} =~ m{^st\./gcitest/});
next if $$menuitem[4] eq 'home'
- && (($custommenu) || ($env{'user.domain'} eq 'gcitest'));
+ && (($custommenu) || ($env{'user.domain'} eq 'gcitest') ||
+ (($env{'user.domain'} eq 'gci') && !$numdc));
next if $$menuitem[4] eq 'gcitest'
&& (($env{'user.domain'} eq 'gci') || ($env{'request.role'} eq 'cm'));
next if $$menuitem[4] eq 'roles' # hide links which are
@@ -321,7 +323,11 @@
foreach my $key (keys(%courses)) {
$links{$key} = "javascript:switchpage('$key');";
if ($env{'request.course.id'} eq $courses{$key}) {
- $links{$key} = '/adm/navmaps';
+ if ($env{'environment.remotenavmap'} eq 'on') {
+ $links{$key} = "javascript:gonav('/adm/navmaps')";
+ } else {
+ $links{$key} = '/adm/navmaps';
+ }
$current = $key;
$links{'managetest'} = '/adm/roles?selectrole=1&cm=1&orgurl=%2fadm%2fmenu';
}
@@ -330,10 +336,10 @@
my $tabs;
foreach my $item (@menutabs) {
if ($item eq $current) {
- $tabs .= ' <li id="current"><a href="'.$links{$item}.'">'.
+ $tabs .= '<li id="current"><a href="'.$links{$item}.'">'.
$linktext{$item}.'</a></li>';
} else {
- $tabs .= ' <li><a href="'.$links{$item}.'">'.
+ $tabs .= '<li><a href="'.$links{$item}.'">'.
$linktext{$item}.'</a></li>';
}
}
@@ -622,9 +628,13 @@
my @crumbs;
unless (($forcereg) && ($env{'request.noversionuri'} eq '/adm/navmaps')
&& ($mapurl eq $env{'course.'.$env{'request.course.id'}.'.url'})) {
+ my $link = "javascript:gopost('/adm/navmaps','')";
+ if ($env{'environment.remotenavmap'} eq 'on') {
+ $link = "javascript:gonav('/adm/navmaps','')"
+ }
@crumbs = ({text => Apache::loncommon::course_type()
. ' Contents',
- href => "Javascript:gopost('/adm/navmaps','')"});
+ href => $link});
}
if ($mapurl ne $env{'course.'.$env{'request.course.id'}.'.url'}) {
push(@crumbs, {text => '...',
@@ -1443,13 +1453,19 @@
}
if ($env{'request.course.id'}) {
if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) {
+ my $navlink;
+ if ($env{'environment.remotenavmap'} eq 'on') {
+ $navlink = "javascript:gonav('/adm/navmaps')";
+ } else {
+ $navlink = '/adm/navmaps';
+ }
$output .=
- '<div class="LC_Box LC_800Box LC_GCI_Menu">'.
- '<h3 class="LC_hcell">'.&mt('Test Management').'</h3>'.
+ '<br /><br clear="all" /><div class="LC_Box LC_GCI_Menu">'.
+ '<h3 class="LC_hcell">'.&mt('Management').'</h3>'.
'<div class="LC_GCI_Menu_left">'.
'<dl class="LC_GCI_Menu">'.
- '<dt><a href="/adm/navmaps">'.&mt('Concept Test Contents').'</a></dt>'.
- '<dd style="background-image:url(\'/res/adm/pages/nav.png\');"><a class="LC_menubuttons_link" href="/adm/navmaps">'.&mt('Display the table of contents for your Concept Test.').'</a></dd>'.
+ '<dt><a href="'.$navlink.'">'.&mt('Concept Test Contents').'</a></dt>'.
+ '<dd style="background-image:url(\'/res/adm/pages/nav.png\');"><a class="LC_menubuttons_link" href="'.$navlink.'">'.&mt('Display the table of contents for your Concept Test.').'</a></dd>'.
'<dt><a href="/adm/coursedocs">'.&mt('Assemble Concept Test').'</a></dt>'.
'<dd style="background-image:url(\'/res/adm/pages/docs.png\');"><a class="LC_menubuttons_link" href="/adm/coursedocs">'.&mt('If no students have attempted the Concept Test you will be able to modify it. You can also change the start and end date of the test itself.').'</a></dd>'.
'<dt><a href="/adm/createuser">'.&mt('Enrollment and Student Activity').'</a></dt>'.
@@ -1474,14 +1490,20 @@
$navtext = &mt('Display Test Contents');
$navdesc = &mt('Display the table of contents for this Concept Test');
}
+ my $navlink;
+ if ($env{'environment.remotenavmap'} eq 'on') {
+ $navlink = "javascript:gonav('/adm/navmaps');"
+ } else {
+ $navlink = '/adm/navmaps';
+ }
$output .=
- '<div class="LC_Box LC_800Box LC_GCI_Menu">'.
+ '<div class="LC_Box LC_GCI_Menu">'.
'<h3 class="LC_hcell">'.&mt('Utilities').'</h3>'.
'<div class="LC_GCI_Menu_left">'.
'<dl class="LC_GCI_Menu">'.
- '<dt><a href="/adm/navmaps">'.$navtext.'</dt>'.
+ '<dt><a href="'.$navlink.'">'.$navtext.'</dt>'.
'<dd style="background-image:url(\'/res/adm/pages/nav.png\');">'.
- '<a class="LC_menubuttons_link" href="/adm/navmaps">'.$navdesc.'</a></dd></dl></div>';
+ '<a class="LC_menubuttons_link" href="'.$navlink.'">'.$navdesc.'</a></dd></dl></div>';
if ($canreq) {
$output .= '<div class="LC_GCI_Menu_right">'.
'<dl class="LC_GCI_Menu">'.
@@ -1492,7 +1514,7 @@
}
} elsif ($switcher || $canreq) {
$output .= '<br /><br />'.
- '<div class="LC_Box LC_800Box LC_GCI_Menu">'.
+ '<div class="LC_Box LC_GCI_Menu">'.
'<h3 class="LC_hcell">'.&mt('Utilities').'</h3>'.
'<div class="LC_GCI_Menu_left">'.
'<dl class="LC_GCI_Menu">';
@@ -1514,7 +1536,7 @@
my $queued = &Apache::loncoursequeueadmin::queued_selfenrollment('notitle');
if ($queued) {
$output .=
- '<div class="LC_Box LC_800Box">'.
+ '<div class="LC_Box">'.
'<h3 class="LC_hcell">'.&mt('Pending Enrollment Requests').'</h3>'.
$queued.
'</div>';