--- loncom/interface/loncommon.pm 2008/05/31 23:53:18 1.659 +++ loncom/interface/loncommon.pm 2008/06/09 22:34:55 1.660 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.659 2008/05/31 23:53:18 raeburn Exp $ +# $Id: loncommon.pm,v 1.660 2008/06/09 22:34:55 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -7035,6 +7035,54 @@ sub get_env_multiple { return(@values); } +sub ask_for_embedded_content { + my ($actionurl,$state,$allfiles,$codebase,$args)=@_; + my $upload_output = ' +
'; + $upload_output .= $state; + $upload_output .= 'Upload embedded files:
'.start_data_table(); + + my $num = 0; + foreach my $embed_file (sort {lc($a) cmp lc($b)} keys(%{$allfiles})) { + $upload_output .= &start_data_table_row(). + ''.$embed_file.''; + if ($args->{'ignore_remote_references'} + && $embed_file =~ m{^\w+://}) { + $upload_output.=''.&mt("URL points to other server.").''; + } elsif ($args->{'error_on_invalid_names'} + && $embed_file ne &Apache::lonnet::clean_filename($embed_file,{'keep_path' => 1,})) { + + $upload_output.=''.&mt("Invalid characters").''; + + } else { + + $upload_output .=' + + '; + my $attrib = join(':',@{$$allfiles{$embed_file}}); + $upload_output .= + "\n\t\t". + ''; + if (exists($$codebase{$embed_file})) { + $upload_output .= + "\n\t\t". + ''; + } + } + $upload_output .= ''.&Apache::loncommon::end_data_table_row(); + $num++; + } + $upload_output .= &Apache::loncommon::end_data_table().'
+ + + '.&mt('(only files for which a location has been provided will be uploaded)').' +
'; + return $upload_output; +} + =pod