Diff for /loncom/interface/lonmeta.pm between versions 1.132 and 1.136

version 1.132, 2005/11/22 19:43:53 version 1.136, 2005/12/09 23:49:45
Line 243  sub fieldnames { Line 243  sub fieldnames {
          'authorspace' => 'Author Space',           'authorspace' => 'Author Space',
          'modifyinguser' => 'Last Modifying User',           'modifyinguser' => 'Last Modifying User',
          'subject' => 'Subject',           'subject' => 'Subject',
            'standards' => 'Standards',
          'keywords' => 'Keyword(s)',           'keywords' => 'Keyword(s)',
          'notes' => 'Notes',           'notes' => 'Notes',
          'abstract' => 'Abstract',           'abstract' => 'Abstract',
Line 254  sub fieldnames { Line 255  sub fieldnames {
         %fields =           %fields = 
         (%fields,          (%fields,
          'domain' => 'Domain',           'domain' => 'Domain',
          'standards' => 'Standards',  
          'mime' => 'MIME Type',           'mime' => 'MIME Type',
          'language' => 'Language',           'language' => 'Language',
          'creationdate' => 'Creation Date',           'creationdate' => 'Creation Date',
Line 284  sub fieldnames { Line 284  sub fieldnames {
          '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',           'disc'       => 'Degree of discrimination',
  'dependencies' => 'Resources used by this resource',       'dependencies' => 'Resources used by this resource',
          );           );
     }      }
     return &Apache::lonlocal::texthash(%fields);      return &Apache::lonlocal::texthash(%fields);
Line 302  sub select_course { Line 302  sub select_course {
             $courses{$coursekey} = $value;              $courses{$coursekey} = $value;
         }          }
     }      }
     $r->print('<h3>Course Related Meta-Data</h3><br />');      $r->print('<h3>Associate resource with a course</h3><br />');
     $r->print('<form action="" method="post">');      $r->print('<form action="" method="post">');
     $r->print('Select course restrictions<br />');      $r->print('Select course <br />');
     $r->print('<select name="metacourse" >');      $r->print('<select name="metacourse" >');
     my $meta_not_found = 1;      my $meta_not_found = 1;
     foreach my $key (keys (%courses)) {          foreach my $key (keys (%courses)) {    
Line 322  sub select_course { Line 322  sub select_course {
     }      }
     unless ($meta_not_found) {      unless ($meta_not_found) {
         $r->print('</select><br />');          $r->print('</select><br />');
         $r->print('<input type="submit" value="Assign Portfolio Metadata" />');          $r->print('<input type="submit" value="Associate" />');
         $r->print('</form>');          $r->print('</form>');
     }      }
     return 'ok';      return 'ok';
Line 499  sub prettyinput { Line 499  sub prettyinput {
         }          }
         # need to take instructor values out of list where instructor and student          # need to take instructor values out of list where instructor and student
         # values may be mixed.          # values may be mixed.
         if ($values && $stu_add) {          if ($values) {
             foreach my $item (split(/,/,$values)) {              foreach my $item (split(/,/,$values)) {
                 $item =~ s/^\s+//;                  $item =~ s/^\s+//;
                 $meta_options{$item} = $type;                  $meta_options{$item} = $item;
             }              }
             foreach my $item (split(/,/,$value)) {              foreach my $item (split(/,/,$value)) {
                 $item =~ s/^\s+//;                  $item =~ s/^\s+//;
Line 520  sub prettyinput { Line 520  sub prettyinput {
         }          }
         if (($type eq 'keywords') || ($type eq 'subject')          if (($type eq 'keywords') || ($type eq 'subject')
              || ($type eq 'author')||($type eq  'notes')               || ($type eq 'author')||($type eq  'notes')
              || ($type eq  'abstract')|| ($type eq  'title')) {               || ($type eq  'abstract')|| ($type eq  'title')|| ($type eq  'standards')) {
             if ($values) {              if ($values) {
                 if ($only_one) {                  if ($only_one) {
                     $output .= (&Apache::loncommon::select_form($value,'new_'.$type,%meta_options));                      $output .= (&Apache::loncommon::select_form($cur_values_inst[0],'new_'.$type,%meta_options));
                 } else {                  } else {
                     $output .= (&Apache::loncommon::multiple_select_form('new_'.$type,\@cur_values_inst,undef,\%meta_options));                      $output .= (&Apache::loncommon::multiple_select_form('new_'.$type,\@cur_values_inst,undef,\%meta_options));
                 }                  }
Line 603  sub prettyinput { Line 603  sub prettyinput {
     ",'rights')\">".&mt('Select').'</a>'.      ",'rights')\">".&mt('Select').'</a>'.
             &relatedfield(0,$relatedsearchflag,$relatedsep);               &relatedfield(0,$relatedsearchflag,$relatedsep); 
     }      }
       if ($type eq 'courserestricted') {
               return ('<input type="hidden" name="new_courserestricted" value="'.$course_key.'" />');
       }
   
     # Dates      # Dates
     if (($type eq 'creationdate') ||      if (($type eq 'creationdate') ||
  ($type eq 'lastrevisiondate')) {   ($type eq 'lastrevisiondate')) {
Line 1071  ENDEDIT Line 1075  ENDEDIT
  my @fields;   my @fields;
  if ($file_type eq 'portfolio') {   if ($file_type eq 'portfolio') {
     @fields =  ('author','title','subject','keywords','abstract','notes','lowestgradelevel',      @fields =  ('author','title','subject','keywords','abstract','notes','lowestgradelevel',
                 'highestgradelevel','courserestricted');                  'highestgradelevel','standards','courserestricted');
  } else {   } else {
     @fields = ('author','title','subject','keywords','abstract','notes',      @fields = ('author','title','subject','keywords','abstract','notes',
                  'copyright','customdistributionfile','language',                   'copyright','customdistributionfile','language',
Line 1097  ENDEDIT Line 1101  ENDEDIT
                 'default';                  'default';
         }          }
         if ($metacourse ne 'none') {          if ($metacourse ne 'none') {
              $r->print('Document metadata restricted by :<strong> '.$env{$metacourse.".description"}."</strong><br />");               $r->print('Using: <strong> '.$env{$metacourse.".description"}."</strong> metadata framework<br />");
         }          }
         foreach my $field_name(@fields) {          foreach my $field_name(@fields) {
   
Line 1152  ENDEDIT Line 1156  ENDEDIT
                              $Apache::lonpublisher::metadatakeys{$unikey})                               $Apache::lonpublisher::metadatakeys{$unikey})
                          ) {                           ) {
                     my $value=                      my $value=
                      $Apache::lonpublisher::metadatafields{$unikey.'.'.$_};                      $Apache::lonpublisher::metadatafields{$unikey.'.'.$_};
                     $value=~s/\"/\'\'/g;                      $value=~s/\"/\'\'/g;
                     $file_content.=' '.$_.'="'.$value.'"' ;                      $file_content.=' '.$_.'="'.$value.'"' ;
                     # print $mfh ' '.$_.'="'.$value.'"';                      # print $mfh ' '.$_.'="'.$value.'"';
Line 1166  ENDEDIT Line 1170  ENDEDIT
             if ($fn =~ /\/portfolio\//) {              if ($fn =~ /\/portfolio\//) {
                 $fn =~ /\/portfolio\/(.*)$/;                  $fn =~ /\/portfolio\/(.*)$/;
                 my $new_fn = '/'.$1;                  my $new_fn = '/'.$1;
                 $env{'form.'.$formname}=$file_content;                  $env{'form.'.$formname}=$file_content."\n";
                 $env{'form.'.$formname.'.filename'}=$new_fn;                  $env{'form.'.$formname.'.filename'}=$new_fn;
                 &Apache::lonnet::userfileupload('uploaddoc','',                  &Apache::lonnet::userfileupload('uploaddoc','',
          'portfolio'.$env{'form.currentpath'});           'portfolio'.$env{'form.currentpath'});

Removed from v.1.132  
changed lines
  Added in v.1.136


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