Diff for /loncom/interface/londocs.pm between versions 1.35 and 1.38

version 1.35, 2002/10/21 20:31:06 version 1.38, 2002/12/04 14:02:49
Line 35  use Apache::loncommon; Line 35  use Apache::loncommon;
 use Apache::lonratedt;  use Apache::lonratedt;
 use Apache::lonratsrv;  use Apache::lonratsrv;
 use Apache::lonxml;  use Apache::lonxml;
   use HTML::Entities;
 use GDBM_File;  use GDBM_File;
   
 my $iconpath;  my $iconpath;
Line 118  sub editor { Line 119  sub editor {
                     }                      }
                     $#Apache::lonratedt::order--;                      $#Apache::lonratedt::order--;
                 } elsif ($cmd eq 'up') {                  } elsif ($cmd eq 'up') {
     if (($idx) && (defined($Apache::lonratedt::order[$idx-1]))) {
                     my $i=$Apache::lonratedt::order[$idx-1];                      my $i=$Apache::lonratedt::order[$idx-1];
                     $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 'down') {                  } elsif ($cmd eq 'down') {
      if (defined($Apache::lonratedt::order[$idx+1])) {
                     my $i=$Apache::lonratedt::order[$idx+1];                      my $i=$Apache::lonratedt::order[$idx+1];
                     $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=
                        &HTML::Entities::decode($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 179  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 173  sub editor { Line 191  sub editor {
   
 sub entryline {  sub entryline {
     my ($index,$title,$url,$folder,$allowed)=@_;      my ($index,$title,$url,$folder,$allowed)=@_;
       $title=~s/\&colon\;/\:/g;
       $title=&HTML::Entities::encode(&HTML::Entities::decode(
        &Apache::lonnet::unescape($title)),'\"\<\>\&\'');
       my $renametitle=$title;
       my $foldertitle=$title;
       if ($title=~
    /^(\d+)\_\_\_\&amp\;\&amp\;\&amp\;\_\_\_(\w+)\_\_\_\&amp\;\&amp\;\&amp\;\_\_\_(\w+)\_\_\_\&amp\;\&amp\;\&amp\;\_\_\_(.*)$/
    ) { 
               $foldertitle=&Apache::lontexconvert::msgtexconverted($4);
               $renametitle=$4;
               $title='<i>'.localtime($1).'</i> '.
                   &Apache::loncommon::plainname($2,$3).': <br>'.
    $foldertitle;
    }
       $renametitle=~s/\&quot\;/\\\"/g;
     my $line='<tr>';      my $line='<tr>';
 # Edit commands  # Edit commands
     if ($allowed) {      if ($allowed) {
Line 183  sub entryline { Line 216  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","$renametitle");'>
   <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 205  END Line 241  END
        }          } 
     }      }
     $url=~s/^http\&colon\;\/\//\/adm\/wrapper\/ext\//;      $url=~s/^http\&colon\;\/\//\/adm\/wrapper\/ext\//;
 # Title  
     $title=&Apache::lonnet::unescape($title);  
     my $foldertitle=$title;  
     if ($title=~  
  /^(\d+)\_\_\_\&\&\&\_\_\_(\w+)\_\_\_\&\&\&\_\_\_(\w+)\_\_\_\&\&\&\_\_\_(.*)$/  
  ) {   
             $foldertitle=&Apache::lontexconvert::msgtexconverted($4);  
             $title='<i>'.localtime($1).'</i> '.  
                 &Apache::loncommon::plainname($2,$3).': <br>'.  
  $foldertitle;  
  }  
     if ($isfolder) { $url.='&foldername='.$foldertitle; }      if ($isfolder) { $url.='&foldername='.$foldertitle; }
     $line.='<td bgcolor="#FFFFBB"><a href="'.$url.'" target="cat_'.$folder.      $line.='<td bgcolor="#FFFFBB"><a href="'.$url.'" target="cat_'.$folder.
 '"><img src="/adm/lonIcons/'.  '"><img src="/adm/lonIcons/'.
Line 496  function makenewext(targetname) { Line 521  function makenewext(targetname) {
 }  }
   
 function makesmppage() {  function makesmppage() {
     var title=prompt('Listed Title for the Page');     var title=prompt('Listed Title for the Page');
      if (title) { 
     this.document.forms.newsmppg.importdetail.value=      this.document.forms.newsmppg.importdetail.value=
  title+'=/adm/$udom/$uname/$now/smppg';   title+'=/adm/$udom/$uname/$now/smppg';
     this.document.forms.newsmppg.submit();      this.document.forms.newsmppg.submit();
      }
 }  }
   
 function makebulboard() {  function makebulboard() {
     var title=prompt('Listed Title for the Bulletin Board');     var title=prompt('Listed Title for the Bulletin Board');
      if (title) {
     this.document.forms.newbul.importdetail.value=      this.document.forms.newbul.importdetail.value=
  title+'=/adm/$udom/$uname/$now/bulletinboard';   title+'=/adm/$udom/$uname/$now/bulletinboard';
     this.document.forms.newbul.submit();      this.document.forms.newbul.submit();
      }
 }  }
   
 function finishpick() {  function finishpick() {
Line 517  function finishpick() { Line 546  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.35  
changed lines
  Added in v.1.38


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