Diff for /loncom/interface/londocs.pm between versions 1.34 and 1.37

version 1.34, 2002/10/20 18:42:53 version 1.37, 2002/11/18 15:21:31
Line 127  sub editor { Line 127  sub editor {
                     $Apache::lonratedt::order[$idx+1]=                      $Apache::lonratedt::order[$idx+1]=
  $Apache::lonratedt::order[$idx];   $Apache::lonratedt::order[$idx];
                     $Apache::lonratedt::order[$idx]=$i;                      $Apache::lonratedt::order[$idx]=$i;
                   } elsif ($cmd eq 'rename') {
                       my ($rtitle,@rrest)=split(/\:/,
                          $Apache::lonratedt::resources[
          $Apache::lonratedt::order[$idx]]);
                       my $comment=$ENV{'form.title'};
                       $comment=~s/\</\&lt\;/g;
                       $comment=~s/\>/\&gt\;/g;
                       $comment=~s/\:/\&colon;/g;
                       $Apache::lonratedt::resources[
          $Apache::lonratedt::order[$idx]]=
                                $comment.':'.join(':',@rrest);
                       
                 }                  }
 # Store the changed version  # Store the changed version
  &storemap($coursenum,$coursedom,$folder.'.sequence');   &storemap($coursenum,$coursedom,$folder.'.sequence');
Line 161  sub editor { Line 173  sub editor {
         foreach (@Apache::lonratedt::order) {          foreach (@Apache::lonratedt::order) {
            my ($name,$url)=split(/\:/,$Apache::lonratedt::resources[$_]);             my ($name,$url)=split(/\:/,$Apache::lonratedt::resources[$_]);
            unless ($name) {  $name=(split(/\//,$url))[-1]; }             unless ($name) {  $name=(split(/\//,$url))[-1]; }
            unless ($name) { $name='EMPTY'; }             unless ($name) { $name='NO RESOURCE'; $url='/adm/notfound.html'; }
            $r->print(&entryline($idx,$name,$url,$folder,$allowed));             $r->print(&entryline($idx,$name,$url,$folder,$allowed));
            $idx++;             $idx++;
         }          }
Line 183  sub entryline { Line 195  sub entryline {
 <tr><td><a href='/adm/coursedocs?folder=$folder&cmd=down_$index'>  <tr><td><a href='/adm/coursedocs?folder=$folder&cmd=down_$index'>
 <img src="${iconpath}move_down.gif" alt='DOWN' border='0' /></a></td></tr>  <img src="${iconpath}move_down.gif" alt='DOWN' border='0' /></a></td></tr>
 </table></td><td>  </table></td><td>
 <a href='/adm/coursedocs?folder=$folder&cmd=del_$index'>Remove</td>  <a href='/adm/coursedocs?folder=$folder&cmd=del_$index'>
   <font size="-2">Remove</font></a>
   <a href='javascript:changename("$folder","$index","$title");'>
   <font size="-2">Rename</font></a></td>
 END  END
     }      }
 # Figure out what kind of a resource this is  # Figure out what kind of a resource this is
Line 265  sub checkonthis { Line 280  sub checkonthis {
              if (&Apache::loncommon::fileembstyle($1) eq 'ssi') {               if (&Apache::loncommon::fileembstyle($1) eq 'ssi') {
  $r->print('<br />');   $r->print('<br />');
                  $r->rflush();                   $r->rflush();
                  my $default='';  
                  if ($1=~/(problem|exam|quiz|assess|survey|form|library)/) {  
                     $default=&Apache::lonnet::getfile(  
                     '/home/httpd/html/res/adm/includes/default_homework.lcpm');  
                  }  
                  for (my $i=0;$i<=$level*5;$i++) {                   for (my $i=0;$i<=$level*5;$i++) {
                      $r->print('&nbsp;');                       $r->print('&nbsp;');
                  }                   }
                  $r->print('- Rendering: ');                   $r->print('- Rendering: ');
                  &Apache::lonxml::xmlparse($r,'web',                   &Apache::lonxml::xmlparse($r,'web',
                    &Apache::lonnet::getfile(                     &Apache::lonnet::getfile(
                     &Apache::lonnet::filelocation('',$url)),$default);                      &Apache::lonnet::filelocation('',$url)));
                  if (($Apache::lonxml::errorcount) ||                   if (($Apache::lonxml::errorcount) ||
                      ($Apache::lonxml::warningcount)) {                       ($Apache::lonxml::warningcount)) {
      if ($Apache::lonxml::errorcount) {       if ($Apache::lonxml::errorcount) {
Line 522  function finishpick() { Line 532  function finishpick() {
      ('this.document.forms.'+form+'.importdetail.value="'+title+'='+url+       ('this.document.forms.'+form+'.importdetail.value="'+title+'='+url+
     '";this.document.forms.'+form+'.submit();');      '";this.document.forms.'+form+'.submit();');
 }  }
   
   function changename(folder,index,oldtitle) {
       var title=prompt('New Title',oldtitle);
       if (title) {
    this.document.forms.renameform.title.value=title;
    this.document.forms.renameform.cmd.value='rename_'+index;
    this.document.forms.renameform.folder.value=folder;
           this.document.forms.renameform.submit();
       }
   }
 </script>  </script>
   <form name="renameform" method="post" action="/adm/coursedocs">
   <input type="hidden" name="title" />
   <input type="hidden" name="cmd" />
   <input type="hidden" name="folder" />
   </form>
 ENDNEWSCRIPT  ENDNEWSCRIPT
   }    }
 # -------------------------------------------------------------------- Body tag  # -------------------------------------------------------------------- Body tag

Removed from v.1.34  
changed lines
  Added in v.1.37


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