version 1.191, 2008/04/16 23:11:06
|
version 1.193, 2008/05/28 20:46:46
|
Line 93 sub display_common {
|
Line 93 sub display_common {
|
'Upload file to current directory:', |
'Upload file to current directory:', |
'createdir' => 'Create Subdirectory', |
'createdir' => 'Create Subdirectory', |
'createdir_label' => |
'createdir_label' => |
'Create subdirectory in current directory:'); |
'Create subdirectory in current directory:', |
|
'parse' => 'If HTML file, upload embedded images/multimedia/css/linked files' |
|
); |
my $escuri = &HTML::Entities::encode($r->uri,'&<>"'); |
my $escuri = &HTML::Entities::encode($r->uri,'&<>"'); |
my $help_fileupload = &Apache::loncommon::help_open_topic('Portfolio AddFiles'); |
my $help_fileupload = &Apache::loncommon::help_open_topic('Portfolio AddFiles'); |
my $help_createdir = &Apache::loncommon::help_open_topic('Portfolio CreateDirectory'); |
my $help_createdir = &Apache::loncommon::help_open_topic('Portfolio CreateDirectory'); |
Line 116 sub display_common {
|
Line 118 sub display_common {
|
<input type="hidden" name="fieldname" value="$env{"form.fieldname"}" /> |
<input type="hidden" name="fieldname" value="$env{"form.fieldname"}" /> |
<input type="hidden" name="mode" value="$env{"form.mode"}" /> |
<input type="hidden" name="mode" value="$env{"form.mode"}" /> |
<input type="submit" name="storeupl" value="$text{'upload'}" />$help_fileupload |
<input type="submit" name="storeupl" value="$text{'upload'}" />$help_fileupload |
|
<br /> |
|
<span class="LC_nobreak"> |
|
<label>$text{'parse'} |
|
<input type="checkbox" name="parserflag" checked="checked" /> |
|
</label> |
|
</span> |
</form> |
</form> |
</td> |
</td> |
</tr> |
</tr> |
Line 1815 sub upload {
|
Line 1823 sub upload {
|
my $port_path = &get_port_path(); |
my $port_path = &get_port_path(); |
my (%allfiles,%codebase,$mode); |
my (%allfiles,%codebase,$mode); |
if ($env{'form.uploaddoc.filename'} =~ m/(\.htm|\.html|\.shtml)$/i) { |
if ($env{'form.uploaddoc.filename'} =~ m/(\.htm|\.html|\.shtml)$/i) { |
$mode = 'parse'; |
if ($env{'form.parserflag'}) { |
|
$mode = 'parse'; |
|
} |
} |
} |
my $result= |
my $result= |
&Apache::lonnet::userfileupload('uploaddoc','', |
&Apache::lonnet::userfileupload('uploaddoc','', |
Line 2336 sub handler {
|
Line 2345 sub handler {
|
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
$r->print(&coursegrp_portfolio_header($udom,$uname,$grp_desc)); |
$r->print(&coursegrp_portfolio_header($udom,$uname,$grp_desc)); |
} |
} |
my @dir_list=&get_dir_list($portfolio_root,undef,$group); |
my @dir_list=&get_dir_list($portfolio_root,$current_path,$group); |
if ($dir_list[0] eq 'no_such_dir'){ |
if ($dir_list[0] eq 'no_such_dir'){ |
# two main reasons for this: |
# two main reasons for this: |
# 1) never been here, so directory structure not created |
# 1) never been here, so directory structure not created |
Line 2352 sub handler {
|
Line 2361 sub handler {
|
$current_path = '/'; # force it back to the root |
$current_path = '/'; # force it back to the root |
} |
} |
# now grab the directory list again, for the first time |
# now grab the directory list again, for the first time |
@dir_list= |
@dir_list=&get_dir_list($portfolio_root,$current_path,$group); |
&Apache::lonnet::dirlist($portfolio_root.$current_path, |
|
$udom,$uname,$getpropath); |
|
} |
} |
# need to know if directory is empty so it can be removed if desired |
# need to know if directory is empty so it can be removed if desired |
my $is_empty=(@dir_list == 2); |
my $is_empty=(@dir_list == 2); |