';
+ my $row_alt = 1;
foreach my $field_name (@fields) {
-
+ # $row_alt = ($row_alt) ? 0 : 1;
+ my $row_class = ($row_alt) ? ' class="LC_metadata_light" ' : ' class="LC_metadata_dark" ';
if (defined($env{'form.new_'.$field_name})) {
$Apache::lonpublisher::metadatafields{$field_name}=
join(',',&Apache::loncommon::get_env_multiple('form.new_'.$field_name));
@@ -1234,24 +1281,27 @@ ENDEDIT
if ($Apache::lonpublisher::metadatafields{'courserestricted'} ne 'none'
&& exists($env{$Apache::lonpublisher::metadatafields{'courserestricted'}.'.metadata.'.$field_name.'.options'})) {
# handle restrictions here
- if (($env{$Apache::lonpublisher::metadatafields{'courserestricted'}.'.metadata.'.$field_name.'.options'} =~ m/active/) ||
- ($field_name eq 'courserestricted')){
- $output.=("\n".''.$lt{$field_name}.': '.
+ if ((($env{$Apache::lonpublisher::metadatafields{'courserestricted'}.'.metadata.'.$field_name.'.options'} =~ m/active/) ||
+ ($field_name eq 'courserestricted'))&&
+ (!($env{$Apache::lonpublisher::metadatafields{'courserestricted'}.'.metadata.'.$field_name.'.options'} =~ m/deleted/))){
+
+ $output.=("\n".'
'.$lt{$field_name}.': | '.
&prettyinput($field_name,
$Apache::lonpublisher::metadatafields{$field_name},
'new_'.$field_name,'defaultmeta',
undef,undef,undef,undef,
- $Apache::lonpublisher::metadatafields{'courserestricted'}).''."\n");
+ $Apache::lonpublisher::metadatafields{'courserestricted'}).' |
'."\n");
}
} else {
- $output.=(''.$lt{$field_name}.': '.
- &prettyinput($field_name,
- $Apache::lonpublisher::metadatafields{$field_name},
- 'new_'.$field_name,'defaultmeta').'
');
+ $output.=(''.$lt{$field_name}.': | '.
+ &prettyinput($field_name,
+ $Apache::lonpublisher::metadatafields{$field_name},
+ 'new_'.$field_name,'defaultmeta').' |
');
}
}
+ $output.='
';
if ($env{'form.store'}) {
my $mfh;
my $formname='store';
@@ -1260,22 +1310,20 @@ ENDEDIT
$Apache::lonpublisher::metadatafields{'keywords'} =
join (',', &Apache::loncommon::get_env_multiple('form.new_keywords'));
}
-
- foreach (sort keys %Apache::lonpublisher::metadatafields) {
- next if ($_ =~ /\./);
- my $unikey=$_;
- $unikey=~/^([A-Za-z]+)/;
+ foreach my $field (sort(keys(%Apache::lonpublisher::metadatafields))) {
+ next if ($field =~ /\./);
+ my $unikey=$field;
+ $unikey=~/^([A-Za-z_]+)/;
my $tag=$1;
$tag=~tr/A-Z/a-z/;
$file_content.= "\n\<$tag";
- foreach (split(/\,/,
- $Apache::lonpublisher::metadatakeys{$unikey})
- ) {
+ foreach my $key (split(/\,/,
+ $Apache::lonpublisher::metadatakeys{$unikey})
+ ) {
my $value=
- $Apache::lonpublisher::metadatafields{$unikey.'.'.$_};
+ $Apache::lonpublisher::metadatafields{$unikey.'.'.$key};
$value=~s/\"/\'\'/g;
- $file_content.=' '.$_.'="'.$value.'"' ;
- # print $mfh ' '.$_.'="'.$value.'"';
+ $file_content.=' '.$key.'="'.$value.'"' ;
}
$file_content.= '>'.
&HTML::Entities::encode
@@ -1283,40 +1331,43 @@ ENDEDIT
'<>&"').
''.$tag.'>';
}
- if ($fn =~ m|^$Apache::lonnet::perlvar{'lonDocRoot'}/userfiles/portfolio/|) {
- my ($path, $new_fn) = ($fn =~ m|/(portfolio.*)/([^/]*)$|);
+ if ($fn =~ m|^$Apache::lonnet::perlvar{'lonDocRoot'}/userfiles|) {
+ my ($path, $new_fn);
+ if ($fn =~ m|\w+/groups/\w+/portfolio/|) {
+ ($path, $new_fn) = ($fn =~ m|/(groups/\w+/portfolio.*)/([^/]*)$|);
+ } else {
+ ($path, $new_fn) = ($fn =~ m|/(portfolio.*)/([^/]*)$|);
+ }
$r->print(&store_portfolio_metadata($formname,$file_content,$path,
- $new_fn));
- } elsif ($fn =~ m|^$Apache::lonnet::perlvar{'lonDocRoot'}/userfiles/groups/\w+/portfolio/|) {
- my ($path, $new_fn) = ($fn =~ m|/(groups/\w+/portfolio.*)/([^/]*)$|);
- $r->print(&store_portfolio_metadata($formname,$file_content,$path,$new_fn));
- } else {
- if (! ($mfh=Apache::File->new('>'.$fn))) {
+ $new_fn));
+ } else {
+ if (! ($mfh=Apache::File->new('>'.$fn))) {
$r->print('