Diff for /loncom/interface/londocs.pm between versions 1.133 and 1.137.2.2

version 1.133, 2004/07/02 00:59:55 version 1.137.2.2, 2004/09/09 18:57:21
Line 281  sub breadcrumbs { Line 281  sub breadcrumbs {
                 
       
     }      }
     return &Apache::lonhtmlcommon::breadcrumbs(undef,undef,undef,undef,undef,0);      return &Apache::lonhtmlcommon::breadcrumbs(undef,undef,undef,undef,undef,
          0,'nohelp');
 }  }
   
 sub editor {  sub editor {
Line 575  END Line 576  END
     my $isfolder=0;      my $isfolder=0;
     my $folderarg;      my $folderarg;
     if ($uploaded) {      if ($uploaded) {
        if ($extension eq 'sequence') {   if ($extension eq 'sequence') {
   $icon=$iconpath.'/folder_closed.gif';      $icon=$iconpath.'/folder_closed.gif';
           $url=~/$coursenum\/([\/\w]+)\.sequence$/;      $url=~/$coursenum\/([\/\w]+)\.sequence$/;
           $url='/adm/coursedocs?';      $url='/adm/coursedocs?';
   $folderarg=$1;      $folderarg=$1;
           $isfolder=1;      $isfolder=1;
        }   } else {
       &Apache::lonnet::allowuploaded('/adm/coursedoc',$url);
    }
     }      }
     $url=~s/^http\&colon\;\/\//\/adm\/wrapper\/ext\//;      $url=~s/^http\&colon\;\/\//\/adm\/wrapper\/ext\//;
     if ((!$isfolder) && ($residx) && ($folder!~/supplemental/)) {      if ((!$isfolder) && ($residx) && ($folder!~/supplemental/)) {
Line 633  END Line 636  END
  $line.=(<<ENDPARMS);   $line.=(<<ENDPARMS);
 <td bgcolor="#BBBBFF"><font size='-2'>  <td bgcolor="#BBBBFF"><font size='-2'>
 <input type="checkbox" name="hidprs_$orderidx" $hidtext/> $lt{'hd'}</td>  <input type="checkbox" name="hidprs_$orderidx" $hidtext/> $lt{'hd'}</td>
 <td bgcolor="#BBBBFF"><font size='-2'>  <!--<td bgcolor="#BBBBFF"><font size='-2'>
 <input type="checkbox" name="encprs_$orderidx" $enctext/> $lt{'ec'}</td>  <input type="checkbox" name="encprs_$orderidx" $enctext/> $lt{'ec'}</td>-->
 <td bgcolor="#BBBBFF"><font size="-2">$parameterset</font></td>  <td bgcolor="#BBBBFF"><font size="-2">$parameterset</font></td>
 <td bgcolor="#BBBBFF"><font size='-2'>  <td bgcolor="#BBBBFF"><font size='-2'>
 <input type="submit" value="$lt{'sp'}" />  <input type="submit" value="$lt{'sp'}" />
Line 648  ENDPARMS Line 651  ENDPARMS
 # ---------------------------------------------------------------- tie the hash  # ---------------------------------------------------------------- tie the hash
   
 sub tiehash {  sub tiehash {
       my ($mode)=@_;
     $hashtied=0;      $hashtied=0;
     if ($ENV{'request.course.fn'}) {      if ($ENV{'request.course.fn'}) {
         if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.".db",   if ($mode eq 'write') {
             &GDBM_READER(),0640)) {      if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.".db",
       &GDBM_WRCREAT(),0640)) {
                   $hashtied=2;
       }
    } else {
       if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.".db",
       &GDBM_READER(),0640)) {
                 $hashtied=1;                  $hashtied=1;
         }      }
    }
     }          }    
 }  }
   
