version 1.149, 2006/08/08 19:36:54
|
version 1.155, 2006/08/12 22:41:53
|
Line 72 sub make_anchor {
|
Line 72 sub make_anchor {
|
foreach my $field_name (keys(%$anchor_fields)) { |
foreach my $field_name (keys(%$anchor_fields)) { |
$anchor .= $field_name.'='.$$anchor_fields{$field_name}.'&'; |
$anchor .= $field_name.'='.$$anchor_fields{$field_name}.'&'; |
} |
} |
$anchor =~ s\&$\\; |
$anchor =~ s/&$//; |
$anchor .= &group_args(); |
$anchor .= &group_args(); |
$anchor .= '">'.$inner_text.'</a>'; |
$anchor .= '">'.$inner_text.'</a>'; |
return $anchor; |
return $anchor; |
Line 132 sub display_common {
|
Line 132 sub display_common {
|
TABLE |
TABLE |
} |
} |
my @tree = split (/\//,$current_path); |
my @tree = split (/\//,$current_path); |
my %anchor_fields = (); |
my %anchor_fields = ( |
%anchor_fields = ( |
|
'selectfile' => $port_path, |
'selectfile' => $port_path, |
'currentpath' => '/', |
'currentpath' => '/', |
'mode' => $env{"form.mode"}, |
'mode' => $env{"form.mode"}, |
Line 145 TABLE
|
Line 144 TABLE
|
my $newCurrentPath = ''; |
my $newCurrentPath = ''; |
for (my $i = 1; $i< @tree; $i++){ |
for (my $i = 1; $i< @tree; $i++){ |
$newCurrentPath .= $tree[$i].'/'; |
$newCurrentPath .= $tree[$i].'/'; |
my %anchor_fields = (); |
my %anchor_fields = ( |
%anchor_fields = ( |
|
'selectfile' => $tree[$i], |
'selectfile' => $tree[$i], |
'currentpath' => '/', |
'currentpath' => '/', |
'mode' => $env{"form.mode"}, |
'mode' => $env{"form.mode"}, |
Line 171 sub display_directory_line {
|
Line 169 sub display_directory_line {
|
$href_location, $url, $current_path, $access_admin_text, $versions)=@_; |
$href_location, $url, $current_path, $access_admin_text, $versions)=@_; |
# my ($filename,$dom,undef,$testdir,undef,undef,undef,undef,$size,undef,$mtime,undef,undef,undef,$obs,undef)=split(/\&/,$line,16); |
# my ($filename,$dom,undef,$testdir,undef,undef,undef,undef,$size,undef,$mtime,undef,undef,undef,$obs,undef)=split(/\&/,$line,16); |
$r->print('<tr class="'.$css_class.'">'); |
$r->print('<tr class="'.$css_class.'">'); |
$r->print($line); |
$r->print($line); # contains first two cells of table |
$r->print('<td><img alt="" src="'.&Apache::loncommon::icon($filename).'" /></td>'); |
$filename = $filename; |
$r->print('<td>'.$$version_flag{$filename}.'</td><td><a href="'.$href_location.$filename.'">'. |
$filename = &prepend_group($filename); |
$filename.'</a></td>'); |
my $lock_info; |
|
if ($$version_flag{$filename}) { # versioned can't be versioned, so TRUE when root file |
|
$r->print('<td><img alt="" src="'.&Apache::loncommon::icon($filename).'" /></td>'); |
|
$r->print('<td>'.$$version_flag{$filename}.'</td>'); |
|
} else { # this is a graded or handed back file |
|
my ($user,$domain) = &get_name_dom(); |
|
my $permissions_hash = &Apache::lonnet::get_portfile_permissions($domain,$user); |
|
if (defined($filename) && defined($$permissions_hash{'/'.$filename})) { |
|
foreach my $array_item (@{$$permissions_hash{'/'.$filename}}) { |
|
if (ref($array_item) eq 'ARRAY') { |
|
if ($$array_item[(@$array_item - 1)] eq 'handback') { |
|
$lock_info = 'Handback'; |
|
} elsif ($$array_item[(@$array_item - 1)] eq 'graded') { |
|
$lock_info = 'Graded'; |
|
} |
|
} |
|
} |
|
} |
|
if ($lock_info) { |
|
my %anchor_fields = ( |
|
'lockinfo' => '/'.$filename |
|
); |
|
$lock_info = &make_anchor(undef,\%anchor_fields,$lock_info); |
|
} |
|
$r->print('<td colspan="2">'.$lock_info.'</td>'); |
|
} |
|
# $r->print('<td>'.$$version_flag{$filename}.'</td><td>'); |
|
$r->print('<td>'.&make_anchor($href_location.$filename,undef,$filename).'</td>'); |
$r->print('<td>'.$size.'</td>'); |
$r->print('<td>'.$size.'</td>'); |
$r->print('<td>'.&Apache::lonlocal::locallocaltime($mtime).'</td>'); |
$r->print('<td>'.&Apache::lonlocal::locallocaltime($mtime).'</td>'); |
if ($select_mode ne 'true') { |
if ($select_mode ne 'true') { |
$r->print('<td><span style="white-space: nowrap">'. |
$r->print('<td><span style="white-space: nowrap">'. |
&mt($curr_access).' '); |
&mt($curr_access).' '); |
$r->print('<a href="'.$url.'?access='.$filename. |
my %anchor_fields = ( |
'&currentpath='.$current_path.&group_args(). |
'access' => $filename, |
'">'.$access_admin_text.'</a></span></td>'); |
'currentpath' => $current_path |
|
); |
|
$r->print(&make_anchor($url, \%anchor_fields, $access_admin_text).'</span></td>'); |
} |
} |
$r->print('</tr>'.$/); |
$r->print('</tr>'.$/); |
} |
} |
Line 268 sub display_directory {
|
Line 295 sub display_directory {
|
$show_versions = 'true'; |
$show_versions = 'true'; |
} |
} |
if (exists($versioned{$filename})) { |
if (exists($versioned{$filename})) { |
|
my %anchor_fields = ( |
|
'selectfile' => $filename, |
|
'continue' => 'false', |
|
'currentpath' => $current_path, |
|
); |
if ($show_versions) { |
if ($show_versions) { |
$version_flag{$filename} = '<a href="portfolio?selectfile='.$filename.'&continue=false&currentpath='.$current_path.'"><img class="LC_icon" alt="'.&mt('opened folder').'" src="'.$iconpath.'folder_pointer_opened.gif" /></a>'; |
$version_flag{$filename} = &make_anchor('portfolio',\%anchor_fields, |
|
'<img class="LC_icon" alt="'.&mt('opened folder').'" src="'.$iconpath.'folder_pointer_opened.gif" />'); |
} else { |
} else { |
$version_flag{$filename} = '<a href="portfolio?selectfile='.$filename.'&continue=false&currentpath='.$current_path.'&showversions='.$filename.'"><img class="LC_icon" alt="'.&mt('closed folder').'" src="'.$iconpath.'folder_pointer_closed.gif" /></a>'; |
$anchor_fields{'showversions'} = $filename; |
|
$version_flag{$filename} = &make_anchor('portfolio',\%anchor_fields, |
|
'<img class="LC_icon" alt="'.&mt('closed folder').'" src="'.$iconpath.'folder_pointer_closed.gif" />'); |
} |
} |
} else { |
} else { |
$version_flag{$filename} = ' '; |
$version_flag{$filename} = ' '; |
Line 283 sub display_directory {
|
Line 318 sub display_directory {
|
} |
} |
$r->print('<tr class="LC_browser_folder"><td '.$colspan.'><img alt="'.&mt('closed folder').'" src="'.$iconpath.'folder_closed.gif" /></td>'); |
$r->print('<tr class="LC_browser_folder"><td '.$colspan.'><img alt="'.&mt('closed folder').'" src="'.$iconpath.'folder_closed.gif" /></td>'); |
$r->print('<td>Go to ...</td>'); |
$r->print('<td>Go to ...</td>'); |
my %anchor_fields = (); |
my %anchor_fields = ( |
%anchor_fields = ( |
|
'selectfile' => $filename.'/', |
'selectfile' => $filename.'/', |
'currentpath' => $current_path.$filename.'/', |
'currentpath' => $current_path.$filename.'/', |
'mode' => $env{"form.mode"}, |
'mode' => $env{"form.mode"}, |
Line 306 sub display_directory {
|
Line 340 sub display_directory {
|
$line.=' /></td>'; |
$line.=' /></td>'; |
} else { |
} else { |
if (exists $locked_files{$fullpath}) { |
if (exists $locked_files{$fullpath}) { |
$line.='<td colspan="2"><a href="'.$url.'?lockinfo='.$current_path.$filename.&group_args().'">Locked</a></td>'; |
my %anchor_fields = ( |
|
'lockinfo' => $current_path.$filename |
|
); |
|
$line.='<td colspan="2">'.&make_anchor($url,\%anchor_fields,'Locked').'</td>'; |
$css_class= 'LC_browser_file_locked'; |
$css_class= 'LC_browser_file_locked'; |
} else { |
} else { |
if (!$can_modify) { |
if (!$can_modify) { |
Line 320 sub display_directory {
|
Line 357 sub display_directory {
|
if ($can_modify) { |
if ($can_modify) { |
my $cat='<img class="LC_icon" alt="'.&mt('Catalog Information'). |
my $cat='<img class="LC_icon" 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>'; |
my %anchor_fields = ( |
$line .= '</td><td>'.'<a href="'.$href_edit_location.$filename.'.meta">'.$cat.'</a>'; |
'rename' => $filename, |
|
currentpath => $current_path |
|
); |
|
$line .= &make_anchor($url,\%anchor_fields,'Rename'); |
|
$line .= '</td><td>'.&make_anchor($href_edit_location.$filename.'.meta',undef,$cat); |
|
# '<a href="'.$href_edit_location.$filename.'.meta">'.$cat.'</a>'; |
} |
} |
$line .= '</td>'; |
$line .= '</td>'; |
} |
} |
Line 459 sub done {
|
Line 501 sub done {
|
unless (defined $message) { |
unless (defined $message) { |
$message='Done'; |
$message='Done'; |
} |
} |
my $result = '<h3><a href="'.$url.'?currentpath='. |
my %anchor_fields = ( |
$env{'form.currentpath'}. |
'currentpath' => $env{'form.currentpath'}, |
'&fieldname='.$env{'form.fieldname'}. |
'fieldname' => $env{'form.fieldname'}, |
'&mode='.$env{'form.mode'}. |
'mode' => $env{'form.mode'} |
&group_args(); |
); |
$result .= '">'.&mt($message).'</a></h3>'; |
my $result = '<h3>'.&make_anchor($url,\%anchor_fields,&mt($message)).'</h3>'; |
return $result; |
return $result; |
} |
} |
|
|
Line 600 sub display_access {
|
Line 642 sub display_access {
|
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 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.'); |
|
$info .= '<br /><ul><li>'.&mt('Public files are available to anyone without the need for login.'); |
|
$info .= '</li><li>'.&mt('Passphrase-protected files do not require log-in, but will require the viewer to enter the passphrase you set.'); |
|
$info .= '</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 />'; |
|
$info .= &mt('The conditions can include affiliation with a particular course or group, or a user account in a specific domain.').'<br />'; |
|
$info .= &mt('Alternatively access can be granted to people with specific LON-CAPA usernames and domains.').'</li></ul>'; |
if ($group eq '') { |
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>")); |
$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>")); |
} |
} |
Line 646 sub view_access_settings {
|
Line 692 sub view_access_settings {
|
} else { |
} else { |
$r->print(&mt('No access control settings currently exist for this file.<br />' )); |
$r->print(&mt('No access control settings currently exist for this file.<br />' )); |
} |
} |
$r->print('<br /><a href="'.$url.'?currentpath='.$env{'form.currentpath'}. |
my %anchor_fields = ( |
&group_args().'">'.&mt('Return to directory listing').'</a>'); |
'currentpath' => $env{'form.currentpath'} |
|
); |
|
$r->print('<br />'.&make_anchor($url, \%anchor_fields, &mt('Return to directory listing'))); |
return; |
return; |
} |
} |
|
|
Line 871 sub update_access {
|
Line 919 sub update_access {
|
} |
} |
&close_form($r,$url); |
&close_form($r,$url); |
} else { |
} else { |
$r->print('<br /><a href="'.$url.'?access='.$env{'form.selectfile'}. |
my %anchor_fields = ( |
'&currentpath='.$env{'form.currentpath'}.&group_args().'">'. |
'currentpath' => $env{'form.currentpath'}, |
&mt('Display all access settings for this file').'</a>'. |
'access' => $env{'form.selectfile'} |
' '. |
); |
'<a href="'.$url.'?currentpath='.$env{'form.currentpath'}. |
$r->print('<br />'.&make_anchor($url, \%anchor_fields, &mt('Display all access settings for this file'))); |
&group_args().'">'.&mt('Return to directory listing').'</a>'); |
delete $anchor_fields{'access'}; |
|
$r->print(' '.&make_anchor($url,\%anchor_fields,&mt('Return to directory listing'))); |
} |
} |
return; |
return; |
} |
} |
Line 1568 sub lock_info {
|
Line 1617 sub lock_info {
|
} else { |
} else { |
$filetext = '<strong>'.$file_name.'</strong>'; |
$filetext = '<strong>'.$file_name.'</strong>'; |
} |
} |
$r->print(&mt('[_1] was submitted in response to problem: ', |
if ($$array_item[(@$array_item - 1)] eq 'graded') { |
|
$r->print(&mt('[_1] was submitted in response to problem: ', |
|
$filetext). |
|
'<strong>'.&Apache::lonnet::gettitle($$array_item[0]). |
|
'</strong><br />'); |
|
my %course_description = &Apache::lonnet::coursedescription($$array_item[1]); |
|
$r->print(&mt('In the course: <strong>[_1]</strong><br />', |
|
$course_description{'description'})); |
|
} elsif ($$array_item[(@$array_item - 1)] eq 'handback') { |
|
$r->print(&mt('[_1] was handed back in response to problem: ', |
$filetext). |
$filetext). |
'<strong>'.&Apache::lonnet::gettitle($$array_item[0]). |
'<strong>'.&Apache::lonnet::gettitle($$array_item[0]). |
'</strong><br />'); |
'</strong><br />'); |
my %course_description = &Apache::lonnet::coursedescription($$array_item[1]); |
my %course_description = &Apache::lonnet::coursedescription($$array_item[1]); |
$r->print(&mt('In the course: <strong>[_1]</strong><br />', |
$r->print(&mt('In the course: <strong>[_1]</strong><br />', |
$course_description{'description'})); |
$course_description{'description'})); |
|
|
|
} |
# $r->print('the third is '.$$array_item[2].'<br>'); |
# $r->print('the third is '.$$array_item[2].'<br>'); |
# $r->print("item is $$array_item[0]<br> and $$array_item[0]"); |
# $r->print("item is $$array_item[0]<br> and $$array_item[0]"); |
} |
} |