version 1.122, 2004/04/26 17:50:37
|
version 1.123, 2004/05/06 17:55:03
|
Line 301 sub editor {
|
Line 301 sub editor {
|
|
|
# ---------------- if they are for this folder and user allowed to make changes |
# ---------------- if they are for this folder and user allowed to make changes |
if (($allowed) && ($ENV{'form.folder'} eq $folder)) { |
if (($allowed) && ($ENV{'form.folder'} eq $folder)) { |
# set parameters |
# set parameters and change order |
if (defined($ENV{'form.setparms'})) { |
if (defined($ENV{'form.setparms'})) { |
my $idx=$ENV{'form.setparms'}; |
my $idx=$ENV{'form.setparms'}; |
|
# set parameters |
if ($ENV{'form.randpick_'.$idx}) { |
if ($ENV{'form.randpick_'.$idx}) { |
&Apache::lonratedt::storeparameter($idx,'parameter_randompick',$ENV{'form.randpick_'.$idx},'int_pos'); |
&Apache::lonratedt::storeparameter($idx,'parameter_randompick',$ENV{'form.randpick_'.$idx},'int_pos'); |
} else { |
} else { |
Line 325 sub editor {
|
Line 326 sub editor {
|
$r->print('<p><font color="red">'.$errtext.'</font></p>'); |
$r->print('<p><font color="red">'.$errtext.'</font></p>'); |
return; |
return; |
} |
} |
|
if ($ENV{'form.newpos'}) { |
|
# change order |
|
|
|
my $newpos=$ENV{'form.newpos'}-1; |
|
$r->print('Sorting '.$idx.' -> '.$newpos); |
|
($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'}) && |
Line 480 sub entryline {
|
Line 495 sub entryline {
|
# $htmlfoldername=&HTML::Entities::encode($ENV{'form.foldername'},'<>&"'); |
# $htmlfoldername=&HTML::Entities::encode($ENV{'form.foldername'},'<>&"'); |
} |
} |
if ($allowed) { |
if ($allowed) { |
|
my $incindex=$index+1; |
|
my $selectbox=''; |
|
if ($folder!~/^supplemental/) { |
|
$selectbox= |
|
'<select name="newpos" onChange="this.form.submit()">'; |
|
for (my $i=1;$i<=$#Apache::lonratedt::order+1;$i++) { |
|
if ($i==$incindex) { |
|
$selectbox.='<option value="" selected="1">('.$i.')</option>'; |
|
} else { |
|
$selectbox.='<option value="'.$i.'">'.$i.'</option>'; |
|
} |
|
} |
|
$selectbox.='</select>'; |
|
} |
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'up' => 'Move Up', |
'up' => 'Move Up', |
'dw' => 'Move Down', |
'dw' => 'Move Down', |
Line 496 sub entryline {
|
Line 525 sub entryline {
|
<tr><td bgcolor="#DDDDDD"> |
<tr><td bgcolor="#DDDDDD"> |
<a href='/adm/coursedocs?cmd=down_$index&folderpath=$folderpath'> |
<a href='/adm/coursedocs?cmd=down_$index&folderpath=$folderpath'> |
<img src="${iconpath}move_down.gif" alt='$lt{'dw'}' border='0' /></a></td></tr> |
<img src="${iconpath}move_down.gif" alt='$lt{'dw'}' border='0' /></a></td></tr> |
</table></td><td bgcolor="#DDDDDD"> |
</table></td> |
|
<td>$selectbox |
|
</td><td bgcolor="#DDDDDD"> |
<a href='javascript:removeres("$folderpath","$index","$renametitle");'> |
<a href='javascript:removeres("$folderpath","$index","$renametitle");'> |
<font size="-2" color="#990000">$lt{'rm'}</font></a> |
<font size="-2" color="#990000">$lt{'rm'}</font></a> |
<a href='javascript:changename("$folderpath","$index","$renametitle");'> |
<a href='javascript:changename("$folderpath","$index","$renametitle");'> |