Diff for /loncom/publisher/lonpublisher.pm between versions 1.155 and 1.159

version 1.155, 2003/12/27 16:58:36 version 1.159, 2003/12/31 03:02:49
Line 126  use Apache::loncommon(); Line 126  use Apache::loncommon();
 use Apache::lonmysql;  use Apache::lonmysql;
 use Apache::lonlocal;  use Apache::lonlocal;
 use Apache::loncfile;  use Apache::loncfile;
   use Apache::lonmeta;
   use Apache::lonmsg;
 use vars qw(%metadatafields %metadatakeys);  use vars qw(%metadatafields %metadatakeys);
   
 my %addid;  my %addid;
Line 316  sub textfield { Line 318  sub textfield {
     $value=~s/\s+$//gs;      $value=~s/\s+$//gs;
     $value=~s/\s+/ /gs;      $value=~s/\s+/ /gs;
     $title=&mt($title);      $title=&mt($title);
     my $uctitle=uc($title);      return "\n<p><font color=\"#800000\" face=\"helvetica\"><b>$title:".
     return "\n<p><font color=\"#800000\" face=\"helvetica\"><b>$uctitle:".  
            "</b></font></p><br />".             "</b></font></p><br />".
            '<input type="text" name="'.$name.'" size=80 value="'.$value.'" />';             '<input type="text" name="'.$name.'" size=80 value="'.$value.'" />';
 }  }
