Diff for /loncom/interface/lonmeta.pm between versions 1.67 and 1.79

version 1.67, 2004/04/14 16:14:29 version 1.79, 2004/06/16 14:30:15
Line 114  sub evalgraph { Line 114  sub evalgraph {
         return '';          return '';
     }      }
     my $val=int($value*10.+0.5)-10;      my $val=int($value*10.+0.5)-10;
     my $output='<table border=0 cellpadding=0 cellspacing=0><tr>';      my $output='<table border="0" cellpadding="0" cellspacing="0"><tr>';
     if ($val>=20) {      if ($val>=20) {
  $output.='<td width=20 bgcolor="#555555">&nbsp&nbsp;</td>';   $output.='<td width="20" bgcolor="#555555">&nbsp&nbsp;</td>';
     } else {      } else {
         $output.='<td width='.($val).' bgcolor="#555555">&nbsp;</td>'.          $output.='<td width="'.($val).'" bgcolor="#555555">&nbsp;</td>'.
                  '<td width='.(20-$val).' bgcolor="#FF3333">&nbsp;</td>';                   '<td width="'.(20-$val).'" bgcolor="#FF3333">&nbsp;</td>';
     }      }
     $output.='<td bgcolor="#FFFF33">&nbsp;</td>';      $output.='<td bgcolor="#FFFF33">&nbsp;</td>';
     if ($val>20) {      if ($val>20) {
  $output.='<td width='.($val-20).' bgcolor="#33FF33">&nbsp;</td>'.   $output.='<td width="'.($val-20).'" bgcolor="#33FF33">&nbsp;</td>'.
                  '<td width='.(40-$val).' bgcolor="#555555">&nbsp;</td>';                   '<td width="'.(40-$val).'" bgcolor="#555555">&nbsp;</td>';
     } else {      } else {
         $output.='<td width=20 bgcolor="#555555">&nbsp&nbsp;</td>';          $output.='<td width="20" bgcolor="#555555">&nbsp&nbsp;</td>';
     }      }
     $output.='<td> ('.$value.') </td></tr></table>';      $output.='<td> ('.sprintf("%5.2f",$value).') </td></tr></table>';
     return $output;      return $output;
 }  }
   
Line 140  sub diffgraph { Line 140  sub diffgraph {
     my $val=int(40.0*$value+0.5);      my $val=int(40.0*$value+0.5);
     my @colors=('#FF9933','#EEAA33','#DDBB33','#CCCC33',      my @colors=('#FF9933','#EEAA33','#DDBB33','#CCCC33',
                 '#BBDD33','#CCCC33','#DDBB33','#EEAA33');                  '#BBDD33','#CCCC33','#DDBB33','#EEAA33');
     my $output='<table border=0 cellpadding=0 cellspacing=0><tr>';      my $output='<table border="0" cellpadding="0" cellspacing="0"><tr>';
     for (my $i=0;$i<8;$i++) {      for (my $i=0;$i<8;$i++) {
  if ($val>$i*5) {   if ($val>$i*5) {
             $output.='<td width=5 bgcolor="'.$colors[$i].'">&nbsp;</td>';              $output.='<td width="5" bgcolor="'.$colors[$i].'">&nbsp;</td>';
         } else {          } else {
     $output.='<td width=5 bgcolor="#555555">&nbsp;</td>';      $output.='<td width="5" bgcolor="#555555">&nbsp;</td>';
  }   }
     }      }
     $output.='<td> ('.$value.') </td></tr></table>';      $output.='<td> ('.sprintf("%3.2f",$value).') </td></tr></table>';
     return $output;      return $output;
 }  }
   