Line 819  sub checkversions { Line 830  sub checkversions {
  } else {   } else {
     $r->print('<h1><font color="red">'.&mt('An Error Occured while Attempting to Store your Version Settings').'</font></h1>');      $r->print('<h1><font color="red">'.&mt('An Error Occured while Attempting to Store your Version Settings').'</font></h1>');
  }   }
  &changewarning($r,'');   &mark_hash_old();
     }      }
       &changewarning($r,'');
     if ($ENV{'form.timerange'} eq 'all') {      if ($ENV{'form.timerange'} eq 'all') {
 # show all documents  # show all documents
  $header=&mt('All Documents in Course');   $header=&mt('All Documents in Course');
Line 940  ENDHEADERS Line 952  ENDHEADERS
 # Set version  # Set version
     $r->print(&Apache::loncommon::select_form($setversions{$linkurl},      $r->print(&Apache::loncommon::select_form($setversions{$linkurl},
       'set_version_'.$linkurl,        'set_version_'.$linkurl,
       ('' => '',        ('select_form_order' =>
          ['',1..$currentversion,'mostrecent'],
          '' => '',
        'mostrecent' => 'most recent',         'mostrecent' => 'most recent',
        map {$_,$_} (1..$currentversion))));         map {$_,$_} (1..$currentversion))));
     $r->print('</nobr></td></tr><tr><td></td>');      $r->print('</nobr></td></tr><tr><td></td>');
Line 1001  ENDHEADERS Line 1015  ENDHEADERS
     &untiehash();      &untiehash();
 }  }
   
   sub mark_hash_old {
       my $retie_hash=0;
       if ($hashtied) {
    $retie_hash=1;
    &untiehash();
       }
       &tiehash('write');
       $hash{'old'}=1;
       &untiehash();
       if ($retie_hash) { &tiehash(); }
   }
   
   sub is_hash_old {
       my $untie_hash=0;
       if (!$hashtied) {
    $untie_hash=1;
    &tiehash();
       }
       my $return=$hash{'old'};
       if ($untie_hash) { &untiehash(); }
       return $return;
   }
   
 sub changewarning {  sub changewarning {
     my ($r,$postexec)=@_;      my ($r,$postexec)=@_;
       if (!&is_hash_old()) { return; }
     $r->print(      $r->print(
 '<script>function reinit(tf) { tf.submit();'.$postexec.' }</script>'.   '<script>function reinit(tf) { tf.submit();'.$postexec.' }</script>'. 
 '<form method="post" action="/adm/roles" target="loncapaclient">'.  '<form method="post" action="/adm/roles" target="loncapaclient">'.
Line 1224  ENDNEWSCRIPT Line 1262  ENDNEWSCRIPT
   $r->print('</head>'.    $r->print('</head>'.
             &Apache::loncommon::bodytag('Course Documents','',$events,              &Apache::loncommon::bodytag('Course Documents','',$events,
  '','',$showdoc).   '','',$showdoc).
     &Apache::loncommon::help_open_faq(273).      &Apache::loncommon::help_open_menu('','','','',273,'RAT'));
     &Apache::loncommon::help_open_bug('RAT'));  
   unless ($showdoc) {    unless ($showdoc) {
 # -----------------------------------------------------------------------------  # -----------------------------------------------------------------------------
        my %lt=&Apache::lonlocal::texthash(         my %lt=&Apache::lonlocal::texthash(
Line 1312  ENDCOURSEVERIFY Line 1349  ENDCOURSEVERIFY
        $hadchanges=0;         $hadchanges=0;
        &editor($r,$coursenum,$coursedom,$folder,$allowed);         &editor($r,$coursenum,$coursedom,$folder,$allowed);
        if ($hadchanges) {         if ($hadchanges) {
    &changewarning($r,$postexec);     &mark_hash_old()
        }         }
          &changewarning($r,$postexec);
        my $folderseq='/uploaded/'.$coursedom.'/'.$coursenum.'/default_'.time.         my $folderseq='/uploaded/'.$coursedom.'/'.$coursenum.'/default_'.time.
                      '.sequence';                       '.sequence';
        $r->print(<<ENDFORM);         $r->print(<<ENDFORM);
Line 1539  ENDSUPFORM Line 1577  ENDSUPFORM
     $r->print('</table>');      $r->print('</table>');
   } else {    } else {
 # -------------------------------------------------------- This is showdoc mode  # -------------------------------------------------------- This is showdoc mode
       $r->print("<h1>".&mt('Uploaded Document').'</h1><p>'.        $r->print("<h1>".&mt('Uploaded Document').' - '.
    &Apache::lonnet::gettitle($r->uri).'</h1><p>'.
 &mt('It is recommended that you use an up-to-date virus scanner before handling this file.')."</p><p><table>".  &mt('It is recommended that you use an up-to-date virus scanner before handling this file.')."</p><p><table>".
          &entryline(0,&mt("Click to download or use your browser's Save Link function"),$showdoc).'</table></p>');           &entryline(0,&mt("Click to download or use your browser's Save Link function"),$showdoc).'</table></p>');
   }    }

Removed from v.1.133  
changed lines
  Added in v.1.137.2.2


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