version 1.165, 2006/08/08 19:35:53
|
version 1.169, 2006/08/16 18:02:01
|
Line 287 sub portfolio_linked_path {
|
Line 287 sub portfolio_linked_path {
|
if ($group) { |
if ($group) { |
$start = "groups/$group/".$start; |
$start = "groups/$group/".$start; |
} |
} |
my %anchor_fields; |
my %anchor_fields = ( |
%anchor_fields = ( |
|
'selectfile' => $start, |
'selectfile' => $start, |
'currentpath' => '/' |
'currentpath' => '/' |
); |
); |
Line 299 sub portfolio_linked_path {
|
Line 298 sub portfolio_linked_path {
|
foreach my $dir (@tree) { |
foreach my $dir (@tree) { |
$fullpath .= $dir.'/'; |
$fullpath .= $dir.'/'; |
$result .= '/'; |
$result .= '/'; |
my %anchor_fields = (); |
my %anchor_fields = ( |
%anchor_fields = ( |
|
'selectfile' => $dir, |
'selectfile' => $dir, |
'currentpath' => $fullpath |
'currentpath' => $fullpath |
); |
); |
Line 367 sub pre_select_course {
|
Line 365 sub pre_select_course {
|
$r->print('<p>'.&mt('If you would like to associate this resource ([_1]) with a current or previous course, please select one from the list below, otherwise select, \'None\'','<tt>'.$res_uri.'</tt>').'</p>'); |
$r->print('<p>'.&mt('If you would like to associate this resource ([_1]) with a current or previous course, please select one from the list below, otherwise select, \'None\'','<tt>'.$res_uri.'</tt>').'</p>'); |
$output = &select_course(); |
$output = &select_course(); |
$r->print($output.'<br /><input type="submit" name="store" value="'. |
$r->print($output.'<br /><input type="submit" name="store" value="'. |
&mt('Associate Resource With Selected Course').'">'); |
&mt('Associate Resource With Selected Course').'" />'); |
|
$r->print('<input type="hidden" name="currentpath" value="'.$env{'form.currentpath'}.'" />'); |
|
$r->print('<input type="hidden" name="associate" value="true" />'); |
$r->print('</form>'); |
$r->print('</form>'); |
|
|
my ($port_path,$group) = &get_port_path_and_group($uri); |
my ($port_path,$group) = &get_port_path_and_group($uri); |
$r->print('<br /><br /><form method="POST" action="'.$port_path.'">'. |
my $group_input; |
|
if ($group) { |
|
$group_input = '<input type="hidden" name="group" value="'.$group.'" />'; |
|
} |
|
$r->print('<br /><br /><form method="post" action="'.$port_path.'">'. |
'<input type="hidden" name="currentpath" value="'.$path.'" />'. |
'<input type="hidden" name="currentpath" value="'.$path.'" />'. |
'<input type="hidden" name="group" value="'.$group.'" />'. |
$group_input. |
'<input type="submit" name="cancel" value="'.&mt('Cancel').'">'. |
'<input type="submit" name="cancel" value="'.&mt('Cancel').'" />'. |
'</form>'); |
'</form>'); |
|
|
return; |
return; |
Line 716 sub prettyinput {
|
Line 720 sub prettyinput {
|
sub handler { |
sub handler { |
my $r=shift; |
my $r=shift; |
# |
# |
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
|
['currentpath']); |
my $uri=$r->uri; |
my $uri=$r->uri; |
# |
# |
# Set document type |
# Set document type |
Line 1141 sub present_editable_metadata {
|
Line 1147 sub present_editable_metadata {
|
my $goback=&mt('Back to Source File'); |
my $goback=&mt('Back to Source File'); |
$r->print(<<ENDBOMBS); |
$r->print(<<ENDBOMBS); |
<h1>$disuri</h1> |
<h1>$disuri</h1> |
<form method="post" name="defaultmeta"> |
<form method="post" action="" name="defaultmeta"> |
ENDBOMBS |
ENDBOMBS |
if ($showdel) { |
if ($showdel) { |
$r->print(<<ENDDEL); |
$r->print(<<ENDDEL); |
Line 1171 ENDDEL
|
Line 1177 ENDDEL
|
} |
} |
$r->print(<<ENDEDIT); |
$r->print(<<ENDEDIT); |
<h1>$displayfile</h1> |
<h1>$displayfile</h1> |
<form method="post" name="defaultmeta"> |
<form method="post" action="" name="defaultmeta"> |
ENDEDIT |
ENDEDIT |
$r->print('<script language="JavaScript">'. |
$r->print('<script type="JavaScript">'. |
&Apache::loncommon::browser_and_searcher_javascript(). |
&Apache::loncommon::browser_and_searcher_javascript(). |
'</script>'); |
'</script>'); |
my %lt=&fieldnames($file_type); |
my %lt=&fieldnames($file_type); |
Line 1280 ENDEDIT
|
Line 1286 ENDEDIT
|
if ($fn =~ m|^$Apache::lonnet::perlvar{'lonDocRoot'}/userfiles/portfolio/|) { |
if ($fn =~ m|^$Apache::lonnet::perlvar{'lonDocRoot'}/userfiles/portfolio/|) { |
my ($path, $new_fn) = ($fn =~ m|/(portfolio.*)/([^/]*)$|); |
my ($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'}) { |
|
$r->print(&Apache::portfolio::done("return",'/adm/portfolio')); |
|
return; |
|
} |
} elsif ($fn =~ m|^$Apache::lonnet::perlvar{'lonDocRoot'}/userfiles/groups/\w+/portfolio/|) { |
} elsif ($fn =~ m|^$Apache::lonnet::perlvar{'lonDocRoot'}/userfiles/groups/\w+/portfolio/|) { |
my ($path, $new_fn) = ($fn =~ m|/(groups/\w+/portfolio.*)/([^/]*)$|); |
my ($path, $new_fn) = ($fn =~ m|/(groups/\w+/portfolio.*)/([^/]*)$|); |
$r->print(&store_portfolio_metadata($formname,$file_content,$path,$new_fn)); |
$r->print(&store_portfolio_metadata($formname,$file_content,$path,$new_fn)); |
|
unless ($env{'form.associate'}) { |
|
$r->print(&Apache::portfolio::done("return",'/adm/portfolio')); |
|
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">'. |
Line 1295 ENDEDIT
|
Line 1309 ENDEDIT
|
' '.&Apache::lonlocal::locallocaltime(time). |
' '.&Apache::lonlocal::locallocaltime(time). |
'</font></p>'); |
'</font></p>'); |
} |
} |
|
unless ($env{'form.associate'}) { |
|
$r->print(&Apache::portfolio::done("return",'/adm/portfolio')); |
|
return; |
|
} |
} |
} |
} |
} |
|
|
$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') { |
if ($file_type eq 'portfolio') { |
my ($port_path,$group) = &get_port_path_and_group($uri); |
my ($port_path,$group) = &get_port_path_and_group($uri); |
if ($group) { |
if ($group) { |
$r->print('<input type="hidden" name="group" value="'.$group.'" />'); |
$r->print('<input type="hidden" name="group" value="'.$group.'" />'); |
} |
} |
|
$r->print('<input type="hidden" name="currentpath" value="'.$env{'form.currentpath'}.'" />'); |
$r->print('</form> |
$r->print('</form> |
<br /><br /><form method="POST" action="'.$port_path.'">'. |
<br /><br /><form method="post" action="'.$port_path.'">'. |
'<input type="hidden" name="group" value="'.$group.'" />'. |
'<input type="hidden" name="group" value="'.$group.'" />'. |
'<input type="hidden" name="currentpath" value="'.$path.'" />'. |
'<input type="hidden" name="currentpath" value="'.$path.'" />'. |
'<input type="submit" name="cancel" value="'.&mt('Discard Edits and Return to Portfolio').'">'); |
'<input type="submit" name="cancel" value="'.&mt('Discard Edits and Return to Portfolio').'" />'); |
} |
} |
} |
} |
|
|