Diff for /loncom/interface/londocs.pm between versions 1.168 and 1.172

version 1.168, 2005/02/21 00:32:45 version 1.172, 2005/03/16 21:35:17
Line 1093  sub editor { Line 1093  sub editor {
                           $Apache::lonratedt::order[$i+1];                            $Apache::lonratedt::order[$i+1];
                     }                      }
                     $#Apache::lonratedt::order--;                      $#Apache::lonratedt::order--;
                   } elsif ($cmd eq 'cut') {
       my (undef,$url)=split(':',$Apache::lonratedt::resources[$Apache::lonratedt::order[$idx]]);
       for (my $i=$idx;$i<$#Apache::lonratedt::order;$i++) {
                           $Apache::lonratedt::order[$i]=
                             $Apache::lonratedt::order[$i+1];
                       }
                       $#Apache::lonratedt::order--;
                 } elsif ($cmd eq 'up') {                  } elsif ($cmd eq 'up') {
   if (($idx) && (defined($Apache::lonratedt::order[$idx-1]))) {    if (($idx) && (defined($Apache::lonratedt::order[$idx-1]))) {
                     my $i=$Apache::lonratedt::order[$idx-1];                      my $i=$Apache::lonratedt::order[$idx-1];
Line 1280  sub entryline { Line 1287  sub entryline {
                 'up' => 'Move Up',                  'up' => 'Move Up',
  'dw' => 'Move Down',   'dw' => 'Move Down',
  'rm' => 'Remove',   'rm' => 'Remove',
                   'ct' => 'Cut',
  'rn' => 'Rename',   'rn' => 'Rename',
  'cp' => 'Copy');   'cp' => 'Copy');
         if ($ENV{'form.pagepath'}) {          if ($ENV{'form.pagepath'}) {
Line 1302  sub entryline { Line 1310  sub entryline {
 </td><td bgcolor="#DDDDDD">  </td><td bgcolor="#DDDDDD">
 <a href='javascript:removeres("$pagepath","$index","$renametitle","page","$pagesymb");'>  <a href='javascript:removeres("$pagepath","$index","$renametitle","page","$pagesymb");'>
 <font size="-2" color="#990000">$lt{'rm'}</font></a>  <font size="-2" color="#990000">$lt{'rm'}</font></a>
   <a href='javascript:cutres("$pagepath","$index","$renametitle","page","$pagesymb");'>
   <font size="-2" color="#550044">$lt{'ct'}</font></a>
 <a href='javascript:changename("$pagepath","$index","$renametitle","page","$pagesymb");'>  <a href='javascript:changename("$pagepath","$index","$renametitle","page","$pagesymb");'>
 <font size="-2" color="#009900">$lt{'rn'}</font></a>  <font size="-2" color="#009900">$lt{'rn'}</font></a>
 <a href='javascript:markcopy("$pagepath","$index","$renametitle","page","$pagesymb");'>  <a href='javascript:markcopy("$pagepath","$index","$renametitle","page","$pagesymb");'>
Line 1326  END Line 1336  END
 </td><td bgcolor="#DDDDDD">  </td><td bgcolor="#DDDDDD">
 <a href='javascript:removeres("$folderpath","$index","$renametitle","sequence");'>  <a href='javascript:removeres("$folderpath","$index","$renametitle","sequence");'>
 <font size="-2" color="#990000">$lt{'rm'}</font></a>  <font size="-2" color="#990000">$lt{'rm'}</font></a>
   <a href='javascript:cutres("$folderpath","$index","$renametitle","sequence");'>
   <font size="-2" color="#550044">$lt{'ct'}</font></a>
 <a href='javascript:changename("$folderpath","$index","$renametitle","sequence");'>  <a href='javascript:changename("$folderpath","$index","$renametitle","sequence");'>
 <font size="-2" color="#009900">$lt{'rn'}</font></a>  <font size="-2" color="#009900">$lt{'rn'}</font></a>
 <a href='javascript:markcopy("$folderpath","$index","$renametitle","sequence");'>  <a href='javascript:markcopy("$folderpath","$index","$renametitle","sequence");'>
Line 1489  sub checkonthis { Line 1501  sub checkonthis {
        if ($url=~/^\/res\//) {         if ($url=~/^\/res\//) {
   my $result=&Apache::lonnet::repcopy(    my $result=&Apache::lonnet::repcopy(
                               &Apache::lonnet::filelocation('',$url));                                &Apache::lonnet::filelocation('',$url));
           if ($result==OK) {            if ($result eq 'ok') {
              $r->print('<font color="green">'.&mt('ok').'</font>');               $r->print('<font color="green">'.&mt('ok').'</font>');
              $r->rflush();               $r->rflush();
              &Apache::lonnet::countacc($url);               &Apache::lonnet::countacc($url);
Line 1501  sub checkonthis { Line 1513  sub checkonthis {
                      $r->print('&nbsp;');                       $r->print('&nbsp;');
                  }                   }
                  $r->print('- '.&mt('Rendering').': ');                   $r->print('- '.&mt('Rendering').': ');
                  my $oldpath=$ENV{'request.filename'};   my ($errorcount,$warningcount)=split(/:/,
                  $ENV{'request.filename'}=&Apache::lonnet::filelocation('',$url);         &Apache::lonnet::ssi_body($url,
                  &Apache::lonxml::xmlparse($r,'web',         ('return_only_error_and_warning_counts' => 1)));
                    &Apache::lonnet::getfile(                   if (($errorcount) ||
                     &Apache::lonnet::filelocation('',$url)));                       ($warningcount)) {
  undef($Apache::lonhomework::parsing_a_problem);       if ($errorcount) {
  $ENV{'request.filename'}=$oldpath;  
                  if (($Apache::lonxml::errorcount) ||  
                      ($Apache::lonxml::warningcount)) {  
      if ($Apache::lonxml::errorcount) {  
                         $r->print('<img src="/adm/lonMisc/bomb.gif" /><font color="red"><b>'.                          $r->print('<img src="/adm/lonMisc/bomb.gif" /><font color="red"><b>'.
   $Apache::lonxml::errorcount.' '.    $errorcount.' '.
   &mt('error(s)').'</b></font> ');    &mt('error(s)').'</b></font> ');
                      }                       }
      if ($Apache::lonxml::warningcount) {       if ($warningcount) {
                         $r->print('<font color="blue">'.                          $r->print('<font color="blue">'.
   $Apache::lonxml::warningcount.' '.    $warningcount.' '.
   &mt('warning(s)').'</font>');    &mt('warning(s)').'</font>');
                      }                       }
                  } else {                   } else {
Line 1532  sub checkonthis { Line 1540  sub checkonthis {
                     &checkonthis($r,$_,$level+1);                      &checkonthis($r,$_,$level+1);
                  }                   }
              }               }
           } elsif ($result==HTTP_SERVICE_UNAVAILABLE) {            } elsif ($result eq 'unavailable') {
              $r->print('<font color="red"><b>'.&mt('connection down').'</b></font>');               $r->print('<font color="red"><b>'.&mt('connection down').'</b></font>');
           } elsif ($result==HTTP_NOT_FOUND) {            } elsif ($result eq 'not_found') {
       unless ($url=~/\$/) {        unless ($url=~/\$/) {
   $r->print('<font color="red"><b>'.&mt('not found').'</b></font>');    $r->print('<font color="red"><b>'.&mt('not found').'</b></font>');
       } else {        } else {
Line 2098  function changename(folderpath,index,old Line 2106  function changename(folderpath,index,old
 }  }
   
 function removeres(folderpath,index,oldtitle,container,pagesymb) {  function removeres(folderpath,index,oldtitle,container,pagesymb) {
     if (confirm('Remove "'+oldtitle+'"?')) {      if (confirm('WARNING: Removing a resource makes associated grades and scores inaccessible!\\nRemove "'+oldtitle+'"?')) {
  this.document.forms.renameform.cmd.value='del_'+index;   this.document.forms.renameform.cmd.value='del_'+index;
         if (container == 'sequence') {          if (container == 'sequence') {
             this.document.forms.renameform.folderpath.value=folderpath;              this.document.forms.renameform.folderpath.value=folderpath;
         }          }
           if (container == 'page') {
               this.document.forms.renameform.pagepath.value=folderpath;
               this.document.forms.renameform.pagesymb.value=pagesymb;
           }
           this.document.forms.renameform.submit();
       }
   }
   
   function cutres(folderpath,index,oldtitle,container,pagesymb) {
       if (confirm('WARNING: Cutting a resource makes associated grades and scores inaccessible,\\neven if it is pasted in again elsewhere!\\nCut "'+oldtitle+'"?')) {
    this.document.forms.renameform.cmd.value='cut_'+index;
    this.document.forms.renameform.markcopy.value=index;
           if (container == 'sequence') {
               this.document.forms.renameform.folderpath.value=folderpath;
           }
         if (container == 'page') {          if (container == 'page') {
             this.document.forms.renameform.pagepath.value=folderpath;              this.document.forms.renameform.pagepath.value=folderpath;
             this.document.forms.renameform.pagesymb.value=pagesymb;              this.document.forms.renameform.pagesymb.value=pagesymb;

Removed from v.1.168  
changed lines
  Added in v.1.172


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