version 1.346, 2006/11/15 22:33:13
|
version 1.347, 2006/11/20 21:04:44
|
Line 3188 ENDMAINFORMHEAD
|
Line 3188 ENDMAINFORMHEAD
|
} |
} |
### Set portfolio metadata |
### Set portfolio metadata |
sub output_row { |
sub output_row { |
my ($r, $field_name, $field_text, $added_flag, $alt_row) = @_; |
my ($r, $field_name, $field_text, $added_flag) = @_; |
my $row_class; |
my $row_class; |
if ($alt_row) { |
|
$row_class = ' class="LC_metadata_light" '; |
|
} else { |
|
$row_class = ' class="LC_metadata_dark" '; |
|
} |
|
my $output; |
my $output; |
$output = "<tr $row_class>"; |
|
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'}; |
if (!defined($options)) { |
if (!defined($options)) { |
Line 3204 sub output_row {
|
Line 3198 sub output_row {
|
$values = ''; |
$values = ''; |
} |
} |
if (!($options =~ /deleted/)) { |
if (!($options =~ /deleted/)) { |
$output = "<tr $row_class>"; |
$output = &Apache::loncommon::start_data_table_row(); |
$output .= '<td><span class="LC_metadata"><strong>'.$field_text.':</strong></span></td>'; |
$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 .= '<td><span class="LC_metadata"><input name="'.$field_name.'_values" type="text" value="'.$values.'" size="80" /></span></td>'; |
$output .= "</tr>\n"; |
$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 3216 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 .= '<tr '.$row_class.'><td colspan="2">'.(' ' x 5).'<span class="LC_metadata"><label><input type="checkbox" name="'. |
$output .= &Apache::loncommon::continue_data_table_row(); |
|
$output .= '<td colspan="2">'.(' ' 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></span> </td></tr>'."\n"; |
&mt($opt->[1]).'</label></span> </td>'; |
|
$output .= &Apache::loncommon::end_data_table_row(); |
} |
} |
|
|
} |
} |
Line 3402 sub setrestrictmeta {
|
Line 3399 sub setrestrictmeta {
|
# 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; |
my $row_alt = 1; |
$output .= '<table class="LC_metadata_table" cellspacing="0">'; |
$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; |
$row_alt = $row_alt ? 0 : 1; |
$output.= &output_row($r, $field, $metadata_fields{$field}, undef, $row_alt); |
$output.= &output_row($r, $field, $metadata_fields{$field}); |
} |
} |
} |
} |
my $added_flag = 1; |
my $added_flag = 1; |
Line 3414 sub setrestrictmeta {
|
Line 3411 sub setrestrictmeta {
|
$row_alt = $row_alt ? 0 : 1; |
$row_alt = $row_alt ? 0 : 1; |
$output.= &output_row($r, $field, $$added_metadata_fields{$field},$added_flag, $row_alt); |
$output.= &output_row($r, $field, $$added_metadata_fields{$field},$added_flag, $row_alt); |
} |
} |
$output .= "</table>"; |
$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"> |
$output |
$output |