version 1.270, 2007/01/26 23:37:53
|
version 1.271, 2007/01/29 21:18:53
|
Line 1448 sub editor {
|
Line 1448 sub editor {
|
foreach (@LONCAPA::map::order) { |
foreach (@LONCAPA::map::order) { |
my ($name,$url)=split(/\:/,$LONCAPA::map::resources[$_]); |
my ($name,$url)=split(/\:/,$LONCAPA::map::resources[$_]); |
$name=&LONCAPA::map::qtescape($name); |
$name=&LONCAPA::map::qtescape($name); |
$url =&LONCAPA::map::qtescape($url); |
$url=&LONCAPA::map::qtescape($url); |
unless ($name) { $name=(split(/\//,$url))[-1]; } |
unless ($name) { $name=(split(/\//,$url))[-1]; } |
unless ($name) { $idx++; next; } |
unless ($name) { $idx++; next; } |
$r->print(&entryline($idx,$name,$url,$folder,$allowed,$_,$coursenum)); |
$r->print(&entryline($idx,$name,$url,$folder,$allowed,$_,$coursenum)); |
Line 1574 sub process_file_upload {
|
Line 1574 sub process_file_upload {
|
} |
} |
|
|
sub ask_for_embedded_content { |
sub ask_for_embedded_content { |
my ($actionurl,$state,$allfiles,$codebase)=@_; |
my ($actionurl,$state,$allfiles,$codebase,$args)=@_; |
my $upload_output = ' |
my $upload_output = ' |
<form name="upload_embedded" action="'.$actionurl.'" |
<form name="upload_embedded" action="'.$actionurl.'" |
method="post" enctype="multipart/form-data">'; |
method="post" enctype="multipart/form-data">'; |
$upload_output .= $state; |
$upload_output .= $state; |
$upload_output .= '<b>Upload embedded files</b>:<br /> |
$upload_output .= '<b>Upload embedded files</b>:<br />'. |
<table>'; |
&Apache::loncommon::start_data_table(); |
|
|
my $num = 0; |
my $num = 0; |
foreach my $embed_file (keys(%{$allfiles})) { |
foreach my $embed_file (keys(%{$allfiles})) { |
$upload_output .= '<tr><td>'.$embed_file.'</td><td> |
$upload_output .= &Apache::loncommon::start_data_table_row(). |
|
'<td>'.$embed_file.'</td><td>'; |
|
if ($args->{'error_on_invalid_names'} |
|
&& $embed_file ne &Apache::lonnet::clean_filename($embed_file,{'keep_path' => 1,})) { |
|
|
|
$upload_output.='<span class="LC_warning">'.&mt("Invalid characters").'</span>'; |
|
} else { |
|
$upload_output .=' |
<input name="embedded_item_'.$num.'" type="file" value="bob" /> |
<input name="embedded_item_'.$num.'" type="file" value="bob" /> |
<input name="embedded_orig_'.$num.'" type="hidden" value="'.&escape($embed_file).'" />'; |
<input name="embedded_orig_'.$num.'" type="hidden" value="'.&escape($embed_file).'" />'; |
my $attrib = join(':',@{$$allfiles{$embed_file}}); |
my $attrib = join(':',@{$$allfiles{$embed_file}}); |
$upload_output .= |
$upload_output .= |
"\n\t\t". |
|
'<input name="embedded_attrib_'.$num.'" type="hidden" value="'. |
|
$attrib.'" />'; |
|
if (exists($$codebase{$embed_file})) { |
|
$upload_output .= |
|
"\n\t\t". |
"\n\t\t". |
'<input name="codebase_'.$num.'" type="hidden" value="'. |
'<input name="embedded_attrib_'.$num.'" type="hidden" value="'. |
&escape($$codebase{$embed_file}).'" />'; |
$attrib.'" />'; |
|
if (exists($$codebase{$embed_file})) { |
|
$upload_output .= |
|
"\n\t\t". |
|
'<input name="codebase_'.$num.'" type="hidden" value="'. |
|
&escape($$codebase{$embed_file}).'" />'; |
|
} |
} |
} |
$upload_output .= '</td></tr>'; |
$upload_output .= '</td>'.&Apache::loncommon::end_data_table_row(); |
$num++; |
$num++; |
} |
} |
$upload_output .= '</table><br /> |
$upload_output .= &Apache::loncommon::end_data_table().'<br /> |
<input type ="hidden" name="number_embedded_items" value="'.$num.'" /> |
<input type ="hidden" name="number_embedded_items" value="'.$num.'" /> |
<input type ="submit" value="Complete upload" /> |
<input type ="submit" value="Complete upload" /> |
</form>'; |
</form>'; |