--- loncom/interface/loncommon.pm 2005/03/18 00:18:40 1.256
+++ loncom/interface/loncommon.pm 2005/06/06 20:31:24 1.267
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.256 2005/03/18 00:18:40 matthew Exp $
+# $Id: loncommon.pm,v 1.267 2005/06/06 20:31:24 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -55,7 +55,7 @@ redundancy from other modules and increa
package Apache::loncommon;
use strict;
-use Apache::lonnet();
+use Apache::lonnet;
use GDBM_File;
use POSIX qw(strftime mktime);
use Apache::Constants qw(:common :http :methods);
@@ -311,8 +311,8 @@ END
}
sub lastresurl {
- if ($ENV{'environment.lastresurl'}) {
- return $ENV{'environment.lastresurl'}
+ if ($env{'environment.lastresurl'}) {
+ return $env{'environment.lastresurl'}
} else {
return '/res';
}
@@ -329,9 +329,9 @@ sub storeresurl {
sub studentbrowser_javascript {
unless (
- (($ENV{'request.course.id'}) &&
- (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})))
- || ($ENV{'request.role'}=~/^(au|dc|su)/)
+ (($env{'request.course.id'}) &&
+ (&Apache::lonnet::allowed('srm',$env{'request.course.id'})))
+ || ($env{'request.role'}=~/^(au|dc|su)/)
) { return ''; }
return (<<'ENDSTDBRW');
'."\n".
@@ -2740,21 +2738,21 @@ END
$lonhttpdPort.$img.'" alt="'.$function.'" />';
if ($bodyonly) {
return $bodytag;
- } elsif ($ENV{'browser.interface'} eq 'textual') {
+ } elsif ($env{'browser.interface'} eq 'textual') {
# Accessibility
return $bodytag.&Apache::lonmenu::menubuttons($forcereg,'web',
$forcereg).
'
LON-CAPA: '.$title.'
';
- } elsif ($ENV{'environment.remote'} eq 'off') {
+ } elsif ($env{'environment.remote'} eq 'off') {
# No Remote
my $roleinfo=(<
- $ENV{'environment.firstname'}
- $ENV{'environment.middlename'}
- $ENV{'environment.lastname'}
- $ENV{'environment.generation'}
+ $env{'environment.firstname'}
+ $env{'environment.middlename'}
+ $env{'environment.lastname'}
+ $env{'environment.generation'}
$role
@@ -2768,9 +2766,9 @@ ENDROLE
$titleinfo = $customtitle;
}
- if ($ENV{'request.state'} eq 'construct') {
+ if ($env{'request.state'} eq 'construct') {
my ($uname,$thisdisfn)=
- ($ENV{'request.filename'} =~ m|^/home/([^/]+)/public_html/(.*)|);
+ ($env{'request.filename'} =~ m|^/home/([^/]+)/public_html/(.*)|);
my $formaction='/priv/'.$uname.'/'.$thisdisfn;
$formaction=~s/\/+/\//g;
unless ($customtitle) { #this is for resources; directories have customtitle, and crumbs and select recent are created in lonpubdir.pm
@@ -2798,7 +2796,7 @@ ENDROLE
'cellspacing="3" cellpadding="3">'.
''.
$titleinfo.' | '.$roleinfo.'
';
- if ($ENV{'request.state'} eq 'construct') {
+ if ($env{'request.state'} eq 'construct') {
$bodytag .= &Apache::lonmenu::menubuttons($forcereg,'web',$forcereg,$titletable);
} else {
$bodytag .= &Apache::lonmenu::menubuttons($forcereg,'web',$forcereg).
@@ -2817,11 +2815,11 @@ ENDROLE
#
# Extra info if you are the DC
my $dc_info = '';
- if ($ENV{'user.adv'} && exists($ENV{'user.role.dc./'.
- $ENV{'course.'.$ENV{'request.course.id'}.
+ if ($env{'user.adv'} && exists($env{'user.role.dc./'.
+ $env{'course.'.$env{'request.course.id'}.
'.domain'}.'/'})) {
- my $cid = $ENV{'request.course.id'};
- $dc_info.= $cid.' '.$ENV{'course.'.$cid.'.internal.coursecode'};
+ my $cid = $env{'request.course.id'};
+ $dc_info.= $cid.' '.$env{'course.'.$cid.'.internal.coursecode'};
$dc_info = '('.$dc_info.')';
}
#
@@ -2835,12 +2833,12 @@ $upperleft
$titleinfo $dc_info
- |
+ |
- $ENV{'environment.firstname'}
- $ENV{'environment.middlename'}
- $ENV{'environment.lastname'}
- $ENV{'environment.generation'}
+ $env{'environment.firstname'}
+ $env{'environment.middlename'}
+ $env{'environment.lastname'}
+ $env{'environment.generation'}
|
@@ -2880,7 +2878,7 @@ Returns: A uniform footer for LON-CAPA w
sub endbodytag {
my $endbodytag='