--- loncom/interface/lonmenu.pm 2006/07/14 16:46:36 1.195
+++ loncom/interface/lonmenu.pm 2007/04/13 13:39:32 1.213
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.195 2006/07/14 16:46:36 www Exp $
+# $Id: lonmenu.pm,v 1.213 2007/04/13 13:39:32 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -44,14 +44,15 @@ use Apache::lonhtmlcommon();
use Apache::loncommon();
use Apache::lonenc();
use Apache::lonlocal;
-use lib '/home/httpd/lib/perl/';
-use LONCAPA;
+use LONCAPA qw(:DEFAULT :match);
-use vars qw(@desklines $readdesk);
+use vars qw(@desklines %category_names %category_members %category_positions $readdesk);
my @inlineremote;
+
+
# ================================================================ Little texts
sub initlittle {
@@ -62,10 +63,10 @@ sub initlittle {
'Roles':'Courses'),
'docs' => 'Course Documents',
'exit' => 'Exit',
+ 'login' => 'Log In',
'launch' => 'Launch Remote Control',
'groups' => 'Groups',
'gdoc' => 'Group Documents',
- 'teams' => 'Teams',
);
}
@@ -91,6 +92,10 @@ sub menubuttons {
my $escurl=&escape(&Apache::lonenc::check_encrypt($env{'request.noversionuri'}));
my $escsymb=&escape(&Apache::lonenc::check_encrypt($env{'request.symb'}));
+ my $logo=&Apache::loncommon::lonhttpdurl("/adm/lonIcons/minilogo.gif");
+ $logo = '
| ';
+
if ($env{'request.state'} eq 'construct') {
if (($env{'request.noversionuri'} eq '') || (!defined($env{'request.noversionuri'}))) {
my $returnurl = $env{'request.filename'};
@@ -101,7 +106,7 @@ sub menubuttons {
if ($env{'request.course.id'}) {
my %coursegroups;
my $viewgrps_permission =
- &Apache::lonnet::allowed('vcg',$env{'request.course.id'});
+ &Apache::lonnet::allowed('vcg',$env{'request.course.id'}.($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''));
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'});
}
@@ -129,11 +134,11 @@ ENDRELOAD
$lt{'docs'}
ENDDOCS
}
-# if ($showgroups) {
-# $groups =(<$lt{'groups'}
-#ENDGROUPS
-# }
+ if ($showgroups) {
+ $groups =(<$lt{'groups'}
+ENDGROUPS
+ }
}
my $form=&serverform();
my $utility=&utilityfunctions();
@@ -168,14 +173,14 @@ ENDMAINMENU
my $vlink=&Apache::loncommon::designparm($function.'.vlink',$domain);
my $sidebg=&Apache::loncommon::designparm($function.'.sidebg',$domain);
if ($env{'user.name'} eq 'public' && $env{'user.domain'} eq 'public') {
- my $logo=&Apache::loncommon::lonhttpdurl("/adm/lonIcons/minilogo.gif");
return (<
-
- $lt{'exit'}
+ $logo
+ | |
+
+ $lt{'login'}
|
- LON-CAPA |
@@ -198,12 +203,11 @@ my $is_group = (&Apache::loncommon::cour
$text |
ENDDOCS
}
-# if ($showgroups) {
-# my $text = ($is_group) ? $lt{'teams'} : $lt{'groups'};
-# $groups =(<$text
-#ENDGROUPS
-# }
+ if ($showgroups) {
+ $groups =(<$lt{'groups'}
+ENDGROUPS
+ }
if (
($env{'request.noversionuri'}=~m[^/(res|public)/] &&
$env{'request.symb'} eq '')
@@ -232,18 +236,12 @@ ENDCRELOAD
}
my $form=&serverform();
my $utility=&utilityfunctions();
- my $logo=&Apache::loncommon::lonhttpdurl("/adm/lonIcons/minilogo.gif");
my $remote;
if ($env{'user.adv'}) {
$remote = ''.$lt{'launch'}.' | '
}
- my $helptopic='Student_Intro';
- if ($env{'request.role'}=~/^(ca|au)/) {
- $helptopic='Authoring_Intro';
- } elsif ($env{'request.role'}=~/^cc/) {
- $helptopic='Course_Coordination_Intro';
- }
- my $helplink=&Apache::loncommon::help_open_topic($helptopic,'Help');
+
+ my $helplink=&Apache::loncommon::top_nav_help('Help');
return (<
// BEGIN LON-CAPA Internal
@@ -253,8 +251,7 @@ $utility
$form
@@ -392,7 +389,7 @@ sub innerregister {
&Apache::lonnet::allowed('opa',$crs)) {
$hwkadd.=&switch('','',7,3,'pparm.gif','problem[_2]','parms[_2]',
"gocmd('/adm/parmset','set')",
- 'Modify deadlines, etc, for this resource');
+ 'Modify parameter settings for this resource');
}
# -- End Homework
###
@@ -410,7 +407,7 @@ sub innerregister {
my $desc = "Enter my resource construction space";
# Set defaults for co-authors
if ($env{'request.role'} =~ /^ca/) {
- ($cadom,$caname)=($env{'request.role'}=~/(\w+)\/(\w+)$/);
+ ($cadom,$caname)=($env{'request.role'}=~/($match_domain)\/($match_username)$/);
($top,$bottom) = ('co con-','struct');
$action = "go('/priv/".$caname."');";
$desc = "Enter construction space as co-author";
@@ -432,7 +429,7 @@ sub innerregister {
my $cfudom='';
if ($env{'request.filename'}) {
my $file=&Apache::lonnet::declutter($env{'request.filename'});
- $file=~s/^(\w+)\/(\w+)/\/priv\/$2/;
+ $file=~s/^($match_domain)\/($match_username)/\/priv\/$2/;
# Check that the user has permission to edit this resource
($cfuname,$cfudom)=&Apache::loncacc::constructaccess($file,$1);
if (defined($cfudom)) {
@@ -448,7 +445,7 @@ sub innerregister {
# Finally, turn the button on or off
if ($cfile && !$const_space) {
$editbutton=&switch
- ('','',6,1,'cstr.gif','edit[_1]','resource[_2]',
+ ('','',6,1,'pcstr.gif','edit[_1]','resource[_2]',
"go('".$cfile."');","Edit this resource");
} elsif ($editbutton eq '') {
$editbutton=&clear(6,1);
@@ -466,26 +463,28 @@ sub innerregister {
$is_const_dir = 1;
} else {
$currdir =~ s#[^/]+$##;
+ my $cleandisfn = &Apache::loncommon::escape_single($thisdisfn);
+ my $esc_currdir = &Apache::loncommon::escape_single($currdir);
$menuitems=(<'.$text.'';
} else {
- $inlineremote[10*$row+$col]="\n
".
+ $inlineremote[$idx]="\n
".
$desc.' '.$text.'';
}
} else {
# Inline Remote
+ if ($env{'environment.icons'} ne 'classic') {
+ $img=~s/\.gif$/\.png/;
+ }
if ($nobreak==2) { return ''; }
my $text=$top.' '.$bot;
$text=~s/\s*\-\s*//gs;
@@ -848,17 +858,17 @@ sub switch {
if ($env{'browser.interface'} eq 'faketextual') {
# Accessibility
if ($nobreak==3) {
- $inlineremote[10*$row+$col]="\n".
+ $inlineremote[$idx]="\n".
'';
} elsif ($nobreak) {
- $inlineremote[10*$row+$col]="\n".
+ $inlineremote[$idx]="\n
".
'
';
} else {
- $inlineremote[10*$row+$col]="\n
".
+ $inlineremote[$idx]="\n
".
'