Diff for /rat/lonsequence.pm between versions 1.17 and 1.18

version 1.17, 2004/05/21 20:16:40 version 1.18, 2004/07/06 15:27:00
Line 246  sub handler { Line 246  sub handler {
 # ------------------------------------------------------------ Tie symb db file  # ------------------------------------------------------------ Tie symb db file
   my $disurl='';    my $disurl='';
   my $dismapid='';    my $dismapid='';
     my $exitdisid = '';
     my $arrow_dir = '';
   
   if (($ENV{'request.course.fn'}) && (!$ENV{'form.forceselect'})) {    if (($ENV{'request.course.fn'}) && (!$ENV{'form.forceselect'})) {
        my $last;         my $last;
Line 269  sub handler { Line 271  sub handler {
        $disid=$bighash{'map_finish_'.$requrl};         $disid=$bighash{'map_finish_'.$requrl};
            } else {             } else {
                $disid=$bighash{'map_start_'.$requrl};                 $disid=$bighash{'map_start_'.$requrl};
            }              }
            if ($disid) {             if ($disid) {
        $disurl=$bighash{'src_'.$disid};         $disurl=$bighash{'src_'.$disid};
                $dismapid=(split(/\./,$disid))[1];                 $dismapid=(split(/\./,$disid))[1];
                $randomout = $bighash{'randomout_'.$disid};                 $randomout = $bighash{'randomout_'.$disid};
              } elsif (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'_symb.db',
                       &GDBM_READER(),0640)) {
                  $last=$hash{'last_known'};
                  untie(%hash);
            }             }
   
   
 # ----------- If this is an empty one, or hidden, skip to next non-empty or non-hidden one  # ----------- If this is an empty one, or hidden, skip to next non-empty or non-hidden one
            if ( ((!$disurl) && ($disid)) || ($randomout && $disid) ) {             while ( ((!$disurl) && ($disid)) || ($randomout && $disid) ) {
        $direction=($direction?$direction:'forward');         $direction=($direction?$direction:'forward');
                ($disid,$requrl)=                 ($disid,$requrl)=
                          &Apache::lonpageflip::fullmove($disid,                           &Apache::lonpageflip::fullmove($disid,
Line 286  sub handler { Line 294  sub handler {
                    $dismapid=(split(/\./,$disid))[1];                     $dismapid=(split(/\./,$disid))[1];
                }                 }
     }      }
              $exitdisid = $disid;
              $arrow_dir = $direction;
   
 # --------------------------------------- Untie hash, make sure to come by here  # --------------------------------------- Untie hash, make sure to come by here
            untie(%bighash);             untie(%bighash);
Line 293  sub handler { Line 303  sub handler {
    }     }
   
 # now either disurl is set (going to first page), or we need another display  # now either disurl is set (going to first page), or we need another display
   
    if ($disurl) {     if ($disurl) {
 # -------------------------------------------------- Has first or last resource  # -------------------------------------------------- Has first or last resource
       &Apache::lonnet::symblist($requrl,$disurl => $dismapid,        &Apache::lonnet::symblist($requrl,$disurl => $dismapid,
Line 304  sub handler { Line 313  sub handler {
    } else {     } else {
        &Apache::loncommon::content_type($r,'text/html');         &Apache::loncommon::content_type($r,'text/html');
        $r->send_http_header;         $r->send_http_header;
        &viewmap($r,$requrl);         if ($exitdisid eq '') {
              my %lt =&Apache::lonlocal::texthash(
                      'back' => 'beginning',
                      'forward' => 'end',
                      'emfo' => 'Empty Folder/Sequence',
                      'nere' => 'Next resource could not be displayed',
                      'goba' => 'Go Back',
                      'nacc' => 'Navigate Course Content',
                             );
              my $warnmsg = 'As all folders and sequences ';
              if ($arrow_dir eq 'forward') {
                  $warnmsg .= &mt('following the current resource were empty').',';
              } elsif ($arrow_dir eq 'back') {
                  $warnmsg .= &mt('preceding the current resource were empty').',';
              }
              $warnmsg .= &mt('you have now reached the').' '.$lt{$arrow_dir}.' '.&mt('of the course.');
              my $bodytag=&Apache::loncommon::bodytag(&mt('emfo'));
              $r->print(<<ENDNONE);
   <head><title>$lt{'emfo'}</title></head>
   $bodytag
   <h3>$lt{'nere'}</h3>
   <p>$warnmsg</p>
   <ul>
     <li><a href="javascript:history.go(-1)">$lt{'goba'}</a></li>
     <li><a href="/adm/navmaps">$lt{'nacc'}</a></li>
   </ul>
   </body>
    </html>
   ENDNONE
          } else {
              &viewmap($r,$requrl);
          }
        return OK;         return OK;
    }     }
 }  }

Removed from v.1.17  
changed lines
  Added in v.1.18


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