[LON-CAPA-cvs] cvs: loncom /interface portfolio.pm

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 28 Jun 2006 19:52:46 -0000


albertel		Wed Jun 28 15:52:46 2006 EDT

  Modified files:              
    /loncom/interface	portfolio.pm 
  Log:
  - select mode was broken BUG#4845
  
  
Index: loncom/interface/portfolio.pm
diff -u loncom/interface/portfolio.pm:1.123 loncom/interface/portfolio.pm:1.124
--- loncom/interface/portfolio.pm:1.123	Tue Jun 27 11:38:54 2006
+++ loncom/interface/portfolio.pm	Wed Jun 28 15:52:43 2006
@@ -219,7 +219,7 @@
                 }
                my $fullpath = $current_path.$filename;
                 $fullpath = &prepend_group($fullpath,$group);
-                if ($select_mode eq 'true'){
+                if ($select_mode eq 'true') {
                     $line='<td><input type="checkbox" name="checkfile" value="'.$filename.'"';
 		    if ($$checked_files{$filename} eq 'selected') {
                         $line.=" checked ";
@@ -246,51 +246,55 @@
                         }
                         $line .= '</td>';
                     }
-		    $r->print('<tr class="'.$css_class.'">');
-		    $r->print($line);
                 }
-                my $curr_access;
-                my $pub_access = 0;
-                my $guest_access = 0;
-                my $cond_access = 0;
-                foreach my $key (sort(keys(%{$access_controls{$fullpath}}))) {
-                    my ($num,$scope,$end,$start) = &unpack_acc_key($key);
-                    if (($now > $start) && (!$end || $end > $now)) {
-                        if ($scope eq 'public')  {
-                            $pub_access = 1;
-                        } elsif ($scope eq 'guest') {
-                            $guest_access = 1;
-                        } else {
-                            $cond_access = 1;
-                        }
-                    }
-                }
-                if (!$pub_access && !$guest_access && !$cond_access) {
-                    $curr_access = &mt('Private');
-                } else {
-                    my @allaccesses; 
-                    if ($pub_access) {
-                        push(@allaccesses,&mt('Public'));
-                    }
-                    if ($guest_access) {
-                        push(@allaccesses,&mt('Passphrase-protected'));
-                    }
-                    if ($cond_access) {
-                        push(@allaccesses,&mt('Conditional'));
-                    }
-                    $curr_access = join('+ ',@allaccesses);
-                }
-                $r->print('<td><img alt="" src="'.&Apache::loncommon::icon($filename).'" /></td>');
-                $r->print('<td><a href="'.$href_location.$filename.'">'.
-			    $filename.'</a></td>'); 
-                $r->print('<td>'.$size.'</td>');
-                $r->print('<td>'.&Apache::lonlocal::locallocaltime($mtime).'</td>');
-                $r->print('<td><span style="white-space: nowrap">'.
-                          &mt($curr_access).'&nbsp;&nbsp;&nbsp;');
-                $r->print('<a href="'.$url.'?access='.$filename.
-                              '&amp;currentpath='.$current_path.$groupecho.
-                              '">'.$access_admin_text.'</a>');
-                $r->print('</span></td></tr>');
+		$r->print('<tr class="'.$css_class.'">');
+		$r->print($line);
+		my $curr_access;
+		if ($select_mode ne 'true') {
+		    my $pub_access = 0;
+		    my $guest_access = 0;
+		    my $cond_access = 0;
+		    foreach my $key (sort(keys(%{$access_controls{$fullpath}}))) {
+			my ($num,$scope,$end,$start) = &unpack_acc_key($key);
+			if (($now > $start) && (!$end || $end > $now)) {
+			    if ($scope eq 'public')  {
+				$pub_access = 1;
+			    } elsif ($scope eq 'guest') {
+				$guest_access = 1;
+			    } else {
+				$cond_access = 1;
+			    }
+			}
+		    }
+		    if (!$pub_access && !$guest_access && !$cond_access) {
+			$curr_access = &mt('Private');
+		    } else {
+			my @allaccesses; 
+			if ($pub_access) {
+			    push(@allaccesses,&mt('Public'));
+			}
+			if ($guest_access) {
+			    push(@allaccesses,&mt('Passphrase-protected'));
+			}
+			if ($cond_access) {
+			    push(@allaccesses,&mt('Conditional'));
+			}
+			$curr_access = join('+ ',@allaccesses);
+		    }
+		}
+		$r->print('<td><img alt="" src="'.&Apache::loncommon::icon($filename).'" /></td>');
+		$r->print('<td><a href="'.$href_location.$filename.'">'.
+			  $filename.'</a></td>'); 
+		$r->print('<td>'.$size.'</td>');
+		$r->print('<td>'.&Apache::lonlocal::locallocaltime($mtime).'</td>');
+		if ($select_mode ne 'true') {
+		    $r->print('<td><span style="white-space: nowrap">'.
+			      &mt($curr_access).'&nbsp;&nbsp;&nbsp;');
+		    $r->print('<a href="'.$url.'?access='.$filename.
+			      '&amp;currentpath='.$current_path.$groupecho.
+			      '">'.$access_admin_text.'</a></span>');
+		}
+		$r->print('</td></tr>'.$/);
             }
         }
     }