Line 175  sub fieldnames { Line 175  sub fieldnames {
          'owner' => 'Publisher/Owner',           'owner' => 'Publisher/Owner',
          'copyright' => 'Copyright/Distribution',           'copyright' => 'Copyright/Distribution',
          'customdistributionfile' => 'Custom Distribution File',           'customdistributionfile' => 'Custom Distribution File',
            'sourceavail' => 'Source Availible',
            'sourcerights' => 'Source Custom Distribution File',
          'obsolete' => 'Obsolete',           'obsolete' => 'Obsolete',
          'obsoletereplacement' => 'Suggested Replacement for Obsolete File',           'obsoletereplacement' => 'Suggested Replacement for Obsolete File',
          'count'      => 'Network-wide number of accesses (hits)',           'count'      => 'Network-wide number of accesses (hits)',
Line 193  sub fieldnames { Line 195  sub fieldnames {
          'technical'  => 'Resource is technically correct',            'technical'  => 'Resource is technically correct', 
          'avetries'   => 'Average number of tries till solved',           'avetries'   => 'Average number of tries till solved',
          'stdno'      => 'Total number of students who have worked on this problem',           'stdno'      => 'Total number of students who have worked on this problem',
          'difficulty' => 'Degree of difficulty'           'difficulty' => 'Degree of difficulty',
            'disc'       => 'Degree of discrimination',
          );           );
 }  }
   
