version 1.146, 2005/12/19 21:49:12
|
version 1.149, 2005/12/29 19:42:44
|
Line 248 sub fieldnames {
|
Line 248 sub fieldnames {
|
'notes' => 'Notes', |
'notes' => 'Notes', |
'abstract' => 'Abstract', |
'abstract' => 'Abstract', |
'lowestgradelevel' => 'Lowest Grade Level', |
'lowestgradelevel' => 'Lowest Grade Level', |
'highestgradelevel' => 'Highest Grade Level', |
'highestgradelevel' => 'Highest Grade Level'); |
'courserestricted' => 'Course Restricting Metadata'); |
|
|
if (! defined($file_type) || $file_type ne 'portfolio') { |
|
%fields = |
|
(%fields, |
|
'courserestricted' => 'Course Restricting Metadata'); |
|
} |
|
|
if (! defined($file_type) || $file_type ne 'portfolio') { |
if (! defined($file_type) || $file_type ne 'portfolio') { |
%fields = |
%fields = |
Line 295 sub portfolio_linked_path {
|
Line 300 sub portfolio_linked_path {
|
my $result = &Apache::portfolio::make_anchor('portfolio','/'); |
my $result = &Apache::portfolio::make_anchor('portfolio','/'); |
my $fullpath = '/'; |
my $fullpath = '/'; |
my (undef,@tree) = split('/',$path); |
my (undef,@tree) = split('/',$path); |
|
my $filename = pop(@tree); |
foreach my $dir (@tree) { |
foreach my $dir (@tree) { |
$fullpath .= $dir.'/'; |
$fullpath .= $dir.'/'; |
$result .= '/'; |
$result .= '/'; |
$result .= &Apache::portfolio::make_anchor($dir,$fullpath); |
$result .= &Apache::portfolio::make_anchor($dir,$fullpath); |
} |
} |
|
$result .= "/$filename"; |
return $result; |
return $result; |
} |
} |
|
|
Line 314 sub portfolio_display_uri {
|
Line 321 sub portfolio_display_uri {
|
$meta_uri .= '.meta'; |
$meta_uri .= '.meta'; |
} |
} |
|
|
my ($path) = ($res_uri =~ m|(.*)/[^/]*$|); |
my ($path) = ($res_uri =~ m|^portfolio(.*/)[^/]*$|); |
|
|
if ($as_links) { |
if ($as_links) { |
$res_uri = &portfolio_linked_path($res_uri); |
$res_uri = &portfolio_linked_path($res_uri); |
Line 1069 sub present_editable_metadata {
|
Line 1076 sub present_editable_metadata {
|
$disuri=~s/^\/\~/\/priv\//; |
$disuri=~s/^\/\~/\/priv\//; |
$disuri=~s/\.meta$//; |
$disuri=~s/\.meta$//; |
my $meta_uri = $disuri; |
my $meta_uri = $disuri; |
|
my $path; |
if ($disuri =~ m|/portfolio/|) { |
if ($disuri =~ m|/portfolio/|) { |
($disuri, $meta_uri) = &portfolio_display_uri($disuri,1); |
($disuri, $meta_uri, $path) = &portfolio_display_uri($disuri,1); |
} |
} |
my $target=$uri; |
my $target=$uri; |
$target=~s/^\/\~/\/res\/$env{'request.role.domain'}\//; |
$target=~s/^\/\~/\/res\/$env{'request.role.domain'}\//; |
Line 1161 ENDEDIT
|
Line 1169 ENDEDIT
|
$Apache::lonpublisher::metadatafields{'copyright'}= |
$Apache::lonpublisher::metadatafields{'copyright'}= |
'default'; |
'default'; |
} |
} |
if ($Apache::lonpublisher::metadatafields{'courserestricted'} ne 'none') { |
if ($file_type eq 'portfolio') { |
$r->print(&mt('Associated with course [_1]','<strong>'.$env{$Apache::lonpublisher::metadatafields{'courserestricted'}.".description"}. |
if ($Apache::lonpublisher::metadatafields{'courserestricted'} ne 'none') { |
'</strong>').'<br />'); |
$r->print(&mt('Associated with course [_1]','<strong>'.$env{$Apache::lonpublisher::metadatafields{'courserestricted'}.".description"}. |
} else { |
'</strong>').'<br />'); |
$r->print("This resource is not associated with a course.<br />"); |
} else { |
} |
$r->print("This resource is not associated with a course.<br />"); |
|
} |
|
} |
foreach my $field_name (@fields) { |
foreach my $field_name (@fields) { |
|
|
if (defined($env{'form.new_'.$field_name})) { |
if (defined($env{'form.new_'.$field_name})) { |
Line 1256 ENDEDIT
|
Line 1266 ENDEDIT
|
|
|
$r->print($output.'<br /><input type="submit" name="store" value="'. |
$r->print($output.'<br /><input type="submit" name="store" value="'. |
&mt('Store Catalog Information').'">'); |
&mt('Store Catalog Information').'">'); |
|
|
|
if ($file_type eq 'portfolio') { |
|
$r->print('</form> |
|
<br /><br /><form method="POST" action="/adm/portfolio">'. |
|
'<input type="hidden" name="currentpath" value="'.$path.'" />'. |
|
'<input type="submit" name="cancel" value="'.&mt('Discard Edits and Return to Portfolio').'">'); |
|
} |
} |
} |
|
|
$r->print('</form>'); |
$r->print('</form>'); |
|
|
return; |
return; |