Diff for /loncom/interface/portfolio.pm between versions 1.164 and 1.167

version 1.164, 2006/10/19 00:23:21 version 1.167, 2006/11/01 02:03:16
Line 95  sub display_common { Line 95  sub display_common {
  'createdir_label' =>    'createdir_label' => 
  'Create subdirectory in current directory:');   'Create subdirectory in current directory:');
         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_createdir = &Apache::loncommon::help_open_topic('Portfolio CreateDirectory');
   
    # TO BE DEPRECATED: This line should be deleted once Portfolio uses breadcrumbs
    $r->print(&Apache::loncommon::help_open_topic('Portfolio About', 'Help on the portfolio'));
    # END LINE TO BE DEPRECATED
   
         $r->print(<<"TABLE");           $r->print(<<"TABLE"); 
 <table id="LC_portfolio_actions">  <table id="LC_portfolio_actions">
   <tr id="LC_portfolio_upload">    <tr id="LC_portfolio_upload">
Line 109  sub display_common { Line 116  sub display_common {
  <input type="hidden" name="action" value="$env{"form.action"}" />   <input type="hidden" name="action" value="$env{"form.action"}" />
  <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'}" />   <input type="submit" name="storeupl" value="$text{'upload'}" />$help_fileupload
       </form>        </form>
     </td>      </td>
   </tr>    </tr>
Line 124  sub display_common { Line 131  sub display_common {
         <input type="hidden" name="action" value="$env{"form.action"}" />          <input type="hidden" name="action" value="$env{"form.action"}" />
         <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="createdir" value="$text{'createdir'}" />          <input type="submit" name="createdir" value="$text{'createdir'}" />$help_createdir
       </form>        </form>
     </td>      </td>
   </tr>    </tr>
Line 155  TABLE Line 162  TABLE
         }          }
     }      }
     $r->print('</span>');      $r->print('</span>');
    $r->print(&Apache::loncommon::help_open_topic('Portfolio ChangeDirectory'));
     &Apache::lonhtmlcommon::store_recent($namespace,$current_path,$current_path);      &Apache::lonhtmlcommon::store_recent($namespace,$current_path,$current_path);
     $r->print('<br /><form method="post" action="'.$url.'?mode='.$env{"form.mode"}.'&amp;fieldname='.$env{"form.fieldname"}.&group_args());      $r->print('<br /><form method="post" action="'.$url.'?mode='.$env{"form.mode"}.'&amp;fieldname='.$env{"form.fieldname"}.&group_args());
     $r->print('">'.      $r->print('">'.
Line 259  sub display_directory { Line 267  sub display_directory {
             '<tr><th>Select</th><th>&nbsp;</th><th>&nbsp;</th><th>Name</th><th>Size</th><th>Last Modified</th></tr>');              '<tr><th>Select</th><th>&nbsp;</th><th>&nbsp;</th><th>Name</th><th>Size</th><th>Last Modified</th></tr>');
     } else {      } else {
         $r->print('<form method="post" action="'.$url.'">');          $r->print('<form method="post" action="'.$url.'">');
    $r->print(&Apache::loncommon::help_open_topic('Portfolio FileList', 'Using the portfolio file list'));
         $r->print('<table id="LC_browser">'.          $r->print('<table id="LC_browser">'.
             '<tr><th colspan="2">Actions</th><th>&nbsp;</th><th>&nbsp;</th><th>Name</th><th>Size</th><th>Last Modified</th><th>Current Access Status</th></tr>');              '<tr><th colspan="2">Actions</th><th>&nbsp;</th><th>&nbsp;</th><th>Name'.
    &Apache::loncommon::help_open_topic('Portfolio OpenFile').
    '</th><th>Size</th><th>Last Modified</th><th>Current Access Status'.
    &Apache::loncommon::help_open_topic('Portfolio ShareFile').
    '</th></tr>');
     }      }
     $r->print("\n".&group_form_data()."\n");      $r->print("\n".&group_form_data()."\n");
   