Line 223  sub prettyprint { Line 226  sub prettyprint {
     if ($type eq 'copyright') {      if ($type eq 'copyright') {
  return &Apache::loncommon::copyrightdescription($value);   return &Apache::loncommon::copyrightdescription($value);
     }      }
       # Copyright
       if ($type eq 'sourceavail') {
    return &Apache::loncommon::source_copyrightdescription($value);
       }
     # MIME      # MIME
     if ($type eq 'mime') {      if ($type eq 'mime') {
         return '<img src="'.&Apache::loncommon::icon($value).'" />&nbsp;'.          return '<img src="'.&Apache::loncommon::icon($value).'" />&nbsp;'.
Line 252  sub prettyprint { Line 259  sub prettyprint {
  ($type eq 'comefrom_list') ||   ($type eq 'comefrom_list') ||
  ($type eq 'sequsage_list')) {   ($type eq 'sequsage_list')) {
  return join('<br />',map {   return join('<br />',map {
             my $url=&Apache::lonnet::clutter($_);              my $url = &Apache::lonnet::clutter($_);
             '<b>'.&Apache::lonnet::gettitle($url).'</b>'.              my $title = &Apache::lonnet::gettitle($url);
                 &Apache::lonhtmlcommon::crumbs($url,'preview','',undef,'+0');              if ($title eq '') {
                   $title = 'Untitled';
                   if ($url =~ /\.sequence$/) {
                       $title .= ' Sequence';
                   } elsif ($url =~ /\.page$/) {
                       $title .= ' Page';
                   } elsif ($url =~ /\.problem$/) {
                       $title .= ' Problem';
                   } elsif ($url =~ /\.html$/) {
                       $title .= ' HTML document';
                   } elsif ($url =~ m:/syllabus$:) {
                       $title .= ' Syllabus';
                   } 
               }
               $_ = '<b>'.$title.'</b> '.
                   '<a href="'.$url.'" target="preview">'.
                   '<font size="-1">'.$url.'</font>'.
                   '</a>'
         } split(/\s*\,\s*/,$value));          } split(/\s*\,\s*/,$value));
     }      }
     # Evaluations      # Evaluations
Line 266  sub prettyprint { Line 290  sub prettyprint {
  return &evalgraph($value);   return &evalgraph($value);
     }      }
     # Difficulty      # Difficulty
     if ($type eq 'difficulty') {      if ($type eq 'difficulty' || $type eq 'disc') {
  return &diffgraph($value);   return &diffgraph($value);
     }      }
     # List of courses      # List of courses
     if ($type=~/\_list/) {      if ($type=~/\_list/) {
  return join('<br />',map {          my @Courses = split(/\s*\,\s*/,$value);
     my %courseinfo=&Apache::lonnet::coursedescription($_);            my $Str;
     '<a href="/public/'.          foreach my $course (@Courses) {
  $courseinfo{'domain'}.'/'.$courseinfo{'num'}.'/syllabus" target="preview">'.              my %courseinfo = &Apache::lonnet::coursedescription($course);
  $courseinfo{'description'}.'</a>';              if (! exists($courseinfo{'num'}) || $courseinfo{'num'} eq '') {
  } split(/\s*\,\s*/,$value));                  next;
               }
               if ($Str ne '') { $Str .= '<br />'; }
               $Str .= '<a href="/public/'.$courseinfo{'domain'}.'/'.
                   $courseinfo{'num'}.'/syllabus" target="preview">'.
                   $courseinfo{'description'}.'</a>';
           }
    return $Str;
     }      }
     # No pretty print found      # No pretty print found
     return $value;      return $value;
Line 320  sub relatedfield { Line 351  sub relatedfield {
   
 sub prettyinput {  sub prettyinput {
     my ($type,$value,$fieldname,$formname,      my ($type,$value,$fieldname,$formname,
  $relatedsearchflag,$relatedsep,$relatedvalue)=@_;   $relatedsearchflag,$relatedsep,$relatedvalue,$size)=@_;
       if (! defined($size)) {
           $size = 80;
       }
     # Language      # Language
     if ($type eq 'language') {      if ($type eq 'language') {
  return &selectbox($fieldname,   return &selectbox($fieldname,
Line 337  sub prettyinput { Line 371  sub prettyinput {
   (&Apache::loncommon::copyrightids)).    (&Apache::loncommon::copyrightids)).
                               &relatedfield(0,$relatedsearchflag,$relatedsep);                                &relatedfield(0,$relatedsearchflag,$relatedsep);
     }      }
       # Source Copyright
       if ($type eq 'sourceavail') {
    return &selectbox($fieldname,
     $value,
     \&Apache::loncommon::source_copyrightdescription,
     (&Apache::loncommon::source_copyrightids)).
                                 &relatedfield(0,$relatedsearchflag,$relatedsep);
       }
     # Gradelevels      # Gradelevels
     if (($type eq 'lowestgradelevel') ||      if (($type eq 'lowestgradelevel') ||
  ($type eq 'highestgradelevel')) {   ($type eq 'highestgradelevel')) {
Line 365  sub prettyinput { Line 407  sub prettyinput {
     ",'rights')\">".&mt('Select').'</a>'.      ",'rights')\">".&mt('Select').'</a>'.
             &relatedfield(0,$relatedsearchflag,$relatedsep);               &relatedfield(0,$relatedsearchflag,$relatedsep); 
     }      }
       # Source Customdistribution file
       if ($type eq 'sourcerights') {
    return '<input type="text" name="'.$fieldname.
       '" size="60" value="'.$value.'" /><a href="javascript:openbrowser'.
       "('".$formname."','".$fieldname."'".
       ",'rights')\">".&mt('Select').'</a>'.
               &relatedfield(0,$relatedsearchflag,$relatedsep); 
       }
     # Dates      # Dates
     if (($type eq 'creationdate') ||      if (($type eq 'creationdate') ||
  ($type eq 'lastrevisiondate')) {   ($type eq 'lastrevisiondate')) {
Line 376  sub prettyinput { Line 426  sub prettyinput {
     $value=~s/^\s+//gs;      $value=~s/^\s+//gs;
     $value=~s/\s+$//gs;      $value=~s/\s+$//gs;
     $value=~s/\s+/ /gs;      $value=~s/\s+/ /gs;
     $value=~s/\"/\&quod\;/gs;      $value=~s/\"/\&quot\;/gs;
     return       return 
         '<input type="text" name="'.$fieldname.'" size="80" '.          '<input type="text" name="'.$fieldname.'" size="'.$size.'" '.
         'value="'.$value.'" />'.          'value="'.$value.'" />'.
         &relatedfield(1,$relatedsearchflag,$relatedsep,$fieldname,          &relatedfield(1,$relatedsearchflag,$relatedsep,$fieldname,
                       $relatedvalue);                         $relatedvalue); 
Line 390  sub handler { Line 440  sub handler {
     #      #
     my $uri=$r->uri;      my $uri=$r->uri;
     #      #
     # Check to see if this server is overloaded  
     my $loaderror=&Apache::lonnet::overloaderror($r);  
     if ($loaderror) {   
         return $loaderror;  
     }  
     #  
     # Check to see if original resource server is overloaded  
     my ($resdomain,$resuser)=  
         (&Apache::lonnet::declutter($uri)=~/^(\w+)\/(\w+)\//);  
     $loaderror=&Apache::lonnet::overloaderror  
         ($r,&Apache::lonnet::homeserver($resuser,$resdomain));  
     if ($loaderror) {   
         return $loaderror;  
     }  
     #  
     # Set document type      # Set document type
     &Apache::loncommon::content_type($r,'text/html');      &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;      $r->send_http_header;
     return OK if $r->header_only;      return OK if $r->header_only;
     #      #
       my ($resdomain,$resuser)=
           (&Apache::lonnet::declutter($uri)=~/^(\w+)\/(\w+)\//);
     $r->print('<html><head><title>'.      $r->print('<html><head><title>'.
               'Catalog Information'.                'Catalog Information'.
               '</title></head>');                '</title></head>');
Line 450  sub report_bombs { Line 487  sub report_bombs {
             &Apache::lonmsg::all_url_author_res_msg($author,$domain);              &Apache::lonmsg::all_url_author_res_msg($author,$domain);
         foreach (sort(keys(%brokenurls))) {          foreach (sort(keys(%brokenurls))) {
             if ($_=~/^\Q$uri\E/) {              if ($_=~/^\Q$uri\E/) {
                 $r->print(&Apache::lonhtmlcommon::crumbs                  $r->print
                           (&Apache::lonnet::clutter($_)).                      ('<a href="'.&Apache::lonnet::clutter($_).'">'.$_.'</a>'.
                           &Apache::lonmsg::retrieve_author_res_msg($_).                       &Apache::lonmsg::retrieve_author_res_msg($_).
                           '<hr />');                       '<hr />');
             }              }
         }          }
     } else {      } else {
Line 494  sub present_uneditable_metadata { Line 531  sub present_uneditable_metadata {
     } else {      } else {
         $versiondisplay='Version: '.$currentversion;          $versiondisplay='Version: '.$currentversion;
     }      }
     # crumbify displayed URL      # crumbify displayed URL               uri     target prefix form  size
     $disuri=&Apache::lonhtmlcommon::crumbs($disuri);      $disuri=&Apache::lonhtmlcommon::crumbs($disuri,undef, undef, undef,'+1');
       $disuri =~ s:<br />::g;
     # obsolete      # obsolete
     my $obsolete=$content{'obsolete'};      my $obsolete=$content{'obsolete'};
     my $obsoletewarning='';      my $obsoletewarning='';
Line 507  sub present_uneditable_metadata { Line 545  sub present_uneditable_metadata {
     #      #
     my %lt=&fieldnames();      my %lt=&fieldnames();
     my $table='';      my $table='';
       my $title = $content{'title'};
       if (! defined($title)) {
           $title = 'Untitled Resource';
       }
     foreach ('title',       foreach ('title', 
              'author',                'author', 
              'subject',                'subject', 
Line 522  sub present_uneditable_metadata { Line 564  sub present_uneditable_metadata {
              'lastrevisiondate',                'lastrevisiondate', 
              'owner',                'owner', 
              'copyright',                'copyright', 
              'customdistributionfile',                'customdistributionfile',
                'sourceavail',
                'sourcerights', 
              'obsolete',                'obsolete', 
              'obsoletereplacement') {               'obsoletereplacement') {
         $table.='<tr><td bgcolor="#AAAAAA">'.$lt{$_}.          $table.='<tr><td bgcolor="#AAAAAA">'.$lt{$_}.
Line 532  sub present_uneditable_metadata { Line 576  sub present_uneditable_metadata {
     }      }
     #      #
     $r->print(<<ENDHEAD);      $r->print(<<ENDHEAD);
 <h2>$content{'title'}</h2>  <h2>$title</h2>
 <h3><tt>$disuri</tt></h3>  <p>
   $disuri<br />
 $obsoletewarning  $obsoletewarning
 $versiondisplay<br />  $versiondisplay
   </p>
 <table cellspacing=2 border=0>  <table cellspacing=2 border=0>
 $table  $table
 </table>  </table>
 ENDHEAD  ENDHEAD
     if ($ENV{'user.adv'}) {      if ($ENV{'user.adv'}) {
         &print_dynamic_metadata($r,$uri);          &print_dynamic_metadata($r,$uri,\%content);
     }      }
     return;      return;
 }  }
   
 sub print_dynamic_metadata {  sub print_dynamic_metadata {
     my ($r,$uri) = @_;      my ($r,$uri,$content) = @_;
       #
       my %content = %$content;
       my %lt=&fieldnames();
     #      #
     my $description = 'Dynamic Metadata (updated periodically)';      my $description = 'Dynamic Metadata (updated periodically)';
     $r->print('<h3>'.&mt($description).'</h3>'.      $r->print('<h3>'.&mt($description).'</h3>'.
               &mt('Processing').' ...<br />');                &mt('Processing'));
     $r->rflush();      $r->rflush();
     my %items=&fieldnames();      my %items=&fieldnames();
     my %dynmeta=&dynamicmeta($uri);      my %dynmeta=&dynamicmeta($uri);
     #      #
     # General Access and Usage Statistics      # General Access and Usage Statistics
     $r->print('<h4>'.&mt('Access and Usage Statistics').'</h4>'.      if (exists($dynmeta{'count'}) ||
               '<table cellspacing=2 border=0>');          exists($dynmeta{'sequsage'}) ||
     foreach ('count',          exists($dynmeta{'comefrom'}) ||
              'sequsage','sequsage_list',          exists($dynmeta{'goto'}) ||
              'comefrom','comefrom_list',          exists($dynmeta{'course'})) {
              'goto','goto_list',          $r->print('<h4>'.&mt('Access and Usage Statistics').'</h4>'.
              'course','course_list') {                    '<table cellspacing=2 border=0>');
         $r->print('<tr><td bgcolor="#AAAAAA">'.$lt{$_}.'</td>'.          foreach ('count',
                   '<td bgcolor="#CCCCCC">'.                   'sequsage','sequsage_list',
                   &prettyprint($_,$dynmeta{$_})."</td></tr>\n");                   'comefrom','comefrom_list',
                    'goto','goto_list',
                    'course','course_list') {
               $r->print('<tr><td bgcolor="#AAAAAA">'.$lt{$_}.'</td>'.
                         '<td bgcolor="#CCCCCC">'.
                         &prettyprint($_,$dynmeta{$_})."</td></tr>\n");
           }
           $r->print('</table>');
       } else {
           $r->print('<h4>'.&mt('No Access or Usages Statistics are available for this resource.').'</h4>');
     }      }
     $r->print('</table>');      #
       # Assessment statistics
     if ($uri=~/\.(problem|exam|quiz|assess|survey|form)$/) {      if ($uri=~/\.(problem|exam|quiz|assess|survey|form)$/) {
         # This is an assessment, print assessment data          if (exists($dynmeta{'stdno'}) ||
         $r->print(              exists($dynmeta{'avetries'}) ||
                   '<h4>'.&mt('Assessment Statistical Data').'</h4>'.              exists($dynmeta{'difficulty'}) ||
               exists($dynmeta{'disc'})) {
               # This is an assessment, print assessment data
               $r->print('<h4>'.
                         &mt('Overall Assessment Statistical Data').
                         '</h4>'.
                         '<table cellspacing=2 border=0>');
               $r->print('<tr><td bgcolor="#AAAAAA">'.$lt{'stdno'}.'</td>'.
                         '<td bgcolor="#CCCCCC">'.
                         &prettyprint('stdno',$dynmeta{'stdno'}).
                         '</td>'."</tr>\n");
               foreach ('avetries','difficulty','disc') {
                   $r->print('<tr><td bgcolor="#AAAAAA">'.$lt{$_}.'</td>'.
                             '<td bgcolor="#CCCCCC">'.
                             &prettyprint($_,sprintf('%5.2f',$dynmeta{$_})).
                             '</td>'."</tr>\n");
               }
               $r->print('</table>');    
           }
           if (exists($dynmeta{'stats'})) {
               #
               # New assessment statistics
               $r->print('<h4>'.
                         &mt('Detailed Assessment Statistical Data').
                         '</h4>');
               my $table = '<table cellspacing=2 border=0>'.
                   '<tr>'.
                   '<th>Course</th>'.
                   '<th>Section(s)</th>'.
                   '<th>Num Students</th>'.
                   '<th>Mean Tries</th>'.
                   '<th>Degree of Difficulty</th>'.
                   '<th>Degree of Discrimination</th>'.
                   '<th>Time of computation</th>'.
                   '</tr>'.$/;
               foreach my $identifier (sort(keys(%{$dynmeta{'stats'}}))) {
                   my $data = $dynmeta{'stats'}->{$identifier};
                   my $course = $data->{'course'};
                   my %courseinfo = &Apache::lonnet::coursedescription($course);
                   if (! exists($courseinfo{'num'}) || $courseinfo{'num'} eq '') {
                       &Apache::lonnet::logthis('lookup for '.$course.' failed');
                       next;
                   }
                   $table .= '<tr>';
                   $table .= 
                       '<td><nobr>'.$courseinfo{'description'}.'</nobr></td>';
                   $table .= 
                       '<td align="right">'.$data->{'sections'}.'</td>';
                   $table .=
                       '<td align="right">'.$data->{'stdno'}.'</td>';
                   foreach ('avetries','difficulty','disc') {
                       $table .= '<td align="right">';
                       if (exists($data->{$_})) {
                           $table .= sprintf('%.2f',$data->{$_}).'&nbsp;';
                       } else {
                           $table .= '';
                       }
                       $table .= '</td>';
                   }
                   $table .=
                       '<td><nobr>'.
                       &Apache::lonlocal::locallocaltime($data->{'timestamp'}).
                       '</nobr></td>';
                   $table .=
                       '</tr>'.$/;
               }
               $table .= '</table>'.$/;
               $r->print($table);
           } else {
               $r->print('No new dynamic data found.');
           }
       } else {
           $r->print('<h4>'.
             &mt('No Assessment Statistical Data is available for this resource').
                     '</h4>');
       }
   
       #
       #
       if (exists($dynmeta{'clear'})   || 
           exists($dynmeta{'depth'})   || 
           exists($dynmeta{'helpful'}) || 
           exists($dynmeta{'correct'}) || 
           exists($dynmeta{'technical'})){ 
           $r->print('<h4>'.&mt('Evaluation Data').'</h4>'.
                   '<table cellspacing=2 border=0>');                    '<table cellspacing=2 border=0>');
         foreach ('stdno','avetries','difficulty') {          foreach ('clear','depth','helpful','correct','technical') {
             $r->print('<tr><td bgcolor="#AAAAAA">'.$lt{$_}.'</td>'.              $r->print('<tr><td bgcolor="#AAAAAA">'.$lt{$_}.'</td>'.
                       '<td bgcolor="#CCCCCC">'.                        '<td bgcolor="#CCCCCC">'.
                       &prettyprint($_,$dynmeta{$_})."</td></tr>\n");                        &prettyprint($_,$dynmeta{$_})."</td></tr>\n");
         }          }
         $r->print('</table>');              $r->print('</table>');
     }      } else {
               $r->print('<h4>'.&mt('No Evaluation Data is available for this resource.').'</h4>');
     $r->print('<h4>'.&mt('Evaluation Data').'</h4>'.  
               '<table cellspacing=2 border=0>');  
     foreach ('clear','depth','helpful','correct','technical') {  
         $r->print('<tr><td bgcolor="#AAAAAA">'.$lt{$_}.'</td>'.  
                   '<td bgcolor="#CCCCCC">'.  
                   &prettyprint($_,$dynmeta{$_})."</td></tr>\n");  
     }      }
     $r->print('</table>');  
     $uri=~/^\/res\/(\w+)\/(\w+)\//;       $uri=~/^\/res\/(\w+)\/(\w+)\//; 
     if ((($ENV{'user.domain'} eq $1) && ($ENV{'user.name'} eq $2))      if ((($ENV{'user.domain'} eq $1) && ($ENV{'user.name'} eq $2))
         || ($ENV{'user.role.ca./'.$1.'/'.$2})) {          || ($ENV{'user.role.ca./'.$1.'/'.$2})) {
         $r->print('<h4>'.&mt('Evaluation Comments').' ('.          if (exists($dynmeta{'comments'})) {
                   &mt('visible to author and co-authors only').              $r->print('<h4>'.&mt('Evaluation Comments').' ('.
                   ')</h4>'.                        &mt('visible to author and co-authors only').
                   '<blockquote>'.$dynmeta{'comments'}.'</blockquote>');                        ')</h4>'.
         $r->print('<a name="bombs" /><h4>'.&mt('Error Messages').' ('.                        '<blockquote>'.$dynmeta{'comments'}.'</blockquote>');
                   &mt('visible to author and co-authors only').')'.          } else {
                   '</h4>'.              $r->print('<h4>'.&mt('There are no Evaluation Comments on this resource.').'</h4>');
                   &Apache::lonmsg::retrieve_author_res_msg($uri));          }
           my $bombs = &Apache::lonmsg::retrieve_author_res_msg($uri);
           if (defined($bombs) && $bombs ne '') {
               $r->print('<a name="bombs" /><h4>'.&mt('Error Messages').' ('.
                         &mt('visible to author and co-authors only').')'.
                         '</h4>'.$bombs);
           } else {
               $r->print('<h4>'.&mt('There are currently no Error Messages for this resource.').'</h4>');
           }
     }      }
       #
     # All other stuff      # All other stuff
     $r->print('<h3>'.      $r->print('<h3>'.
               &mt('Additional Metadata (non-standard, parameters, exports)').                &mt('Additional Metadata (non-standard, parameters, exports)').
Line 694  ENDEDIT Line 839  ENDEDIT
         foreach ('author','title','subject','keywords','abstract','notes',          foreach ('author','title','subject','keywords','abstract','notes',
                  'copyright','customdistributionfile','language',                   'copyright','customdistributionfile','language',
                  'standards',                   'standards',
                  'lowestgradelevel','highestgradelevel',                   'lowestgradelevel','highestgradelevel','sourceavail','sourcerights',
                  'obsolete','obsoletereplacement') {                   'obsolete','obsoletereplacement') {
             if (defined($ENV{'form.new_'.$_})) {              if (defined($ENV{'form.new_'.$_})) {
                 $Apache::lonpublisher::metadatafields{$_}=                  $Apache::lonpublisher::metadatafields{$_}=
Line 747  ENDEDIT Line 892  ENDEDIT
     return;      return;
 }  }
   
 ##############################################################  
 ##############################################################  
 # MySQL table columns  
   
 my @columns;  
   
 BEGIN {  
     # Get columns of MySQL metadata table  
     @columns=&Apache::lonmysql::col_order('metadata');  
 }  
   
 #  
 # Turn MySQL row into hash  
 #     This routine should be moved to lonmetadata  
 #     a more generic place since it has nothing to do with metadata  
 sub metadata_col_to_hash {  
     my @cols=@_;  
     my %hash=();  
     for (my $i=0; $i<=$#columns; $i++) {  
  $hash{$columns[$i]}=$cols[$i];  
     }  
     return %hash;  
 }  
   
   
 1;  1;
 __END__  __END__

Removed from v.1.67  
changed lines
  Added in v.1.79


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