Diff for /loncom/interface/lonparmset.pm between versions 1.342 and 1.347

version 1.342, 2006/10/13 17:40:12 version 1.347, 2006/11/20 21:04:44
Line 2193  sub crsenv { Line 2193  sub crsenv {
                     ' Tabloid [11x17 in], Executive [7 1/2x10 in], A2 [420x594 mm],'.                       ' Tabloid [11x17 in], Executive [7 1/2x10 in], A2 [420x594 mm],'. 
                     ' A3 [297x420 mm], A4 [210x297 mm], A5 [148x210 mm], A6 [105x148 mm])',                      ' A3 [297x420 mm], A4 [210x297 mm], A5 [148x210 mm], A6 [105x148 mm])',
      'print_header_format'       'print_header_format'
          => '<b>Print header format; substitutions:  %n student name %c course id %a assignment',           => '<b>Print header format; substitutions</b>:  %n student name %c course id %a assignment note, numbers after the % limit the field size',
              'anonymous_quiz'               'anonymous_quiz'
                  => '<b>'.&mt('Anonymous quiz/exam').'</b><br />'.                   => '<b>'.&mt('Anonymous quiz/exam').'</b><br />'.
                     ' (<tt><b>'.&mt('yes').'</b> '.&mt('to avoid print students names').' </tt>)',                      ' (<tt><b>'.&mt('yes').'</b> '.&mt('to avoid print students names').' </tt>)',
Line 3189  ENDMAINFORMHEAD Line 3189  ENDMAINFORMHEAD
 ### Set portfolio metadata  ### Set portfolio metadata
 sub output_row {  sub output_row {
     my ($r, $field_name, $field_text, $added_flag) = @_;      my ($r, $field_name, $field_text, $added_flag) = @_;
       my $row_class;
     my $output;      my $output;
     my $options=$env{'course.'.$env{'request.course.id'}.'.metadata.'.$field_name.'.options'};      my $options=$env{'course.'.$env{'request.course.id'}.'.metadata.'.$field_name.'.options'};
     my $values=$env{'course.'.$env{'request.course.id'}.'.metadata.'.$field_name.'.values'};      my $values=$env{'course.'.$env{'request.course.id'}.'.metadata.'.$field_name.'.values'};
Line 3197  sub output_row { Line 3198  sub output_row {
         $values = '';          $values = '';
     }      }
     if (!($options =~ /deleted/)) {      if (!($options =~ /deleted/)) {
         $output.='<strong>'.$field_text.':</strong>';          $output = &Apache::loncommon::start_data_table_row();
         $output.='<input name="'.$field_name.'_values" type="text" value="'.$values.'" size="80" /><br />';          $output .= '<td><span class="LC_metadata"><strong>'.$field_text.':</strong></span></td>';
           # $output .= '<td><strong>'.$field_text.':</strong></td>';
           $output .= '<td><span class="LC_metadata"><input name="'.$field_name.'_values" type="text" value="'.$values.'" size="80" /></span></td>';
           $output .= &Apache::loncommon::end_data_table_row();
         my @options= ( ['active', 'Show to student'],          my @options= ( ['active', 'Show to student'],
    ['onlyone','Student may select only one choice'],     ['onlyone','Student may select only one choice'],
    ['stuadd', 'Student may type choices']);     ['stuadd', 'Student may type choices']);
Line 3208  sub output_row { Line 3211  sub output_row {
         }          }
         foreach my $opt (@options) {          foreach my $opt (@options) {
     my $checked = ($options =~ m/$opt->[0]/) ? ' checked="checked" ' : '' ;      my $checked = ($options =~ m/$opt->[0]/) ? ' checked="checked" ' : '' ;
     $output.=('&nbsp;'x5).'<label><input type="checkbox" name="'.      $output .= &Apache::loncommon::continue_data_table_row();
       $output .= '<td colspan="2">'.('&nbsp;' x 5).'<span class="LC_metadata"><label><input type="checkbox" name="'.
         $field_name.'_'.$opt->[0].'" value="yes"'.$checked.' />'.          $field_name.'_'.$opt->[0].'" value="yes"'.$checked.' />'.
         &mt($opt->[1]).'</label> <br />';          &mt($opt->[1]).'</label></span> </td>';
       $output .= &Apache::loncommon::end_data_table_row();
  }   }
   
     }      }
     return ($output);      return ($output);
 }  }
Line 3221  sub order_meta_fields { Line 3227  sub order_meta_fields {
     my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};      my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
     my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};      my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
     $r->print(&Apache::loncommon::start_page('Order Metadata Fields'));      $r->print(&Apache::loncommon::start_page('Order Metadata Fields'));
     $r->print(&Apache::lonhtmlcommon::breadcrumbs('Order Metadata Fields'));      &Apache::lonhtmlcommon::add_breadcrumb
               ({href=>"/adm/parmset?action=setrestrictmeta",
                 text=>"Restrict Metadata"},
                {text=>"Order Metadata"});
       $r->print(&Apache::lonhtmlcommon::breadcrumbs('Order Metadata'));
     if ($env{'form.storeorder'}) {      if ($env{'form.storeorder'}) {
         my $newpos = $env{'form.newpos'} - 1;          my $newpos = $env{'form.newpos'} - 1;
         my $currentpos = $env{'form.currentpos'} - 1;          my $currentpos = $env{'form.currentpos'} - 1;
Line 3254  sub order_meta_fields { Line 3264  sub order_meta_fields {
        }         }
         }          }
  my $ordered_fields = join ",", @neworder;   my $ordered_fields = join ",", @neworder;
           my $put_result = &Apache::lonnet::put('environment',
                              {'metadata.addedorder'=>$ordered_fields},$dom,$crs);
  &Apache::lonnet::appenv('course.'.$env{'request.course.id'}.'.metadata.addedorder' => $ordered_fields);   &Apache::lonnet::appenv('course.'.$env{'request.course.id'}.'.metadata.addedorder' => $ordered_fields);
     }      }
     my $fields = &get_added_meta_fieldnames();      my $fields = &get_added_meta_fieldnames();
