version 1.140, 2006/07/30 19:38:13
|
version 1.145, 2006/08/04 21:44:19
|
Line 294 sub display_directory {
|
Line 294 sub display_directory {
|
my $cat='<img alt="'.&mt('Catalog Information'). |
my $cat='<img alt="'.&mt('Catalog Information'). |
'" src="'.&Apache::loncommon::lonhttpdurl('/res/adm/pages/catalog.gif').'" />'; |
'" src="'.&Apache::loncommon::lonhttpdurl('/res/adm/pages/catalog.gif').'" />'; |
$line .= '<a href="'.$url.'?rename='.$filename.'&currentpath='.$current_path.&group_args().'">Rename</a>'; |
$line .= '<a href="'.$url.'?rename='.$filename.'&currentpath='.$current_path.&group_args().'">Rename</a>'; |
$line .= '</td><td>'.$version_flag{$filename}.'<a href="'.$href_edit_location.$filename.'.meta">'.$cat.'</a>'; |
$line .= '</td><td>'.'<a href="'.$href_edit_location.$filename.'.meta">'.$cat.'</a>'; |
} |
} |
$line .= '</td>'; |
$line .= '</td>'; |
} |
} |
Line 339 sub display_directory {
|
Line 339 sub display_directory {
|
foreach my $dir_line (@version_lines) { |
foreach my $dir_line (@version_lines) { |
my ($v_filename,$dom,$testdir,$size,$mtime,$obs) = @$dir_line; |
my ($v_filename,$dom,$testdir,$size,$mtime,$obs) = @$dir_line; |
my ($v_fname,$version,$v_extension) = &Apache::grades::file_name_version_ext($v_filename); |
my ($v_fname,$version,$v_extension) = &Apache::grades::file_name_version_ext($v_filename); |
|
$line = '<td colspan="2"> </td>'; |
if (($v_fname eq $fname)&&($v_extension eq $extension)) { |
if (($v_fname eq $fname)&&($v_extension eq $extension)) { |
&display_directory_line($r,$select_mode,$fullpath, $v_filename, $mtime, $size, |
&display_directory_line($r,$select_mode,$fullpath, $v_filename, $mtime, $size, |
$css_class, $line, \%access_controls, $curr_access, $now, |
$css_class, $line, \%access_controls, $curr_access, $now, |
Line 571 sub display_access {
|
Line 572 sub display_access {
|
$uname); |
$uname); |
my %access_controls = &Apache::lonnet::get_access_controls($current_permissions,$group,$file_name); |
my %access_controls = &Apache::lonnet::get_access_controls($current_permissions,$group,$file_name); |
my $aclcount = keys(%access_controls); |
my $aclcount = keys(%access_controls); |
my $header = '<h3>'.&mt('Allowing others to retrieve portfolio file: [_1]',$port_path.$env{'form.currentpath'}.$env{'form.access'}).'</h3>'; |
my $header = '<h3>'.&mt('Allowing others to retrieve file: [_1]',$port_path.$env{'form.currentpath'}.$env{'form.access'}).'</h3>'; |
my $info .= &mt('Access to this file by others can be set to be one or more of the following types: public, passphrase-protected or conditional.').'<br /><ul><li>'.&mt('Public files are available to anyone without the need for login.').'</li><li>'.&mt('Passphrase-protected files do not require log-in, but will require the viewer to enter the passphrase you set.').'</li><li>'.&mt('Conditional files are accessible to logged-in users with accounts in the LON-CAPA network, who satisfy the conditions you set.').'<br />'.&mt('The conditions can include affiliation with a particular course or group, or a user account in a specific domain.').'<br />'.&mt('Alternatively access can be granted to people with specific LON-CAPA usernames and domains.').'</li></ul>'; |
my $info .= &mt('Access to this file by others can be set to be one or more of the following types: public, passphrase-protected or conditional.').'<br /><ul><li>'.&mt('Public files are available to anyone without the need for login.').'</li><li>'.&mt('Passphrase-protected files do not require log-in, but will require the viewer to enter the passphrase you set.').'</li><li>'.&mt('Conditional files are accessible to logged-in users with accounts in the LON-CAPA network, who satisfy the conditions you set.').'<br />'.&mt('The conditions can include affiliation with a particular course or group, or a user account in a specific domain.').'<br />'.&mt('Alternatively access can be granted to people with specific LON-CAPA usernames and domains.').'</li></ul>'; |
|
|
|
if ($group eq '') { |
|
$info .= (&mt("Direct others to the 'Display file listing' link (shown when there are viewable files) on your personal information page:<br /><a href='/adm/$udom/$uname/aboutme'>http://$ENV{'SERVER_NAME'}/adm/$udom/$uname/aboutme</a>")); |
|
} |
|
|
if ($can_setacl) { |
if ($can_setacl) { |
&open_form($r,$url); |
&open_form($r,$url); |
$r->print($header.$info); |
$r->print($header.$info); |
Line 747 sub update_access {
|
Line 753 sub update_access {
|
} |
} |
} |
} |
my $file_name = $env{'form.currentpath'}.$env{'form.selectfile'}; |
my $file_name = $env{'form.currentpath'}.$env{'form.selectfile'}; |
$r->print('<h3>'.&mt('Allowing others to retrieve portfolio file: [_1]', |
$r->print('<h3>'.&mt('Allowing others to retrieve file: [_1]', |
$port_path.$file_name).'</h3>'."\n"); |
$port_path.$file_name).'</h3>'."\n"); |
$file_name = &prepend_group($file_name); |
$file_name = &prepend_group($file_name); |
my ($uname,$udom) = &get_name_dom(); |
my ($uname,$udom) = &get_name_dom(); |
Line 1470 sub upload {
|
Line 1476 sub upload {
|
} |
} |
} |
} |
$fname=&Apache::lonnet::clean_filename($fname); |
$fname=&Apache::lonnet::clean_filename($fname); |
|
|
my $portfolio_root=&get_portfolio_root(); |
my $portfolio_root=&get_portfolio_root(); |
my ($uname,$udom) = &get_name_dom(); |
my ($uname,$udom) = &get_name_dom(); |
my $port_path = &get_port_path(); |
my $port_path = &get_port_path(); |
Line 1484 sub upload {
|
Line 1489 sub upload {
|
$file_name = $env{'form.currentpath'}.$file_name; |
$file_name = $env{'form.currentpath'}.$file_name; |
$file_name = &prepend_group($file_name); |
$file_name = &prepend_group($file_name); |
$found_file = 1; |
$found_file = 1; |
# FIXME I think this is incorrect, prepend_group took care of this? |
|
if (defined($group)) { |
|
$file_name = $group.'/'.$file_name; |
|
} |
|
if (&Apache::lonnet::is_locked($file_name,$udom,$uname) eq 'true') { |
if (&Apache::lonnet::is_locked($file_name,$udom,$uname) eq 'true') { |
$locked_file = 1; |
$locked_file = 1; |
} |
} |
Line 1594 sub createdir {
|
Line 1595 sub createdir {
|
} |
} |
|
|
sub get_portfolio_root { |
sub get_portfolio_root { |
my ($uname,$udom) = &get_name_dom(); |
my ($udom,$uname) = @_; |
|
if (!defined($uname) || !defined($udom)) { |
|
($uname,$udom) = &get_name_dom(); |
|
} |
my $path; |
my $path; |
if (defined($env{'form.group'})) { |
if (defined($env{'form.group'})) { |
$path = '/userfiles/groups/'.$env{'form.group'}.'/portfolio'; |
$path = '/userfiles/groups/'.$env{'form.group'}.'/portfolio'; |