--- loncom/interface/loncommon.pm 2008/04/04 16:48:42 1.636.2.6
+++ loncom/interface/loncommon.pm 2009/04/25 21:35:13 1.797
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.636.2.6 2008/04/04 16:48:42 raeburn Exp $
+# $Id: loncommon.pm,v 1.797 2009/04/25 21:35:13 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -61,12 +61,15 @@ use POSIX qw(strftime mktime);
use Apache::lonmenu();
use Apache::lonenc();
use Apache::lonlocal;
+use Apache::lonnet();
use HTML::Entities;
use Apache::lonhtmlcommon();
use Apache::loncoursedata();
use Apache::lontexconvert();
use Apache::lonclonecourse();
use LONCAPA qw(:DEFAULT :match);
+use DateTime::TimeZone;
+use DateTime::Locale::Catalog;
# ---------------------------------------------- Designs
use vars qw(%defaultdesign);
@@ -78,6 +81,7 @@ my $readit;
## Global Variables
##
+
# ----------------------------------------------- SSI with retries:
#
@@ -91,7 +95,7 @@ my $readit;
Performs an ssi with some number of retries. Retries continue either
until the result is ok or until the retry count supplied by the
-caller is exhausted.
+caller is exhausted.
Inputs:
@@ -123,23 +127,23 @@ sub ssi_with_retries {
my ($resource, $retries, %form) = @_;
- my $ok = 0; # True if we got a good response.
+ my $ok = 0; # True if we got a good response.
my $content;
my $response;
# Try to get the ssi done. within the retries count:
do {
- ($content, $response) = &Apache::lonnet::ssi($resource, %form);
- $ok = $response->is_success;
+ ($content, $response) = &Apache::lonnet::ssi($resource, %form);
+ $ok = $response->is_success;
if (!$ok) {
&Apache::lonnet::logthis("Failed ssi_with_retries on $resource: ".$response->is_success.', '.$response->code.', '.$response->message);
}
- $retries--;
+ $retries--;
} while (!$ok && ($retries > 0));
if (!$ok) {
- $content = ''; # On error return an empty content.
+ $content = ''; # On error return an empty content.
}
return ($content, $response);
@@ -267,7 +271,7 @@ BEGIN {
}
}
&Apache::lonnet::logthis(
- "INFO: Read file types");
+ "INFO: Read file types");
$readit=1;
} # end of unless($readit)
@@ -283,14 +287,14 @@ BEGIN {
=over 4
-=item * browser_and_searcher_javascript ()
+=item * &browser_and_searcher_javascript()
XXReturns a string
containing javascript with two functions, C and
C. Returned string does not contain EscriptE
tags.
-=item * openbrowser(formname,elementname,only,omit) [javascript]
+=item * &openbrowser(formname,elementname,only,omit) [javascript]
inputs: formname, elementname, only, omit
@@ -303,7 +307,7 @@ with the given extension. Can be a comm
Specifying 'omit' will restrict the browser to NOT displaying files
with the given extension. Can be a comma separated list.
-=item * opensearcher(formname, elementname) [javascript]
+=item * &opensearcher(formname,elementname) [javascript]
Inputs: formname, elementname
@@ -388,7 +392,7 @@ sub storeresurl {
unless ($resurl=~/^\/res/) { return 0; }
$resurl=~s/\/$//;
&Apache::lonnet::put('environment',{'lastresurl' => $resurl});
- &Apache::lonnet::appenv('environment.lastresurl' => $resurl);
+ &Apache::lonnet::appenv({'environment.lastresurl' => $resurl});
return 1;
}
@@ -402,9 +406,9 @@ sub studentbrowser_javascript {
|| ($env{'request.role'}=~/^(au|dc|su)/)
) { return ''; }
return (<<'ENDSTDBRW');
-
+ENDAUTHORBRW
+}
+
sub coursebrowser_javascript {
my ($domainfilter,$sec_element,$formname)=@_;
my $crs_or_grp_alert = &mt('Please select the type of LON-CAPA entity - Course or Group - for which you wish to add/modify a user role');
my $output = '
- block
and html for two