Diff for /loncom/interface/lonmeta.pm between versions 1.22 and 1.23

version 1.22, 2002/10/18 13:49:49 version 1.23, 2002/10/20 18:40:00
Line 37  use strict; Line 37  use strict;
 use Apache::Constants qw(:common);  use Apache::Constants qw(:common);
 use Apache::lonnet();  use Apache::lonnet();
 use Apache::loncommon();  use Apache::loncommon();
   use Apache::lonmsg;
   use Apache::lonpublisher;
   
 # ----------------------------------------- Fetch and evaluate dynamic metadata  # ----------------------------------------- Fetch and evaluate dynamic metadata
   
Line 149  sub handler { Line 151  sub handler {
   
     my $uri=$r->uri;      my $uri=$r->uri;
   
     unless ($uri=~/^\/\~/) { 
   # =========================================== This is not in construction space
     my ($resdomain,$resuser)=      my ($resdomain,$resuser)=
            (&Apache::lonnet::declutter($uri)=~/^(\w+)\/(\w+)\//);             (&Apache::lonnet::declutter($uri)=~/^(\w+)\/(\w+)\//);
   
Line 179  sub handler { Line 183  sub handler {
   }    }
   
 # --------------------------------------------------------------- Render Output  # --------------------------------------------------------------- Render Output
   my ($thisversion)=($uri=~/\.(\d+)\.(\w+)\.meta/);    my ($thisversion)=($uri=~/\.(\d+)\.(\w+)\.meta$/);
 my $creationdate=localtime(  my $creationdate=localtime(
  &Apache::loncommon::unsqltime($content{'creationdate'}));   &Apache::loncommon::unsqltime($content{'creationdate'}));
 my $lastrevisiondate=localtime(  my $lastrevisiondate=localtime(
Line 294  $dynmeta{$_}."&nbsp;</td></tr>\n"); Line 298  $dynmeta{$_}."&nbsp;</td></tr>\n");
        || ($ENV{'user.role.ca./'.$1.'/'.$2})) {         || ($ENV{'user.role.ca./'.$1.'/'.$2})) {
       $r->print(        $r->print(
   '<h4>Evaluation Comments (visible to author and co-authors only)</h4>'.    '<h4>Evaluation Comments (visible to author and co-authors only)</h4>'.
       '<blockquote>'.$dynmeta{'comments'}.'</blockquote>');              '<blockquote>'.$dynmeta{'comments'}.'</blockquote>');
         $r->print(
      '<h4>Error Messages (visible to author and co-authors only)</h4>');
         my %errormsgs=&Apache::lonnet::dump('nohist_res_msgs',$1,$2);
         foreach (keys %errormsgs) {
    if ($_=~/^$disuri\_\d+$/) {
             my %content=&Apache::lonmsg::unpackagemsg($errormsgs{$_});
     $r->print('<b>'.$content{'time'}.'</b>: '.$content{'message'}.
                       '<br />');
           }
         }      
    }     }
 # ------------------------------------------------------------- All other stuff  # ------------------------------------------------------------- All other stuff
    $r->print(     $r->print(
Line 317  $dynmeta{$_}."&nbsp;</td></tr>\n"); Line 331  $dynmeta{$_}."&nbsp;</td></tr>\n");
       $r->print("<br>\n");        $r->print("<br>\n");
    }     }
   }    }
   $r->print('</body></html>');  # ===================================================== End Resource Space Call
   return OK;   } else {
   # ===================================================== Construction Space Call
   
   # ----------------------------------------------------------- Set document type
   
     $r->content_type('text/html');
     $r->send_http_header;
   
     return OK if $r->header_only;
   # ---------------------------------------------------------------------- Header
     my $bodytag=&Apache::loncommon::bodytag('Edit Catalog Information');
     my $disuri=$uri;
     my $fn=&Apache::lonnet::filelocation('',$uri);
     $disuri=~s/^\/\~\w+//;
     $disuri=~s/\.meta$//;
     my $displayfile='Catalog Information for '.$disuri;
     if ($disuri=~/\/default$/) {
         my $dir=$disuri;
         $dir=~s/default$//;
         $displayfile='Default Cataloging Information for Directory '.$dir;
     }
     %Apache::lonpublisher::metadatafields=();
     %Apache::lonpublisher::metadatakeys=();
     &Apache::lonpublisher::metaeval(&Apache::lonnet::getfile($fn));
     $r->print(<<ENDEDIT);
   <html><head><title>Edit Catalog Information</title></head>
   $bodytag
   <h1>$displayfile</h1>
   ENDEDIT
      foreach (keys %Apache::lonpublisher::metadatafields) {
          $r->print('<br />'.$_.' '.$Apache::lonpublisher::metadatafields{$_});
      }
    }
    $r->print('</body></html>');
    return OK;
 }  }
   
 1;  1;

Removed from v.1.22  
changed lines
  Added in v.1.23


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