Diff for /loncom/interface/lonindexcourse.pm between versions 1.3 and 1.6

version 1.3, 2024/02/12 03:46:17 version 1.6, 2025/02/26 23:04:40
Line 74  sub course_index { Line 74  sub course_index {
             last if ($c->aborted());              last if ($c->aborted());
             if ($key =~ /^src\_(.+)$/) {              if ($key =~ /^src\_(.+)$/) {
                 my $rid = $1;                  my $rid = $1;
                 if ($hash{'randomout_'.$rid} & !$env{'request.role.adv'}) {                  unless ($env{'request.role.adv'}) {
                     next;                      next if ($hash{'randomout_'.$rid} || $hash{'deeplinkout_'.$rid});
                       if (!$env{'request.deeplink.login'} && $hash{'deeplinkonly_'.$rid}) {
                           my ($value) = map { &unescape($_); } split(/:/,$hash{'deeplinkonly_'.$rid});
                           my ($state,$others,$listed) = split(/,/,$value);
                           next if (($state eq 'only') &&
                                    (($listed eq 'absent') || ($listed eq 'grades')));
                       }
                 }                  }
                 my $symb=&make_symb($rid);                  my $symb=&make_symb($rid);
                 my %newwords=&checkonthis($r,$rid,$hash{$key},0,&Apache::lonnet::gettitle($symb),                  my %newwords=&checkonthis($r,$rid,$hash{$key},0,&Apache::lonnet::gettitle($symb),
Line 87  sub course_index { Line 93  sub course_index {
 # Output  # Output
     $r->print(&Apache::loncommon::start_data_table());      $r->print(&Apache::loncommon::start_data_table());
     my $currentchar='';      my $currentchar='';
       &Apache::loncommon::set_data_table_count(1);
     foreach my $lword (sort(keys(%indexhash))) {      foreach my $lword (sort(keys(%indexhash))) {
        unless ($lword=~/\w/) { next; }         unless ($lword=~/\w/) { next; }
        if ($lword=~/^\d+$/) { next; }         if ($lword=~/^\d+$/) { next; }
Line 96  sub course_index { Line 103  sub course_index {
                     '<th>'.$firstchar.'</th><th>&nbsp;</th>'.&Apache::loncommon::end_data_table_header_row());                      '<th>'.$firstchar.'</th><th>&nbsp;</th>'.&Apache::loncommon::end_data_table_header_row());
           $currentchar=$firstchar;            $currentchar=$firstchar;
        }         }
        $r->print("\n".&Apache::loncommon::start_data_table_row()."<td>$lword</td><td>");         $r->print("\n".&Apache::loncommon::continue_data_table_row()."<td>$lword</td><td>");
        foreach my $href (split(/\,/,$indexhash{$lword})) {         foreach my $href (split(/\,/,$indexhash{$lword})) {
            unless ($href) { next; }             unless ($href) { next; }
            $r->print(' &nbsp; <a href="'.$href.'">'.$indextitles{$href}.'</a>');             $r->print(' &nbsp; <a href="'.$href.'">'.$indextitles{$href}.'</a>');
        }         }
        $r->print("</td>".&Apache::loncommon::start_data_table_row());         $r->print("</td>".&Apache::loncommon::end_data_table_row());
     }      }
     $r->print(&Apache::loncommon::end_data_table());      $r->print(&Apache::loncommon::end_data_table());
 }  }
Line 165  sub handler { Line 172  sub handler {
                 text => "$crstype Index"});                  text => "$crstype Index"});
     $r->print(&Apache::lonhtmlcommon::breadcrumbs("$crstype Index"));      $r->print(&Apache::lonhtmlcommon::breadcrumbs("$crstype Index"));
     &Apache::lonnavdisplay::startContentScreen($r,'courseindex');      &Apache::lonnavdisplay::startContentScreen($r,'courseindex');
     &course_index($r);      my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
       my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
       my $clientip = &Apache::lonnet::get_requestor_ip($r);
       my ($blocked,$blocktext) =
           &Apache::loncommon::blocking_status('index',$clientip,$cnum,$cdom);
       if ($blocked) {
           my $checkrole = "cm./$cdom/$cnum";
           if ($env{'request.course.sec'} ne '') {
               $checkrole .= "/$env{'request.course.sec'}";
           }
           if ((&Apache::lonnet::allowed('evb',undef,undef,$checkrole)) &&
               ($env{'request.role'} !~ m{^st\./$cdom/$cnum})) {
               undef($blocked);
           }
       }
       if ($blocked) {
           $r->print($blocktext);
       } else {
           &course_index($r);
       }
     &Apache::lonnavdisplay::endContentScreen($r);      &Apache::lonnavdisplay::endContentScreen($r);
     $r->print(&Apache::loncommon::end_page());      $r->print(&Apache::loncommon::end_page());
     return OK;      return OK;

Removed from v.1.3  
changed lines
  Added in v.1.6


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