--- loncom/interface/portfolio.pm 2008/11/28 16:10:20 1.197 +++ loncom/interface/portfolio.pm 2008/12/05 10:23:56 1.200 @@ -1,7 +1,7 @@ # The LearningOnline Network # portfolio browser # -# $Id: portfolio.pm,v 1.197 2008/11/28 16:10:20 bisitz Exp $ +# $Id: portfolio.pm,v 1.200 2008/12/05 10:23:56 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -87,13 +87,12 @@ sub display_common { my $groupitem = &group_form_data(); my $iconpath= $r->dir_config('lonIconsURL') . "/"; - my %text=&Apache::lonlocal::texthash( + my %lt=&Apache::lonlocal::texthash( 'upload' => 'Upload', - 'upload_label' => - 'Upload file to current directory:', + 'upload_label' => 'Upload file to current directory', 'createdir' => 'Create Subdirectory', '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,'&<>"'); @@ -108,50 +107,51 @@ sub display_common { $parse_check = <<"END"; <br /> <span class="LC_nobreak"> - <label>$text{'parse'} + <label>$lt{'parse'} <input type="checkbox" name="parserflag" checked="checked" /> </label> </span> END } - $r->print(<<"TABLE"); -<table id="LC_portfolio_actions"> - <tr id="LC_portfolio_upload"> - <td class="LC_label"> - $text{'upload_label'} - </td> - <td class="LC_value"> - <form method="post" enctype="multipart/form-data" action="$escuri"> - $groupitem - <input name="uploaddoc" type="file" /> - <input type="hidden" name="currentpath" value="$current_path" /> - <input type="hidden" name="action" value="$env{"form.action"}" /> - <input type="hidden" name="fieldname" value="$env{"form.fieldname"}" /> - <input type="hidden" name="mode" value="$env{"form.mode"}" /> - <input type="submit" name="storeupl" value="$text{'upload'}" /> -$help_fileupload -$parse_check - </form> - </td> - </tr> - <tr id="LC_portfolio_createdir"> - <td class="LC_label"> - $text{'createdir_label'} - </td> - <td class="LC_value"> - <form method="post" action="$escuri"> - <input name="newdir" type="input" />$groupitem - <input type="hidden" name="currentpath" value="$current_path" /> - <input type="hidden" name="action" value="$env{"form.action"}" /> - <input type="hidden" name="fieldname" value="$env{"form.fieldname"}" /> - <input type="hidden" name="mode" value="$env{"form.mode"}" /> - <input type="submit" name="createdir" value="$text{'createdir'}" />$help_createdir - </form> - </td> - </tr> -</table> -TABLE - } + + $r->print('<div>'); + # Upload File + $r->print('<div class="LC_left_float">' + .'<form method="post" enctype="multipart/form-data" action="'.$escuri.'">' + .'<fieldset>' + .'<legend>'.$lt{'upload_label'}.'</legend>' + .$groupitem + .'<input name="uploaddoc" type="file" />' + .'<input type="hidden" name="currentpath" value="'.$current_path.'" />' + .'<input type="hidden" name="action" value="'.$env{"form.action"}.'" />' + .'<input type="hidden" name="fieldname" value="'.$env{"form.fieldname"}.'" />' + .'<input type="hidden" name="mode" value="'.$env{"form.mode"}.'" />' + .'<input type="submit" name="storeupl" value="'.$lt{'upload'}.'" />' + .$help_fileupload + .$parse_check + .'</fieldset>' + .'</form>' + .'</div>' + ); + # Create Subdirectory + $r->print('<div class="LC_left_float">' + .'<form method="post" action="'.$escuri.'">' + .'<fieldset>' + .'<legend>'.$lt{'createdir_label'}.'</legend>' + .'<input name="newdir" type="input" />'.$groupitem + .'<input type="hidden" name="currentpath" value="'.$current_path.'" />' + .'<input type="hidden" name="action" value="'.$env{"form.action"}.'" />' + .'<input type="hidden" name="fieldname" value="'.$env{"form.fieldname"}.'" />' + .'<input type="hidden" name="mode" value="'.$env{"form.mode"}.'" />' + .'<input type="submit" name="createdir" value="'.$lt{'createdir'}.'" />' + .$help_createdir + .'</fieldset>' + .'</form>' + .'</div>' + ); + $r->print('</div>'); + } # end "if can_upload" + my @tree = split (/\//,$current_path); my %anchor_fields = ( 'selectfile' => $port_path, @@ -271,7 +271,9 @@ sub display_directory { $display_out = '<form method="post" action="'.$url.'">'. &group_form_data(). '<input type="hidden" name="action" value="deletedir" />'. + '<p>'. '<input type="submit" name="deletedir" value="'.&mt("Delete Directory").'" />'. + '</p>'. '<input type="hidden" name="selectfile" value="" />'. '<input type="hidden" name="currentpath" value="'.$current_path.'" />'. '</form>'; @@ -477,16 +479,20 @@ sub display_directory { <input type="hidden" name="continue" value="true" /> <input type="hidden" name="fieldname" value="'.$env{'form.fieldname'}.'" /> <input type="hidden" name="mode" value="selectfile" /> - <input type="submit" name="submit" value="Select checked files, and continue selecting." /><br /> - <input type="button" name="doit" onClick= "finishSelect();" value="Select checked files, and close window" /> + <p> + <input type="submit" name="submit" value="'.&mt('Select checked files, and continue selecting').'" /><br /> + <input type="button" name="doit" onClick= "finishSelect();" value="'.&mt('Select checked files, and close window').'" /> + </p> <input type="hidden" name="currentpath" value="'.$current_path.'" /> </form>'); } else { $r->print(&Apache::loncommon::end_data_table()); if ($can_delete) { $r->print(' + <p> <input type="submit" name="doit" value="'.&mt('Delete Selected').'" />'. &Apache::loncommon::help_open_topic('Portfolio DeleteFile').' + </p> <input type="hidden" name="action" value="delete" /> <input type="hidden" name="currentpath" value="'.$current_path.'" /> </form>' @@ -1494,7 +1500,7 @@ sub course_row { } $max_id ++; my $role_selects = &role_selectors($num,$role_id,$type,$content,'display'); - $r->print('<tr><td><span style="white-space: nowrap"><label><input type="checkbox" name="delete_role_'.$num.'" value="'.$role_id.'" />'.&mt('Delete').'</label></span><br /><input type="hidden" name="preserve_role_'.$num.'" value="'.$role_id.'" /></td>'.$role_selects.'</tr>'); + $r->print('<tr><td><span class="LC_nobreak"><label><input type="checkbox" name="delete_role_'.$num.'" value="'.$role_id.'" />'.&mt('Delete').'</label></span><br /><input type="hidden" name="preserve_role_'.$num.'" value="'.$role_id.'" /></td>'.$role_selects.'</tr>'); } $r->print('</table>'); } @@ -1569,7 +1575,7 @@ sub additional_item { sub actionbox { my ($status,$num,$scope) = @_; - my $output = '<span style="white-space: nowrap"><label>'; + my $output = '<span class="LC_nobreak"><label>'; if ($status eq 'new') { my $checkstate; if ($scope eq 'domains' || $scope eq 'users' || $scope eq 'course') { @@ -1580,7 +1586,7 @@ sub actionbox { &mt('Activate'); } else { $output .= '<input type="checkbox" name="delete" value="'.$num. - '" />'.&mt('Delete').'</label></span><br /><span style="white-space: nowrap">'. + '" />'.&mt('Delete').'</label></span><br /><span class="LC_nobreak">'. '<label><input type="checkbox" name="update" value="'. $num.'" />'.&mt('Update'); } @@ -1599,7 +1605,7 @@ sub dateboxes { undef,undef,1); my $enddate = &Apache::lonhtmlcommon::date_setter('portform', 'enddate_'.$num,$end,undef,undef,undef,1,undef, - undef,undef,1). ' <span style="white-space: nowrap"><label>'. + undef,undef,1). ' <span class="LC_nobreak"><label>'. '<input type="checkbox" name="noend_'. $num.'" '.$noend.' />'.&mt('No end date'). '</label></span>'; @@ -1773,15 +1779,28 @@ ENDSMP </script> ENDSMP $r->print($javascript); - $r->print("<h1>".&mt('Select portfolio files')."</h1>". - &mt('Check as many as you wish in response to the problem.')."<br />"); + $r->print("<h1>".&mt('Select portfolio files')."</h1>"); my @otherfiles=&Apache::lonnet::files_not_in_path($env{'user.name'}, $env{'form.currentpath'}); if (@otherfiles) { - $r->print("<strong>".&mt('Files selected from other directories:')."</strong><br />"); + $r->print(&Apache::loncommon::start_data_table() + .&Apache::loncommon::start_data_table_header_row() + .'<th>'.&mt('Files selected from other directories:')."</th>" + .&Apache::loncommon::end_data_table_header_row() + ); foreach my $file (@otherfiles) { - $r->print($file."<br />"); + $r->print(&Apache::loncommon::start_data_table_row() + .'<td>'.$file."</td>" + .&Apache::loncommon::end_data_table_row() + ); } + $r->print(&Apache::loncommon::end_data_table() + .'<br />' + ); } + $r->print('<div>' + .&mt('Check as many files as you wish in response to the problem:') + .'</div>' + ); }