');
+
+ $r->print(&Apache::loncommon::end_data_table_row());
+ $shown++;
+ if (!($env{'form.show'} eq &mt('all')
+ || $shown<=$env{'form.show'})) { last; }
+ }
+ $r->print(&Apache::loncommon::end_data_table());
+ $r->print(&Apache::loncommon::end_page());
+}
+
sub editor {
my ($r,$coursenum,$coursedom,$folder,$allowed,$upload_output)=@_;
my $errtext='';
@@ -1023,68 +1152,73 @@ sub editor {
# ---------------- if they are for this folder and user allowed to make changes
if (($allowed) && ($env{'form.folder'} eq $folder)) {
# set parameters and change order
- if (defined($env{'form.setparms'})) {
+ &snapshotbefore();
+ if ($env{'form.changeparms'}) {
my $idx=$env{'form.setparms'};
# set parameters
if ($env{'form.randpick_'.$idx}) {
&LONCAPA::map::storeparameter($idx,'parameter_randompick',$env{'form.randpick_'.$idx},'int_pos');
+ &remember_parms($idx,'randompick','set',$env{'form.randpick_'.$idx});
} else {
&LONCAPA::map::delparameter($idx,'parameter_randompick');
+ &remember_parms($idx,'randompick','del');
}
if ($env{'form.hidprs_'.$idx}) {
&LONCAPA::map::storeparameter($idx,'parameter_hiddenresource','yes','string_yesno');
- } else {
+ &remember_parms($idx,'hiddenresource','set',$env{'form.hidprs_'.$idx});
+ } else {
&LONCAPA::map::delparameter($idx,'parameter_hiddenresource');
- }
+ &remember_parms($idx,'hiddenresource','del');
+ }
if ($env{'form.encprs_'.$idx}) {
&LONCAPA::map::storeparameter($idx,'parameter_encrypturl','yes','string_yesno');
- } else {
+ &remember_parms($idx,'encrypturl','set',$env{'form.encprs_'.$idx});
+ } else {
&LONCAPA::map::delparameter($idx,'parameter_encrypturl');
- }
+ &remember_parms($idx,'encrypturl','del');
+ }
+ }
- if ($env{'form.newpos'}) {
+ if ($env{'form.newpos'}) {
# change order
-
- my $newpos=$env{'form.newpos'}-1;
- my $currentpos=$env{'form.currentpos'}-1;
- my $i;
- my @neworder=();
- if ($newpos>$currentpos) {
+ my $newpos=$env{'form.newpos'}-1;
+ my $currentpos=$env{'form.currentpos'}-1;
+ my $i;
+ my @neworder=();
+ if ($newpos>$currentpos) {
# moving stuff up
- for ($i=0;$i<$currentpos;$i++) {
- $neworder[$i]=$LONCAPA::map::order[$i];
- }
- for ($i=$currentpos;$i<$newpos;$i++) {
- $neworder[$i]=$LONCAPA::map::order[$i+1];
- }
- $neworder[$newpos]=$LONCAPA::map::order[$currentpos];
- for ($i=$newpos+1;$i<=$#LONCAPA::map::order;$i++) {
- $neworder[$i]=$LONCAPA::map::order[$i];
- }
- } else {
+ for ($i=0;$i<$currentpos;$i++) {
+ $neworder[$i]=$LONCAPA::map::order[$i];
+ }
+ for ($i=$currentpos;$i<$newpos;$i++) {
+ $neworder[$i]=$LONCAPA::map::order[$i+1];
+ }
+ $neworder[$newpos]=$LONCAPA::map::order[$currentpos];
+ for ($i=$newpos+1;$i<=$#LONCAPA::map::order;$i++) {
+ $neworder[$i]=$LONCAPA::map::order[$i];
+ }
+ } else {
# moving stuff down
- for ($i=0;$i<$newpos;$i++) {
- $neworder[$i]=$LONCAPA::map::order[$i];
- }
- $neworder[$newpos]=$LONCAPA::map::order[$currentpos];
- for ($i=$newpos+1;$i<$currentpos+1;$i++) {
- $neworder[$i]=$LONCAPA::map::order[$i-1];
- }
- for ($i=$currentpos+1;$i<=$#LONCAPA::map::order;$i++) {
- $neworder[$i]=$LONCAPA::map::order[$i];
- }
+ for ($i=0;$i<$newpos;$i++) {
+ $neworder[$i]=$LONCAPA::map::order[$i];
+ }
+ $neworder[$newpos]=$LONCAPA::map::order[$currentpos];
+ for ($i=$newpos+1;$i<$currentpos+1;$i++) {
+ $neworder[$i]=$LONCAPA::map::order[$i-1];
+ }
+ for ($i=$currentpos+1;$i<=$#LONCAPA::map::order;$i++) {
+ $neworder[$i]=$LONCAPA::map::order[$i];
}
- @LONCAPA::map::order=@neworder;
}
+ @LONCAPA::map::order=@neworder;
# store the changed version
-
($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.'.$container);
if ($fatal) {
$r->print('
'.$errtext.'
');
return;
}
-
}
+
if ($env{'form.pastemarked'}) {
# paste resource to end of list
my $url=$env{'form.markedcopy_url'};
@@ -1222,6 +1356,7 @@ sub editor {
$r->print('