Line 330  sub hiddenfield { Line 331  sub hiddenfield {
 sub selectbox {  sub selectbox {
     my ($title,$name,$value,$functionref,@idlist)=@_;      my ($title,$name,$value,$functionref,@idlist)=@_;
     $title=&mt($title);      $title=&mt($title);
     my $uctitle=uc($title);  
     $value=(split(/\s*,\s*/,$value))[-1];      $value=(split(/\s*,\s*/,$value))[-1];
     my $selout="\n<p><font color=\"#800000\" face=\"helvetica\"><b>$uctitle:".      my $selout="\n<p><font color=\"#800000\" face=\"helvetica\"><b>$title:".
  '</b></font></p><br /><select name="'.$name.'">';   '</b></font></p><br /><select name="'.$name.'">';
     foreach (@idlist) {      foreach (@idlist) {
         $selout.='<option value=\''.$_.'\'';          $selout.='<option value=\''.$_.'\'';
Line 799  sub store_metadata { Line 799  sub store_metadata {
  $metadata{'sequsage'}=$metadata{'usage'};   $metadata{'sequsage'}=$metadata{'usage'};
  $metadata{'sequsage_list'}=$metadata{'usage_list'};   $metadata{'sequsage_list'}=$metadata{'usage_list'};
  my %newmetadata=();   my %newmetadata=();
 # retrieve current database column names  
  my @columns=&Apache::lonmysql::col_order('metadata');  
 # see if we have old entries  # see if we have old entries
  my @oldmeta=&Apache::lonmysql::get_rows('metadata',   my @oldmeta=&Apache::lonmysql::get_rows('metadata',
  "url LIKE BINARY '".   "url LIKE BINARY '".
  $metadata{'url'}."'");   $metadata{'url'}."'");
  if ($#oldmeta==0) {   if ($#oldmeta==0) {
 # there is an old value  # yes, there is one old entry, transfer to newmetadata
     for (my $i=0; $i<=$#columns; $i++) {      %newmetadata=&Apache::lonmeta::metadata_col_to_hash(@{$oldmeta[0]});
  $newmetadata{$columns[$i]}=$oldmeta[0]->[$i];  
     }  
 # remove old entry  # remove old entry
     $status=&Apache::lonmysql::remove_from_table      $status=&Apache::lonmysql::remove_from_table
  ('metadata','url',$metadata{'url'});   ('metadata','url',$metadata{'url'});
Line 1021  sub publish { Line 1017  sub publish {
         }          }
   
     } else {      } else {
   # ------------------------------------------ See if anything new in file itself
    
    $allmeta=&parseformeta($source,$style);
 # ---------------------- Read previous metafile, remember parameters and stores  # ---------------------- Read previous metafile, remember parameters and stores
   
         $scrout.=&metaread($logfile,$source.'.meta');          $scrout.=&metaread($logfile,$source.'.meta');
Line 1031  sub publish { Line 1030  sub publish {
  delete $metadatafields{$_};   delete $metadatafields{$_};
             }              }
         }          }
 # ------------------------------------------ See if anything new in file itself  
    
  $allmeta=&parseformeta($source,$style);  
    }     }
   
                 
Line 1115  sub publish { Line 1111  sub publish {
 # --------------------------------------------------- Scan content for keywords  # --------------------------------------------------- Scan content for keywords
   
         my $keywords_help = Apache::loncommon::help_open_topic("Publishing_Keywords");          my $keywords_help = Apache::loncommon::help_open_topic("Publishing_Keywords");
         my $KEYWORDS=&mt('KEYWORDS');          my $KEYWORDS=&mt('Keywords');
  my $CheckAll=&mt('check all');   my $CheckAll=&mt('check all');
  my $UncheckAll=&mt('uncheck all');   my $UncheckAll=&mt('uncheck all');
  my $keywordout=<<"END";   my $keywordout=<<"END";
Line 1166  END Line 1162  END
  $scrout.=&textfield('Notes','notes',$metadatafields{'notes'});   $scrout.=&textfield('Notes','notes',$metadatafields{'notes'});
   
  $scrout.=   $scrout.=
     "\n<p><font color=\"#800000\" face=\"helvetica\"><b>".&mt('ABSTRACT').":".      "\n<p><font color=\"#800000\" face=\"helvetica\"><b>".&mt('Abstract').":".
     "</b></font></p><br />".      "</b></font></p><br />".
     '<textarea cols="80" rows="5" name="abstract">'.      '<textarea cols="80" rows="5" name="abstract">'.
     $metadatafields{'abstract'}.'</textarea></p>';      $metadatafields{'abstract'}.'</textarea></p>';
Line 1176  END Line 1172  END
   
  $scrout.=   $scrout.=
     "\n<p><font color=\"#800000\" face=\"helvetica\"><b>".      "\n<p><font color=\"#800000\" face=\"helvetica\"><b>".
     uc(&mt('Lowest Grade Level:')).      &mt('Lowest Grade Level').':'.
            "</b></font></p><br />".             "</b></font></p><br />".
    &Apache::loncommon::select_level_form($metadatafields{'lowestgradelevel'},'lowestgradelevel').     &Apache::loncommon::select_level_form($metadatafields{'lowestgradelevel'},'lowestgradelevel').
     "\n<p><font color=\"#800000\" face=\"helvetica\"><b>".      "\n<p><font color=\"#800000\" face=\"helvetica\"><b>".
     uc(&mt('Highest Grade Level:')).      &mt('Highest Grade Level').':'.
            "</b></font></p><br />".             "</b></font></p><br />".
    &Apache::loncommon::select_level_form($metadatafields{'highestgradelevel'},'highestgradelevel').     &Apache::loncommon::select_level_form($metadatafields{'highestgradelevel'},'highestgradelevel').
            &textfield('Standards','standards',$metadatafields{'standards'});             &textfield('Standards','standards',$metadatafields{'standards'});
Line 1239  END Line 1235  END
     $scrout.=&textfield('Custom Distribution File','customdistributionfile',      $scrout.=&textfield('Custom Distribution File','customdistributionfile',
  $metadatafields{'customdistributionfile'}).   $metadatafields{'customdistributionfile'}).
     $copyright_help;      $copyright_help;
     my $uctitle=uc(&mt('Obsolete'));      my $uctitle=&mt('Obsolete');
             $scrout.=              $scrout.=
  "\n<p><font color=\"#800000\" face=\"helvetica\"><b>$uctitle:".   "\n<p><font color=\"#800000\" face=\"helvetica\"><b>$uctitle:".
  '</b></font> <input type="checkbox" name="obsolete" ';   '</b></font> <input type="checkbox" name="obsolete" ';
Line 1439  sub phasetwo { Line 1435  sub phasetwo {
  $r->print($error);   $r->print($error);
  print $logfile "\n".$error;   print $logfile "\n".$error;
     }      }
   # --------------------------------------------- Delete author resource messages
       my $delresult=&Apache::lonmsg::del_url_author_res_msg($target); 
       $r->print('<p>'.&mt('Removing error messages:').' '.$delresult.'</p>');
       print $logfile "\nRemoving error messages: $delresult";
 # ----------------------------------------------------------- Copy old versions  # ----------------------------------------------------------- Copy old versions
         
     if (-e $target) {      if (-e $target) {
Line 1652  sub publishdirectory { Line 1651  sub publishdirectory {
     my $resdir=      my $resdir=
  $Apache::lonnet::perlvar{'lonDocRoot'}.'/res/'.$cudom.'/'.$cuname.'/'.   $Apache::lonnet::perlvar{'lonDocRoot'}.'/res/'.$cudom.'/'.$cuname.'/'.
  $thisdisfn;   $thisdisfn;
     $r->print('<h1>Directory <tt>'.$thisdisfn.'</tt></h1>'.      $r->print('<h1>'.&mt('Directory').' <tt>'.$thisdisfn.'</tt></h1>'.
       'Target: <tt>'.$resdir.'</tt><br />');        &mt('Target').': <tt>'.$resdir.'</tt><br />');
   
     my $dirptr=16384; # Mask indicating a directory in stat.cmode.      my $dirptr=16384; # Mask indicating a directory in stat.cmode.
   
Line 1691  sub publishdirectory { Line 1690  sub publishdirectory {
     if ($publishthis) {      if ($publishthis) {
                 &batchpublish($r,$fn.'/'.$filename,$resdir.'/'.$filename);                  &batchpublish($r,$fn.'/'.$filename,$resdir.'/'.$filename);
     } else {      } else {
  $r->print('<br />Skipping '.$filename.'<br />');   $r->print('<br />'.&mt('Skipping').' '.$filename.'<br />');
     }      }
     $r->rflush();      $r->rflush();
  }   }
Line 1755  sub handler { Line 1754  sub handler {
 # -------------------------------------------------------------- Check filename  # -------------------------------------------------------------- Check filename
   
     my $fn=&Apache::lonnet::unescape($ENV{'form.filename'});      my $fn=&Apache::lonnet::unescape($ENV{'form.filename'});
       $fn=~s/\.meta$//;
       
     unless ($fn) {       unless ($fn) { 
  $r->log_reason($cuname.' at '.$cudom.   $r->log_reason($cuname.' at '.$cudom.

Removed from v.1.155  
changed lines
  Added in v.1.159


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>
500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.