version 1.169, 2006/08/16 18:02:01
|
version 1.173, 2006/08/25 23:05:52
|
Line 719 sub prettyinput {
|
Line 719 sub prettyinput {
|
# Main Handler |
# Main Handler |
sub handler { |
sub handler { |
my $r=shift; |
my $r=shift; |
# |
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
['currentpath']); |
['currentpath']); |
my $uri=$r->uri; |
my $uri=$r->uri; |
Line 728 sub handler {
|
Line 727 sub handler {
|
&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)= |
my ($resdomain,$resuser)= |
(&Apache::lonnet::declutter($uri)=~/^(\w+)\/(\w+)\//); |
(&Apache::lonnet::declutter($uri)=~/^(\w+)\/(\w+)\//); |
if ($uri=~m:/adm/bombs/(.*)$:) { |
if ($uri=~m:/adm/bombs/(.*)$:) { |
Line 746 sub handler {
|
Line 744 sub handler {
|
} else { |
} else { |
&pre_select_course($r,$uri); |
&pre_select_course($r,$uri); |
} |
} |
|
} elsif ($uri=~m|^/editupload/[^/]+/[^/]+/groups/|) { |
|
$r->print(&Apache::loncommon::start_page('Edit Group Portfolio File Catalog Information', |
|
undef, |
|
{'domain' => $resdomain,})); |
|
|
|
&present_editable_metadata($r,$uri,'groups'); |
} elsif ($uri=~m|^/~|) { |
} elsif ($uri=~m|^/~|) { |
# Construction space |
# Construction space |
$r->print(&Apache::loncommon::start_page('Edit Catalog nformation', |
$r->print(&Apache::loncommon::start_page('Edit Catalog nformation', |
Line 1106 sub print_dynamic_metadata {
|
Line 1110 sub print_dynamic_metadata {
|
##################################################### |
##################################################### |
##################################################### |
##################################################### |
sub present_editable_metadata { |
sub present_editable_metadata { |
my ($r,$uri, $file_type) = @_; |
my ($r,$uri,$file_type) = @_; |
# Construction Space Call |
# Construction Space Call |
# Header |
# Header |
my $disuri=$uri; |
my $disuri=$uri; |
Line 1196 ENDEDIT
|
Line 1200 ENDEDIT
|
'lowestgradelevel','highestgradelevel','sourceavail','sourcerights', |
'lowestgradelevel','highestgradelevel','sourceavail','sourcerights', |
'obsolete','obsoletereplacement'); |
'obsolete','obsoletereplacement'); |
} |
} |
|
if ($file_type eq 'groups') { |
|
$Apache::lonpublisher::metadatafields{'courserestricted'}= |
|
'course.'.$env{'request.course.id'}; |
|
} |
if ((! $Apache::lonpublisher::metadatafields{'courserestricted'}) && |
if ((! $Apache::lonpublisher::metadatafields{'courserestricted'}) && |
(! $env{'form.new_courserestricted'})) { |
(! $env{'form.new_courserestricted'}) && (! $file_type eq 'groups')) { |
$Apache::lonpublisher::metadatafields{'courserestricted'}= |
$Apache::lonpublisher::metadatafields{'courserestricted'}= |
'none'; |
'none'; |
} elsif ($env{'form.new_courserestricted'}) { |
} elsif ($env{'form.new_courserestricted'}) { |
Line 1208 ENDEDIT
|
Line 1216 ENDEDIT
|
$Apache::lonpublisher::metadatafields{'copyright'}= |
$Apache::lonpublisher::metadatafields{'copyright'}= |
'default'; |
'default'; |
} |
} |
if ($file_type eq 'portfolio') { |
if (($file_type eq 'portfolio') || ($file_type eq 'groups')) { |
if (! $Apache::lonpublisher::metadatafields{'mime'}) { |
if (! $Apache::lonpublisher::metadatafields{'mime'}) { |
($Apache::lonpublisher::metadatafields{'mime'}) = |
($Apache::lonpublisher::metadatafields{'mime'}) = |
( $target=~/\.(\w+)$/ ); |
( $target=~/\.(\w+)$/ ); |
Line 1283 ENDEDIT
|
Line 1291 ENDEDIT
|
'<>&"'). |
'<>&"'). |
'</'.$tag.'>'; |
'</'.$tag.'>'; |
} |
} |
if ($fn =~ m|^$Apache::lonnet::perlvar{'lonDocRoot'}/userfiles/portfolio/|) { |
if ($fn =~ m|^$Apache::lonnet::perlvar{'lonDocRoot'}/userfiles|) { |
my ($path, $new_fn) = ($fn =~ m|/(portfolio.*)/([^/]*)$|); |
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, |
$r->print(&store_portfolio_metadata($formname,$file_content,$path, |
$new_fn)); |
$new_fn)); |
unless ($env{'form.associate'}) { |
if (! $env{'form.associate'}) { |
$r->print(&Apache::portfolio::done("return",'/adm/portfolio')); |
$r->print(&Apache::portfolio::done("Return to Portfolio",'/adm/portfolio')); |
return; |
|
} |
|
} 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)); |
|
unless ($env{'form.associate'}) { |
|
$r->print(&Apache::portfolio::done("return",'/adm/portfolio')); |
|
return; |
return; |
} |
} |
} else { |
} else { |
if (! ($mfh=Apache::File->new('>'.$fn))) { |
if (! ($mfh=Apache::File->new('>'.$fn))) { |
$r->print('<p><font color="red">'. |
$r->print('<p><font color="red">'. |
&mt('Could not write metadata').', '. |
&mt('Could not write metadata').', '. |
Line 1309 ENDEDIT
|
Line 1315 ENDEDIT
|
' '.&Apache::lonlocal::locallocaltime(time). |
' '.&Apache::lonlocal::locallocaltime(time). |
'</font></p>'); |
'</font></p>'); |
} |
} |
unless ($env{'form.associate'}) { |
if (! $env{'form.associate'}) { |
$r->print(&Apache::portfolio::done("return",'/adm/portfolio')); |
$r->print(&Apache::portfolio::done("Return to Portfolio",'/adm/portfolio')); |
return; |
return; |
} |
} |
} |
} |