Diff for /loncom/publisher/lonpublisher.pm between versions 1.246 and 1.248

version 1.246, 2008/08/19 10:43:59 version 1.248, 2008/08/27 13:08:36
Line 873  sub store_metadata { Line 873  sub store_metadata {
     }      }
     if (defined($status) && $status ne '') {      if (defined($status) && $status ne '') {
         $error='<span class="LC_error">'          $error='<span class="LC_error">'
               .&mt('Error occured saving new values in metadata table in LON-CAPA database!')                .&mt('Error occurred saving new values in metadata table in LON-CAPA database!')
               .'</span>';                .'</span>';
         &Apache::lonnet::logthis($error);          &Apache::lonnet::logthis($error);
         &Apache::lonnet::logthis($status);          &Apache::lonnet::logthis($status);
Line 947  backup copies, performs any automatic pr Line 947  backup copies, performs any automatic pr
 especially for rat and ssi files),  especially for rat and ssi files),
   
 Returns a 2 element array, the first is the string to be shown to the  Returns a 2 element array, the first is the string to be shown to the
 user, the second is an error code, either 1 (an error occured) or 0  user, the second is an error code, either 1 (an error occurred) or 0
 (no error occurred)  (no error occurred)
   
 I<Additional documentation needed.>  I<Additional documentation needed.>
Line 1260  END Line 1260  END
                 .'<input type="button" value="'.&mt('check all').'" onclick="javascript:checkAll(document.pubform.keywords)" />'                  .'<input type="button" value="'.&mt('check all').'" onclick="javascript:checkAll(document.pubform.keywords)" />'
                 .'<input type="button" value="'.&mt('uncheck all').'" onclick="javascript:uncheckAll(document.pubform.keywords)" />'                  .'<input type="button" value="'.&mt('uncheck all').'" onclick="javascript:uncheckAll(document.pubform.keywords)" />'
                 .'</p><br />'                  .'</p><br />'
                 .&Apache::loncommon::start_data_table()                  .&Apache::loncommon::start_data_table();
                 .&Apache::loncommon::start_data_table_row();      my $cols_per_row = 10;
   
     my $colcount=0;      my $colcount=0;
       my $wordcount=0;
       my $numkeywords = scalar(keys(%keywords));
   
     foreach (sort keys %keywords) {      foreach my $word (sort(keys(%keywords))) {
  $colcount++;          if ($colcount == 0) {
  $keywordout.='<td><label><input type="checkbox" name="keywords" value="'.$_.'"';              $keywordout .= &Apache::loncommon::start_data_table_row();
  if ($metadatafields{'keywords'}) {          }
     if ($metadatafields{'keywords'}=~/\Q$_\E/) {          $colcount++;
  $keywordout.=' checked="on"';          $wordcount++;
  $env{'form.keywords'}.=$_.',';          if (($wordcount == $numkeywords) && ($colcount < $cols_per_row)) {
     }              my $colspan = 1+$cols_per_row-$colcount;
  } elsif (&Apache::loncommon::keyword($_)) {              $keywordout .= '<td colspan="'.$colspan.'">';
     $keywordout.=' checked="on"';          } else {
     $env{'form.keywords'}.=$_.',';              $keywordout .= '<td>';
  }          }
  $keywordout.=' />'.$_.'</label></td>';          $keywordout.='<label><input type="checkbox" name="keywords" value="'.$word.'"';
  if ($colcount>=10) {          if ($metadatafields{'keywords'}) {
     $keywordout.=&Apache::loncommon::end_data_table_row()              if ($metadatafields{'keywords'}=~/\Q$word\E/) {
                         .&Apache::loncommon::start_data_table_row();                  $keywordout.=' checked="on"';
     $colcount=0;                  $env{'form.keywords'}.=$word.',';
  }              }
     }          } elsif (&Apache::loncommon::keyword($word)) {
     # Proper end of started table row:              $keywordout.=' checked="on"';
     if ($colcount != 0) { # has still to be improved: if amount of keywords mod 10 == 0, then do not start another table row              $env{'form.keywords'}.=$word.',';
         while ($colcount<10) {          }
             $keywordout.='<td>&nbsp;</td>';          $keywordout.=' />'.$word.'</label></td>';
             $colcount++;          if ($colcount == $cols_per_row) {
               $keywordout.=&Apache::loncommon::end_data_table_row();
               $colcount=0;
         }          }
     }      }
       if ($colcount > 0) {
           $keywordout .= &Apache::loncommon::end_data_table_row();
       }
   
     $env{'form.keywords'}=~s/\,$//;      $env{'form.keywords'}=~s/\,$//;
   

Removed from v.1.246  
changed lines
  Added in v.1.248


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