Diff for /rat/lonpage.pm between versions 1.59 and 1.61

version 1.59, 2004/08/29 19:25:34 version 1.61, 2004/11/12 00:21:14
Line 232  sub handler { Line 232  sub handler {
                       $lcm*=($#colcont+1)/euclid($lcm,($#colcont+1));                        $lcm*=($#colcont+1)/euclid($lcm,($#colcont+1));
                       foreach (@colcont) {                        foreach (@colcont) {
                           my $src=$hash{'src_'.$_};                            my $src=$hash{'src_'.$_};
                           $src=~/\.(\w+)$/;    my ($extension)=($src=~/\.(\w+)$/);
     if ($hash{'encrypted_'.$_}) {
         $src=&Apache::lonenc::encrypted($src);
     }
                           $metalink{$_}=$src.'.meta';                            $metalink{$_}=$src.'.meta';
                           $cellemb{$_}=Apache::loncommon::fileembstyle($1);                            $cellemb{$_}=
         &Apache::loncommon::fileembstyle($extension);
                           if ($cellemb{$_} eq 'ssi') {                            if ($cellemb{$_} eq 'ssi') {
 # --------------------------------------------------------- This is an SSI cell  # --------------------------------------------------------- This is an SSI cell
       my $prefix=$_.'_';        my $prefix=$_.'_';
Line 257  sub handler { Line 261  sub handler {
                                }                                 }
       }        }
                               my $output=Apache::lonnet::ssi($src,%posthash);                                my $output=Apache::lonnet::ssi($src,%posthash);
       $output=~        $output=~s|//(\s*<!--)? BEGIN LON-CAPA Internal.+// END LON-CAPA Internal\s*(-->)?\s||gs;
     s/\/\/ BEGIN LON\-CAPA Internal.+\/\/ END LON\-CAPA Internal\s//gs;  
                               if ($target eq 'tex') {                                if ($target eq 'tex') {
   $output =~ s/^([^&]+)\\begin{document}//;    $output =~ s/^([^&]+)\\begin{document}//;
   $output =~ s/\\end{document}//;    $output =~ s/\\end{document}//;
Line 397  sub handler { Line 400  sub handler {
 # ------------------------------------------------------------------ Start form  # ------------------------------------------------------------------ Start form
   if ($nforms) {    if ($nforms) {
       $r->print('<form method="post" action="'.        $r->print('<form method="post" action="'.
  $requrl.'">');   &Apache::lonenc::check_encrypt($requrl)
    .'">');
   }    }
       } elsif ($target eq 'tex') {        } elsif ($target eq 'tex') {
   $r->print('\documentclass{article}    $r->print('\documentclass{article}
Line 424  sub handler { Line 428  sub handler {
                           my $avespan=$lcm/($#colcont+1);                            my $avespan=$lcm/($#colcont+1);
                           for ($j=0;$j<=$#colcont;$j++) {                            for ($j=0;$j<=$#colcont;$j++) {
                               my $rid=$colcont[$j];                                my $rid=$colcont[$j];
                               my $metainfo='<a name="'.                                my $metainfo = '';
   &Apache::lonnet::escape(&Apache::lonnet::declutter($hash{'src_'.$rid})).'" />'.                                print STDERR "src is $hash{'src_'.$rid}\n";
   '<a href="'.                                unless ($hash{'src_'.$rid} =~ m-^/uploaded/-) { 
                                     $metalink{$rid}.'" target="LONcatInfo">'.                                    $metainfo ='<a name="'.
                           '<img src="/adm/lonMisc/cat_button.gif" border=0>'.   &Apache::lonnet::escape(&Apache::lonnet::declutter($hash{'src_'.$rid})).'" />'.
   '</img></a><a href="/adm/evaluate?postdata='.                                    '<a href="'.$metalink{$rid}.'" target="LONcatInfo">'.
       &Apache::lonnet::escape(&Apache::lonnet::declutter($hash{'src_'.$rid}))                                    '<img src="/adm/lonMisc/cat_button.gif" border=0>'.
       .'" target="LONcatInfo">'.                                    '</img></a>';
                           '<img src="/adm/lonMisc/eval_button.gif" border=0>'.                                }
                           '</img></a>';        my $esrc=$hash{'src_'.$rid};
         if ($hash{'encrypted_'.$rid}) {
     $esrc=&Apache::lonenc::encrypted($esrc);
         }
                                 $metainfo .= '<a href="/adm/evaluate?postdata='.
       &Apache::lonnet::escape(&Apache::lonnet::declutter($esrc)).
                                     '" target="LONcatInfo">'.
                                     '<img src="/adm/lonMisc/eval_button.gif" border=0>'.
                                     '</img></a>';
                               if (                                if (
  ($hash{'src_'.$rid}=~/\.(problem|exam|quiz|assess|survey|form)$/) &&   ($hash{'src_'.$rid}=~/\.(problem|exam|quiz|assess|survey|form)$/) &&
  (&Apache::lonnet::allowed('mgr',$ENV{'request.course.id'}))) {   (&Apache::lonnet::allowed('mgr',$ENV{'request.course.id'})) && 
    ($hash{'src_'.$rid} !~ m-^/uploaded/-)) {
   my ($mapid,$resid)=split(/\./,$rid);    my ($mapid,$resid)=split(/\./,$rid);
                                  my $symb=                                   my $symb=
                 &Apache::lonnet::declutter($hash{'map_id_'.$mapid}).                  &Apache::lonnet::declutter($hash{'map_id_'.$mapid}).
Line 504  sub handler { Line 517  sub handler {
       } elsif ($cellemb{$rid} eq 'emb') {        } elsif ($cellemb{$rid} eq 'emb') {
                                   $r->print('>'.$metainfo.'<embed src="'.                                    $r->print('>'.$metainfo.'<embed src="'.
                                     $hash{'src_'.$rid}.'"></embed>');                                      $hash{'src_'.$rid}.'"></embed>');
                                 } elsif (&Apache::lonnet::declutter($hash{'src_'.$rid}) !~/\.(sequence|page)$/) {
                                     $r->print($metainfo.'<b>'.$hash{'title_'.$rid}.'</b><br />'.
                                     &mt('It is recommended that you use an up-to-date virus scanner before handling this file.').'</p><p><table>'.
                                     &Apache::londocs::entryline(0,&mt("Click to download or use your browser's Save Link function"),'/'.&Apache::lonnet::declutter($hash{'src_'.$rid})).'</table></p><br />');
                               }                                }
       unless ($target eq 'tex') {        unless ($target eq 'tex') {
   $r->print('</td>');    $r->print('</td>');

Removed from v.1.59  
changed lines
  Added in v.1.61


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