version 1.123, 2004/05/06 17:55:03
|
version 1.126, 2004/05/11 06:12:45
|
Line 321 sub editor {
|
Line 321 sub editor {
|
&Apache::lonratedt::delparameter($idx,'parameter_encrypturl'); |
&Apache::lonratedt::delparameter($idx,'parameter_encrypturl'); |
} |
} |
|
|
($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.sequence'); |
|
if ($fatal) { |
|
$r->print('<p><font color="red">'.$errtext.'</font></p>'); |
|
return; |
|
} |
|
if ($ENV{'form.newpos'}) { |
if ($ENV{'form.newpos'}) { |
# change order |
# change order |
|
|
my $newpos=$ENV{'form.newpos'}-1; |
my $newpos=$ENV{'form.newpos'}-1; |
$r->print('Sorting '.$idx.' -> '.$newpos); |
my $currentpos=$ENV{'form.currentpos'}-1; |
($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.sequence'); |
my $i; |
if ($fatal) { |
my @neworder=(); |
$r->print('<p><font color="red">'.$errtext.'</font></p>'); |
if ($newpos>$currentpos) { |
return; |
# moving stuff up |
|
for ($i=0;$i<$currentpos;$i++) { |
|
$neworder[$i]=$Apache::lonratedt::order[$i]; |
|
} |
|
for ($i=$currentpos;$i<$newpos;$i++) { |
|
$neworder[$i]=$Apache::lonratedt::order[$i+1]; |
|
} |
|
$neworder[$newpos]=$Apache::lonratedt::order[$currentpos]; |
|
for ($i=$newpos+1;$i<=$#Apache::lonratedt::order;$i++) { |
|
$neworder[$i]=$Apache::lonratedt::order[$i]; |
|
} |
|
} else { |
|
# moving stuff down |
|
for ($i=0;$i<$newpos;$i++) { |
|
$neworder[$i]=$Apache::lonratedt::order[$i]; |
|
} |
|
$neworder[$newpos]=$Apache::lonratedt::order[$currentpos]; |
|
for ($i=$newpos+1;$i<$currentpos+1;$i++) { |
|
$neworder[$i]=$Apache::lonratedt::order[$i-1]; |
|
} |
|
for ($i=$currentpos+1;$i<=$#Apache::lonratedt::order;$i++) { |
|
$neworder[$i]=$Apache::lonratedt::order[$i]; |
|
} |
} |
} |
|
@Apache::lonratedt::order=@neworder; |
} |
} |
|
# store the changed version |
|
|
|
($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.sequence'); |
|
if ($fatal) { |
|
$r->print('<p><font color="red">'.$errtext.'</font></p>'); |
|
return; |
|
} |
|
|
} |
} |
|
|
# upload a file, if present |
# upload a file, if present |
if (($ENV{'form.uploaddoc.filename'}) && |
if (($ENV{'form.uploaddoc.filename'}) && |
($ENV{'form.cmd'}=~/^upload_(\w+)/)) { |
($ENV{'form.cmd'}=~/^upload_(\w+)/)) { |
if ( ($folder=~/^$1/) || ($1 eq 'default') ) { |
if ( ($folder=~/^$1/) || ($1 eq 'default') ) { |
# this is for a course, not a user, so set coursedoc flag |
# this is for a course, not a user, so set coursedoc flag |
# probably the only place in the system where this should be "1" |
# probably the only place in the system where this should be "1" |
my $url=&Apache::lonnet::userfileupload('uploaddoc',1); |
my $url=&Apache::lonnet::userfileupload('uploaddoc',1,'docs'); |
my $ext='false'; |
my $ext='false'; |
if ($url=~/^http\:\/\//) { $ext='true'; } |
if ($url=~/^http\:\/\//) { $ext='true'; } |
$url=~s/\:/\:/g; |
$url=~s/\:/\:/g; |
Line 499 sub entryline {
|
Line 523 sub entryline {
|
my $selectbox=''; |
my $selectbox=''; |
if ($folder!~/^supplemental/) { |
if ($folder!~/^supplemental/) { |
$selectbox= |
$selectbox= |
|
'<input type="hidden" name="currentpos" value="'.$incindex.'" />'. |
'<select name="newpos" onChange="this.form.submit()">'; |
'<select name="newpos" onChange="this.form.submit()">'; |
for (my $i=1;$i<=$#Apache::lonratedt::order+1;$i++) { |
for (my $i=1;$i<=$#Apache::lonratedt::order+1;$i++) { |
if ($i==$incindex) { |
if ($i==$incindex) { |