--- loncom/interface/londocs.pm 2005/04/07 06:56:23 1.174
+++ loncom/interface/londocs.pm 2005/06/08 17:42:01 1.178
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.174 2005/04/07 06:56:23 albertel Exp $
+# $Id: londocs.pm,v 1.178 2005/06/08 17:42:01 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -272,22 +272,8 @@ sub exportcourse {
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
['archive','discussion']);
- my @exportitems = ();
- if (defined($env{'form.archive'})) {
- if (ref($env{'form.archive'}) eq 'ARRAY') {
- @exportitems = @{$env{'form.archive'}};
- } else {
- $exportitems[0] = $env{'form.archive'};
- }
- }
- my @discussions = ();
- if (defined($env{'form.discussion'})) {
- if (ref($env{'form.discussion'}) eq 'ARRAY') {
- @discussions = $env{'form.discussion'};
- } else {
- $discussions[0] = $env{'form.discussion'};
- }
- }
+ my @exportitems = &Apache::loncommon::get_env_multiple('form.archive');
+ my @discussions = &Apache::loncommon::get_env_multiple('form.discussion');
if (@exportitems == 0 && @discussions == 0) {
$outcome = '
As you did not select any content items or discussions for export, an IMS package has not been created. Please go back to select either content items or discussions for export';
} else {
@@ -866,7 +852,7 @@ sub group_import {
}
}
if ($url) {
- my $idx = $#Apache::lonratedt::resources + 1;
+ my $idx = &Apache::lonratedt::getresidx($url);
$Apache::lonratedt::order[$#Apache::lonratedt::order+1]=$idx;
my $ext = 'false';
if ($url=~/^http:\/\//) { $ext = 'true'; }
@@ -928,8 +914,10 @@ sub editor {
($errtext,$fatal)=
&mapread($coursenum,$coursedom,$folder.'.'.$container);
if ($#Apache::lonratedt::order<1) {
- $Apache::lonratedt::order[0]=1;
- $Apache::lonratedt::resources[1]='';
+ my $idx=&Apache::lonratedt::getresidx();
+ if ($idx<=0) { $idx=1; }
+ $Apache::lonratedt::order[0]=$idx;
+ $Apache::lonratedt::resources[$idx]='';
}
if (defined($env{'form.markcopy'})) {
# Mark for copying
@@ -1851,25 +1839,29 @@ sub is_hash_old {
}
sub changewarning {
- my ($r,$postexec)=@_;
+ my ($r,$postexec,$message,$url)=@_;
if (!&is_hash_old()) { return; }
my $pathvar='folderpath';
my $path=&Apache::lonnet::escape($env{'form.folderpath'});
- if (defined($env{'form.pagepath'})) {
- $pathvar='pagepath';
- $path=&Apache::lonnet::escape($env{'form.pagepath'});
- $path.='&symb='.&Apache::lonnet::escape($env{'form.pagesymb'});
+ if (!defined($url)) {
+ if (defined($env{'form.pagepath'})) {
+ $pathvar='pagepath';
+ $path=&Apache::lonnet::escape($env{'form.pagepath'});
+ $path.='&symb='.&Apache::lonnet::escape($env{'form.pagesymb'});
+ }
+ $url='/adm/coursedocs?'.$pathvar.'='.$path;
+ }
+ if (!defined($message)) {
+ $message='Changes will become active for your current session after [_1], or the next time you log in.';
}
$r->print(
''.
'