--- loncom/interface/lonmenu.pm 2006/06/12 18:10:37 1.185
+++ loncom/interface/lonmenu.pm 2006/07/10 22:34:36 1.194
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.185 2006/06/12 18:10:37 albertel Exp $
+# $Id: lonmenu.pm,v 1.194 2006/07/10 22:34:36 banghart Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -63,7 +63,7 @@ sub initlittle {
'docs' => 'Course Documents',
'exit' => 'Exit',
'launch' => 'Launch Remote Control',
- 'groups' => 'Course Groups',
+ 'groups' => 'Groups',
'gdoc' => 'Group Documents',
'teams' => 'Teams',
);
@@ -100,11 +100,11 @@ sub menubuttons {
}
if ($env{'request.course.id'}) {
my %coursegroups;
- my $viewgrps_permission =
- &Apache::lonnet::allowed('vcg',$env{'request.course.id'});
+ my $viewgrps_permission =
+ &Apache::lonnet::allowed('vcg',$env{'request.course.id'});
if (!$viewgrps_permission) {
%coursegroups = &Apache::lonnet::get_active_groups($env{'user.domain'},$env{'user.name'},$env{'course.'.$env{'request.course.id'}.'.domain'}, $env{'course.'.$env{'request.course.id'}.'.num'});
- }
+ }
if ((keys(%coursegroups) > 0) || ($viewgrps_permission)) {
$showgroups = 1;
}
@@ -129,11 +129,11 @@ ENDRELOAD
$lt{'docs'}
ENDDOCS
}
- if ($showgroups) {
- $groups =(<$lt{'groups'}
-ENDGROUPS
- }
+# if ($showgroups) {
+# $groups =(<$lt{'groups'}
+#ENDGROUPS
+# }
}
my $form=&serverform();
my $utility=&utilityfunctions();
@@ -175,11 +175,8 @@ ENDMAINMENU
$lt{'exit'}
|
-
-
- LON-CAPA
- |
-
+ LON-CAPA |
+
ENDINLINEMENU
@@ -194,26 +191,19 @@ ENDINLINEMENU
$navmaps=(<$lt{'nav'}
ENDNAV
+my $is_group = (&Apache::loncommon::course_type() eq 'Group');
if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) {
- my $text = $lt{'docs'};
- if ($env{'course.'.$env{'request.course.id'}.'.type'} eq
- 'Group') {
- $text = $lt{'gdoc'};
- }
+ my $text = ($is_group) ? $lt{'gdoc'} : $lt{'docs'};
$docs=(<$text
ENDDOCS
}
- if ($showgroups) {
- my $text = $lt{'groups'};
- if ($env{'course.'.$env{'request.course.id'}.'.type'} eq
- 'Group') {
- $text = $lt{'teams'};
- }
- $groups =(<$text
-ENDGROUPS
- }
+# if ($showgroups) {
+# my $text = ($is_group) ? $lt{'teams'} : $lt{'groups'};
+# $groups =(<$text
+#ENDGROUPS
+# }
if (
($env{'request.noversionuri'}=~m[^/(res|public)/] &&
$env{'request.symb'} eq '')
@@ -264,7 +254,7 @@ $groups
$remote
$lt{'roles'} |
$lt{'exit'} |
-LON-CAPA |
+LON-CAPA |
$form
@@ -452,10 +442,7 @@ sub innerregister {
('','',6,1,'cstr.gif','edit[_1]','resource[_2]',
"go('".$cfile."');","Edit this resource");
} elsif ($editbutton eq '') {
- $editbutton=&switch('','',6,1,'port.gif',
- 'port-[_1]','folio[_1]',
- "go('/adm/portfolio');",
- "Enter my portfolio space");
+ $editbutton=&clear(6,1);
}
}
###
@@ -787,7 +774,7 @@ ENDRESIZE
$returnval.=(<'.$returnval.'';
@@ -940,7 +927,7 @@ sub rawconfig {
$prt=~s/\$udom/$udom/g;
$prt=~s/\$crs/$crs/g;
$prt=~s/\$requested_domain/$requested_domain/g;
- my $type = $env{'course.'.$env{'request.course.id'}.'.type'};
+ my $type = &Apache::loncommon::course_type();
if ($type eq 'Group') {
$desc = &convert_menu_function($desc,$type);
}
@@ -1272,6 +1259,8 @@ sub get_nav_status {
return $navstatus;
}
+#FIXME this needs to move into mydesktab and the other locations
+# the text is generated
sub convert_menu_function {
my ($rolename,$type) = @_;
if ($type eq 'Group') {