Diff for /loncom/interface/londocs.pm between versions 1.95 and 1.100

version 1.95, 2003/11/07 23:22:21 version 1.100, 2004/01/29 00:50:44
Line 425  END Line 425  END
 # Figure out what kind of a resource this is  # Figure out what kind of a resource this is
     my ($extension)=($url=~/\.(\w+)$/);      my ($extension)=($url=~/\.(\w+)$/);
     my $uploaded=($url=~/^\/*uploaded\//);      my $uploaded=($url=~/^\/*uploaded\//);
     my $icon='unknown';      my $icon=&Apache::loncommon::icon($url);
     if (-e "/home/httpd/html/adm/lonIcons/$extension.gif") {  
  $icon=$extension;  
     }  
     my $isfolder=0;      my $isfolder=0;
     if ($uploaded) {      if ($uploaded) {
        if ($extension eq 'sequence') {         if ($extension eq 'sequence') {
   $icon='folder_closed';    $icon=$iconpath.'/folder_closed.gif';
           $url=~/\/(\w+)\.sequence/;            $url=~/\/(\w+)\.sequence/;
           $url='/adm/coursedocs?folder='.$1;            $url='/adm/coursedocs?folder='.$1;
           $isfolder=1;            $isfolder=1;
Line 454  END Line 451  END
     if ($isfolder) { $url.='&foldername='.      if ($isfolder) { $url.='&foldername='.
        &Apache::lonnet::escape($foldertitle); }         &Apache::lonnet::escape($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="'.$icon.'" border="0"></a></td>'.
         $icon.'.gif" border="0"></a></td>'.  
         "<td bgcolor='#FFFFBB'><a href='$url' target='cat_$folder'>$title</a></td></tr>";          "<td bgcolor='#FFFFBB'><a href='$url' target='cat_$folder'>$title</a></td></tr>";
     return $line;      return $line;
 }  }
Line 515  sub checkonthis { Line 511  sub checkonthis {
                  if (($Apache::lonxml::errorcount) ||                   if (($Apache::lonxml::errorcount) ||
                      ($Apache::lonxml::warningcount)) {                       ($Apache::lonxml::warningcount)) {
      if ($Apache::lonxml::errorcount) {       if ($Apache::lonxml::errorcount) {
                         $r->print('<font color="red"><b>'.                          $r->print('<img src="/adm/lonMisc/bomb.gif" /><font color="red"><b>'.
   $Apache::lonxml::errorcount.' '.    $Apache::lonxml::errorcount.' '.
   &mt('error(s)').'</b></font> ');    &mt('error(s)').'</b></font> ');
                      }                       }
Line 539  sub checkonthis { Line 535  sub checkonthis {
           } elsif ($result==HTTP_SERVICE_UNAVAILABLE) {            } elsif ($result==HTTP_SERVICE_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==HTTP_NOT_FOUND) {
              $r->print('<font color="red"><b>'.&mt('not found').'</b></font>');        unless ($url=~/\$/) {
     $r->print('<font color="red"><b>'.&mt('not found').'</b></font>');
         } else {
     $r->print('<font color="yellow"><b>'.&mt('unable to verify variable URL').'</b></font>');
         }
           } else {            } else {
              $r->print('<font color="red"><b>'.&mt('access denied').'</b></font>');               $r->print('<font color="red"><b>'.&mt('access denied').'</b></font>');
           }            }
Line 966  ENDNEWSCRIPT Line 966  ENDNEWSCRIPT
 # -------------------------------------------------------------------- Body tag  # -------------------------------------------------------------------- Body tag
   $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_bug('RAT'));
   unless ($showdoc) {    unless ($showdoc) {
 # -----------------------------------------------------------------------------  # -----------------------------------------------------------------------------
        my %lt=&Apache::lonlocal::texthash(         my %lt=&Apache::lonlocal::texthash(
Line 987  ENDNEWSCRIPT Line 989  ENDNEWSCRIPT
                 'sipr' => 'Simple Problem',                  'sipr' => 'Simple Problem',
                 'scuf' => 'Score Upload Form',                  'scuf' => 'Score Upload Form',
                 'bull' => 'Bulletin Board',                  'bull' => 'Bulletin Board',
                 'mypi' => 'My Personal Info'                  'mypi' => 'My Personal Info',
                   'file' =>  'File',
                   'title' => 'Title',
                   'comment' => 'Comment' 
   );    );
 # -----------------------------------------------------------------------------  # -----------------------------------------------------------------------------
     if ($allowed) {      if ($allowed) {
Line 1017  $dumpbut Line 1022  $dumpbut
 </form>  </form>
 ENDCOURSEVERIFY  ENDCOURSEVERIFY
        $r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc',         $r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc',
      'Editing the Table of Contents for your Course'));       &mt('Editing the Table of Contents for your Course')));
     }      }
 # --------------------------------------------------------- Standard documents  # --------------------------------------------------------- Standard documents
     $r->print('<table border=2 cellspacing=4 cellpadding=4>');      $r->print('<table border=2 cellspacing=4 cellpadding=4>');
Line 1046  ENDCOURSEVERIFY Line 1051  ENDCOURSEVERIFY
 <th bgcolor="#DDDDDD">$lt{'spec'}</th>  <th bgcolor="#DDDDDD">$lt{'spec'}</th>
 </tr>  </tr>
 <tr><td bgcolor="#DDDDDD">  <tr><td bgcolor="#DDDDDD">
 File:<br />  $lt{'file'}:<br />
 <form action="/adm/coursedocs" method="post" enctype="multipart/form-data">  <form action="/adm/coursedocs" method="post" enctype="multipart/form-data">
 <input type="file" name="uploaddoc" size="40">  <input type="file" name="uploaddoc" size="40">
 <br />  <br />
 Title:<br />  $lt{'title'}:<br />
 <input type="text" size="50" name="comment">  <input type="text" size="50" name="comment">
 <input type="hidden" name="folder" value="$folder">  <input type="hidden" name="folder" value="$folder">
 <input type="hidden" name="foldername" value="$ENV{'form.foldername'}">  <input type="hidden" name="foldername" value="$ENV{'form.foldername'}">
Line 1196  ENDFORM Line 1201  ENDFORM
 <tr><td bgcolor="#DDDDDD">  <tr><td bgcolor="#DDDDDD">
 <form action="/adm/coursedocs" method="post" enctype="multipart/form-data">  <form action="/adm/coursedocs" method="post" enctype="multipart/form-data">
 <input type="file" name="uploaddoc" size="40">  <input type="file" name="uploaddoc" size="40">
 <br />Comment:<br />  <br />$lt{'comment'}:<br />
 <textarea cols=50 rows=4 name='comment'>  <textarea cols=50 rows=4 name='comment'>
 </textarea>  </textarea>
 <input type="hidden" name="folder" value="$folder">  <input type="hidden" name="folder" value="$folder">

Removed from v.1.95  
changed lines
  Added in v.1.100


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