Line 3386  sub setrestrictmeta { Line 3398  sub setrestrictmeta {
     my %metadata_fields = &Apache::lonmeta::fieldnames('portfolio');      my %metadata_fields = &Apache::lonmeta::fieldnames('portfolio');
     # Now get possible added metadata fields      # Now get possible added metadata fields
     my $added_metadata_fields = &get_added_meta_fieldnames(\%metadata_fields);      my $added_metadata_fields = &get_added_meta_fieldnames(\%metadata_fields);
       my $row_alt = 1;
       $output .= &Apache::loncommon::start_data_table();
     foreach my $field (sort(keys(%metadata_fields))) {      foreach my $field (sort(keys(%metadata_fields))) {
         if ($field ne 'courserestricted') {          if ($field ne 'courserestricted') {
               $row_alt = $row_alt ? 0 : 1;
     $output.= &output_row($r, $field, $metadata_fields{$field});      $output.= &output_row($r, $field, $metadata_fields{$field});
  }   }
     }      }
     my $added_flag = 1;      my $added_flag = 1;
     foreach my $field (sort(keys(%$added_metadata_fields))) {      foreach my $field (sort(keys(%$added_metadata_fields))) {
         $output.= &output_row($r, $field, $$added_metadata_fields{$field},$added_flag);          $row_alt = $row_alt ? 0 : 1;
           $output.= &output_row($r, $field, $$added_metadata_fields{$field},$added_flag, $row_alt);
     }      }
       $output .= &Apache::loncommon::end_data_table();
     $r->print(<<ENDenv);             $r->print(<<ENDenv);       
         <form method="post" action="/adm/parmset?action=setrestrictmeta" name="form">          <form method="post" action="/adm/parmset?action=setrestrictmeta" name="form">
         <p>  
         $output          $output
         <input type="submit" name="restrictmeta" value="Update Metadata Restrictions">          <input type="submit" name="restrictmeta" value="Update Metadata Restrictions" />
         </form><br />          </form><br />
         <form method="post" action="/adm/parmset?action=addmetadata" name="form">          <form method="post" action="/adm/parmset?action=addmetadata" name="form1">
         <input type="submit" name="restrictmeta" value="Add a Metadata Field">          <input type="submit" name="restrictmeta" value="Add a Metadata Field" />
         </form>          </form>
         </form><br />          <br />
         <form method="post" action="/adm/parmset?action=ordermetadata" name="form">          <form method="post" action="/adm/parmset?action=ordermetadata" name="form2">
         <input type="submit" name="restrictmeta" value="Order Metadata Fields">          <input type="submit" name="restrictmeta" value="Order Metadata Fields" />
         </form>          </form>
 ENDenv  ENDenv
     $r->print(&Apache::loncommon::end_page());      $r->print(&Apache::loncommon::end_page());

Removed from v.1.342  
changed lines
  Added in v.1.347


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