Line 436  sub display_directory { Line 449  sub display_directory {
         $r->print('</table>');          $r->print('</table>');
         if ($can_delete) {          if ($can_delete) {
             $r->print('              $r->print('
         <input type="submit" name="doit" value="Delete Checked Files" />          <input type="submit" name="doit" value="Delete Checked Files" />'.
    &Apache::loncommon::help_open_topic('Portfolio DeleteFile').'
         <input type="hidden" name="action" value="delete" />          <input type="hidden" name="action" value="delete" />
         <input type="hidden" name="currentpath" value="'.$current_path.'" />          <input type="hidden" name="currentpath" value="'.$current_path.'" />
         </form>'          </form>'
Line 550  sub delete_confirmed { Line 564  sub delete_confirmed {
        $env{'form.currentpath'}.         $env{'form.currentpath'}.
        $delete_file);         $delete_file);
         if ($result ne 'ok') {          if ($result ne 'ok') {
     $r->print('<span class="LC_error"> An error occured ('.$result.      $r->print('<span class="LC_error">'.
          ') while trying to delete '.                       &mt('An error occured ([_1]) while trying to delete 
                       &display_file(undef, $delete_file).'</span><br />');                           [_2].',$result,&display_file(undef, $delete_file)).
                         '</span><br /><br />');
         } else {          } else {
             $r->print(&mt('File: [_1] deleted.',              $r->print(&mt('File: [_1] deleted.',
                           &display_file(undef,$delete_file)));                            &display_file(undef,$delete_file)));
Line 563  sub delete_confirmed { Line 578  sub delete_confirmed {
                                                          $group,$file_name);                                                           $group,$file_name);
             if (keys(%access_controls) > 0) {              if (keys(%access_controls) > 0) {
                 my %changes;                   my %changes; 
                 foreach my $key (%{$access_controls{$file_name}}) {                  foreach my $key (keys(%{$access_controls{$file_name}})) {
                     $changes{'delete'}{$key} = 1;                      $changes{'delete'}{$key} = 1;
                 }                  }
                 if (keys(%changes) > 0) {                  if (keys(%changes) > 0) {
Line 571  sub delete_confirmed { Line 586  sub delete_confirmed {
                     &Apache::lonnet::modify_access_controls($file_name,\%changes,                      &Apache::lonnet::modify_access_controls($file_name,\%changes,
                                                             $udom,$uname);                                                              $udom,$uname);
                     if ($outcome ne 'ok') {                      if ($outcome ne 'ok') {
                            $r->print(&mt('<br />'."An error occured ($outcome) while ".                             $r->print('<br />'.&mt("An error occured ([_1]) while ".
                                "trying to delete access controls for the file.").                                 "trying to delete access controls for the file.",$outcome).
                                '</span><br />');                                 '</span><br /><br />');
                     } else {                      } else {
                         if ($deloutcome eq 'ok') {                          if ($deloutcome eq 'ok') {
                             $r->print(&mt('<br />Access controls also deleted for the file.'));                              $r->print('<br />'.&mt('Access controls also deleted for the file.').'<br /><br />');
                         } else {                          } else {
                             $r->print('<span class="LC_error">'.                              $r->print('<span class="LC_error">'.'<br />'.
                                &mt('<br />'."An error occured ($deloutcome) while ".                                 &mt("An error occured ([_1]) while ".
                                    "trying to delete access controls for the file.").                                     "trying to delete access controls for the file.",$deloutcome).
                                    '</span><br />');                                     '</span><br /><br />');
                         }                          }
                     }                      }
                 }                  }
Line 685  sub access_for_renamed { Line 700  sub access_for_renamed {
     my $newfile = $env{'form.currentpath'}.$filenewname;      my $newfile = $env{'form.currentpath'}.$filenewname;
     $newfile = &prepend_group($newfile);      $newfile = &prepend_group($newfile);
     my $current_permissions =      my $current_permissions =
             &Apache::lonnet::get_portfile_permissions($udom,$uname);   &Apache::lonnet::get_portfile_permissions($udom,$uname);
     my %access_controls =      my %access_controls =
             &Apache::lonnet::get_access_controls($current_permissions,   &Apache::lonnet::get_access_controls($current_permissions,
                                                  $group,$oldfile);       $group,$oldfile);
     my $chg_text;      my $chg_text;
     if (keys(%access_controls) > 0) {      if (keys(%access_controls) > 0) {
         my %change_old;          my %change_old;
         my %change_new;          my %change_new;
         foreach my $key (%{$access_controls{$oldfile}}) {          foreach my $key (keys(%{$access_controls{$oldfile}})) {
             $change_old{'delete'}{$key} = 1;              $change_old{'delete'}{$key} = 1;
             $change_new{'activate'}{$key} = $access_controls{$oldfile}{$key};              $change_new{'activate'}{$key} = $access_controls{$oldfile}{$key};
         }          }
         my ($outcome,$deloutcome,$new_values,$translation) =          my ($outcome,$deloutcome,$new_values,$translation) =
             &Apache::lonnet::modify_access_controls($oldfile,\%change_old,              &Apache::lonnet::modify_access_controls($oldfile,\%change_old,
                                                             $udom,$uname);      $udom,$uname);
         if ($outcome ne 'ok') {          if ($outcome ne 'ok') {
             $chg_text = &mt('<br /><br />'."An error occured ($outcome) while ".              $chg_text ='<br /><br />'.&mt("An error occured ([_1]) while ".
                 "trying to delete access control records for the old name.").                  "trying to delete access control records for the old name.",$outcome).
                 '</span><br />';                  '</span><br />';
         } else {          } else {
             if ($deloutcome ne 'ok') {              if ($deloutcome ne 'ok') {
                 $chg_text = '<br /><br /><span class="LC_error">'.                  $chg_text = '<br /><br /><span class="LC_error"><br />'.
                           &mt('<br />'."An error occured ($deloutcome) while ".      &mt("An error occured ([_1]) while ".
                           "trying to delete access control records for the old name.").   "trying to delete access control records for the old name.",$deloutcome).
                           '</span><br />';   '</span><br />';
             }              }
         }          }
         ($outcome,$deloutcome,$new_values,$translation) =          ($outcome,$deloutcome,$new_values,$translation) =
             &Apache::lonnet::modify_access_controls($newfile,\%change_new,              &Apache::lonnet::modify_access_controls($newfile,\%change_new,
                                                     $udom,$uname);                                                      $udom,$uname);
         if ($outcome ne 'ok') {          if ($outcome ne 'ok') {
             $chg_text .= &mt('<br /><br />'."An error occured ($outcome) while ".              $chg_text .= '<br /><br />'.
                 "trying to update access control records for the new name.").   &mt("An error occured ([_1]) while ".
                   "trying to update access control records for the new name.",$outcome).
                 '</span><br />';                  '</span><br />';
         }          }
         if ($chg_text eq '') {          if ($chg_text eq '') {
Line 746  sub display_access { Line 762  sub display_access {
     if ($group eq '') {      if ($group eq '') {
         $info .= (&mt("A listing of files viewable without log-in is available at: <a href='/adm/$udom/$uname/aboutme/portfolio'>http://$ENV{'SERVER_NAME'}/adm/$udom/$uname/aboutme/portfolio</a>.<br />For logged in users a 'Display file listing' link will also appear (when there are viewable files) on your personal information page:<br /><a href='/adm/$udom/$uname/aboutme'>http://$ENV{'SERVER_NAME'}/adm/$udom/$uname/aboutme</a><br />"));          $info .= (&mt("A listing of files viewable without log-in is available at: <a href='/adm/$udom/$uname/aboutme/portfolio'>http://$ENV{'SERVER_NAME'}/adm/$udom/$uname/aboutme/portfolio</a>.<br />For logged in users a 'Display file listing' link will also appear (when there are viewable files) on your personal information page:<br /><a href='/adm/$udom/$uname/aboutme'>http://$ENV{'SERVER_NAME'}/adm/$udom/$uname/aboutme</a><br />"));
     }      }
       
     if ($can_setacl) {      if ($can_setacl) {
         &open_form($r,$url);          &open_form($r,$url);
         $r->print($header.$info);          $r->print($header.$info);
    $r->print ('<br/>'.&Apache::loncommon::help_open_topic('Portfolio ShareFile SetAccess', 'Help on setting up share access'));
    $r->print (&Apache::loncommon::help_open_topic('Portfolio ShareFile ChangeSetting', 'Help on changing settings'));
    $r->print (&Apache::loncommon::help_open_topic('Portfolio ShareFile StopAccess', 'Help on removing share access'));
         &access_setting_table($r,$access_controls{$file_name});          &access_setting_table($r,$access_controls{$file_name});
         my $button_text = {          my $button_text = {
                         'continue' => &mt('Proceed'),                          'continue' => &mt('Proceed'),

Removed from v.1.164  
changed lines
  Added in v.1.167


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>