--- loncom/interface/portfolio.pm 2010/03/26 23:08:41 1.222 +++ loncom/interface/portfolio.pm 2010/04/12 17:27:24 1.223 @@ -1,7 +1,7 @@ # The LearningOnline Network # portfolio browser # -# $Id: portfolio.pm,v 1.222 2010/03/26 23:08:41 raeburn Exp $ +# $Id: portfolio.pm,v 1.223 2010/04/12 17:27:24 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -287,7 +287,6 @@ sub display_directory { my ($r,$url,$current_path,$is_empty,$dir_list,$group,$can_upload, $can_modify,$can_delete,$can_setacl)=@_; my $iconpath= $r->dir_config('lonIconsURL') . "/"; - my $display_out; my $select_mode; my $checked_files; my $port_path = &get_port_path(); @@ -304,30 +303,17 @@ sub display_directory { my %access_controls = &Apache::lonnet::get_access_controls($current_permissions,$group); my $now = time; if ($env{"form.mode"} eq 'selectfile') { - &select_files($r); - $checked_files =&Apache::lonnet::files_in_path($uname,$env{'form.currentpath'}); - $select_mode = 'true'; - } - if ($is_empty && ($current_path ne '/') && $can_delete) { - $display_out = '
'. - &group_form_data(). - ''. - '

'. - ''. - '

'. - ''. - ''. - '
'; - - $r->print($display_out); - return; + &select_files($r); + $checked_files =&Apache::lonnet::files_in_path($uname,$env{'form.currentpath'}); + $select_mode = 'true'; } if ($select_mode eq 'true') { $r->print('
'); $r->print(&Apache::loncommon::start_data_table() .&Apache::loncommon::start_data_table_header_row() .''.&mt('Select').'' - .'  ' + .' ' + .' ' .''.&mt('Name').'' .''.&mt('Size').'' .''.&mt('Last Modified').'' @@ -336,12 +322,18 @@ sub display_directory { ); } else { $r->print(''); - $r->print(&Apache::loncommon::help_open_topic('Portfolio FileList', - &mt('Using the portfolio file list'))); + $r->print( + '

' + .&Apache::loncommon::help_open_topic( + 'Portfolio FileList', + &mt('Using the portfolio file list')) + .'

' + ); $r->print(&Apache::loncommon::start_data_table() .&Apache::loncommon::start_data_table_header_row() .''.&mt('Actions'). &Apache::loncommon::help_open_topic('Portfolio FileAction').'' - .'  ' + .' ' + .' ' .''.&mt('Name').&Apache::loncommon::help_open_topic('Portfolio OpenFile').'' .''.&mt('Size').'' .''.&mt('Last Modified').'' @@ -349,6 +341,38 @@ sub display_directory { .''.&mt('Current Access Status').&Apache::loncommon::help_open_topic('Portfolio ShareFile').'' .&Apache::loncommon::end_data_table_header_row()); } + + # Empty directory? + if ($is_empty && ($current_path ne '/') && $can_delete) { + my $cols = ($select_mode eq 'true') ? 7 : 9; + # Empty message + $r->print( + &Apache::loncommon::start_data_table_row() + .'' + .'

' + .&mt('This directory is empty.') + .'

' + .'' + .&Apache::loncommon::end_data_table_row() + .&Apache::loncommon::end_data_table() + .'
' + ); + # Delete button + $r->print( + '
'. + &group_form_data(). + ''. + '

'. + ''. + '

'. + ''. + ''. + '
' + ); + # Directory is empty, so nothing else to display + return; + } + $r->print("\n".&group_form_data()."\n"); my $href_location="/uploaded/$udom/$uname/$port_path".$current_path;