Diff for /loncom/interface/portfolio.pm between versions 1.113 and 1.115

version 1.113, 2006/06/22 16:51:00 version 1.115, 2006/06/22 18:33:58
Line 65  sub display_common { Line 65  sub display_common {
  'Create subdirectory in current directory:');   'Create subdirectory in current directory:');
     my $escuri = &HTML::Entities::encode($r->uri,'&<>"');      my $escuri = &HTML::Entities::encode($r->uri,'&<>"');
     $r->print(<<"TABLE");       $r->print(<<"TABLE"); 
 <table border="0" cellspacing="2" cellpadding="2">  <table id="LC_portfolio_actions">
   <tr valign="middle">    <tr id="LC_portfolio_upload">
     <td bgcolor="#ccddaa" align="right">      <td class="LC_label">
       $text{'upload_label'}        $text{'upload_label'}
     </td>      </td>
     <td bgcolor="#ccddaa" align="left">$groupitem      <td class="LC_value">$groupitem
       <form method="post" enctype="multipart/form-data" action="$escuri">        <form method="post" enctype="multipart/form-data" action="$escuri">
         <input name="uploaddoc" type="file" />          <input name="uploaddoc" type="file" />
  <input type="hidden" name="currentpath" value="$current_path" />   <input type="hidden" name="currentpath" value="$current_path" />
Line 81  sub display_common { Line 81  sub display_common {
       </form>        </form>
     </td>      </td>
   </tr>    </tr>
   <tr>    <tr id="LC_portfolio_createdir">
     <td bgcolor="#ccddaa" align="right">      <td class="LC_label">
       $text{'createdir_label'}        $text{'createdir_label'}
     </td>      </td>
     <td bgcolor="#ccddaa" align="left">      <td class="LC_value">
       <form method="post" action="$escuri">        <form method="post" action="$escuri">
         <input name="newdir" type="input" />$groupitem          <input name="newdir" type="input" />$groupitem
         <input type="hidden" name="currentpath" value="$current_path" />          <input type="hidden" name="currentpath" value="$current_path" />
Line 1012  function getIndex(name,value) { Line 1012  function getIndex(name,value) {
   
 sub course_row {  sub course_row {
     my ($r,$status,$type,$item,$access_controls,$tablecolor,$now,$then) = @_;      my ($r,$status,$type,$item,$access_controls,$tablecolor,$now,$then) = @_;
     my %content;      my $content;
     my $defdom = $env{'user.domain'};      my $defdom = $env{'user.domain'};
     if ($status eq 'old') {      if ($status eq 'old') {
         $defdom =  $$access_controls{$item}{'domain'};           $content = $$access_controls{$item}; 
           $defdom =  $content->{'domain'};
     }      }
     my $js = &Apache::loncommon::coursebrowser_javascript($defdom)      my $js = &Apache::loncommon::coursebrowser_javascript($defdom)
  .&course_js();   .&course_js();
Line 1027  sub course_row { Line 1028  sub course_row {
                                                     $type);                                                      $type);
     $r->print('<td>'.$js.&actionbox($status,$num,$scope).'</td>');      $r->print('<td>'.$js.&actionbox($status,$num,$scope).'</td>');
     if ($status eq 'old') {      if ($status eq 'old') {
         my $cid = $content{'domain'}.'_'.$content{'number'};          my $cid = $content->{'domain'}.'_'.$content->{'number'};
         my %course_description = &Apache::lonnet::coursedescription($cid);          my %course_description = &Apache::lonnet::coursedescription($cid);
         $r->print('<td><input type="hidden" name="crsdom_'.$num.'" value="'.$content{'domain'}.'" /><input type="hidden" name="crsnum_'.$num.'" value="'.$content{'number'}.'" />'.$course_description{'description'}.'</td>');          $r->print('<td><input type="hidden" name="crsdom_'.$num.'" value="'.$content->{'domain'}.'" /><input type="hidden" name="crsnum_'.$num.'" value="'.$content->{'number'}.'" />'.$course_description{'description'}.'</td>');
     } elsif ($status eq 'new') {      } elsif ($status eq 'new') {
         my $uctype = $type;          my $uctype = $type;
         $uctype =~ s/^(\w)/uc($1)/e;          $uctype =~ s/^(\w)/uc($1)/e;
Line 1042  sub course_row { Line 1043  sub course_row {
               &mt($crsgrptext).'</th></tr>');                &mt($crsgrptext).'</th></tr>');
     if ($status eq 'old') {      if ($status eq 'old') {
         my $max_id = 0;          my $max_id = 0;
         foreach my $role_id (sort(keys(%{$content{'roles'}}))) {          foreach my $role_id (sort(keys(%{$content->{'roles'}}))) {
             if ($role_id > $max_id) {              if ($role_id > $max_id) {
                 $max_id = $role_id;                  $max_id = $role_id;
             }              }
             $max_id ++;              $max_id ++;
             my $role_selects = &role_selectors($num,$role_id,$status,$type,\%content,'display');              my $role_selects = &role_selectors($num,$role_id,$status,$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 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('</table><br />'.&mt('Add a roles-based condition').'&nbsp;<input type="checkbox" name ="add_role_'.$num.'" onClick="javascript:setRoleOptions(this,'."'$num','$content{domain}','$content{number}','Course'".')" value="'.$max_id.'" /><input type="hidden" name="role_'.$num.'_'.$max_id.'" /><input type="hidden" name="access_'.$num.'_'.$max_id.'" /><input type="hidden" name="section_'.$num.'_'.$max_id.'" /><input type="hidden" name="group_'.$num.'_'.$max_id.'" /></td>');          $r->print('</table><br />'.&mt('Add a roles-based condition').'&nbsp;<input type="checkbox" name ="add_role_'.$num.'" onClick="javascript:setRoleOptions(this,'."'$num','$content->{'domain'}','$content->{'number'}','Course'".')" value="'.$max_id.'" /><input type="hidden" name="role_'.$num.'_'.$max_id.'" /><input type="hidden" name="access_'.$num.'_'.$max_id.'" /><input type="hidden" name="section_'.$num.'_'.$max_id.'" /><input type="hidden" name="group_'.$num.'_'.$max_id.'" /></td>');
     } elsif ($status eq 'new') {      } elsif ($status eq 'new') {
         my $role_id = 1;          my $role_id = 1;
         my $role_selects = &role_selectors($num,$role_id,$status,$type,undef,'display');          my $role_selects = &role_selectors($num,$role_id,$status,$type,undef,'display');

Removed from v.1.113  
changed lines
  Added in v.1.115


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