--- loncom/interface/portfolio.pm 2006/07/19 10:26:43 1.121.2.6 +++ loncom/interface/portfolio.pm 2006/07/02 23:15:47 1.127 @@ -1,7 +1,7 @@ # The LearningOnline Network # portfolio browser # -# $Id: portfolio.pm,v 1.121.2.6 2006/07/19 10:26:43 albertel Exp $ +# $Id: portfolio.pm,v 1.127 2006/07/02 23:15:47 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -36,7 +36,6 @@ use Apache::lonfeedback; use Apache::lonlocal; use Apache::lonnet; use Apache::longroup; -use Apache::lonhtmlcommon; use HTML::Entities; use LONCAPA; @@ -527,7 +526,7 @@ sub rename_confirmed { } sub display_access { - my ($r,$url,$group,$can_setacl,$port_path) = @_; + my ($r,$url,$group,$can_setacl) = @_; my ($uname,$udom) = &get_name_dom($group); my $file_name = $env{'form.currentpath'}.$env{'form.access'}; $file_name = &prepend_group($file_name,$group); @@ -535,23 +534,8 @@ sub display_access { $uname); my %access_controls = &Apache::lonnet::get_access_controls($current_permissions,$group,$file_name); my $aclcount = keys(%access_controls); - my $header = '

'.&mt('Allowing others to retrieve portfolio file: [_1]', - $port_path.$env{'form.currentpath'}. - $env{'form.access'}).'

'; - 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.'). - '
'; + my $header = '

'.&mt('Allowing others to retrieve portfolio file: [_1]',$env{'form.currentpath'}.$env{'form.access'}).'

'; + 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.').'
'; if ($can_setacl) { &open_form($r,$url); $r->print($header.$info); @@ -706,7 +690,7 @@ sub build_access_summary { sub update_access { - my ($r,$url,$group,$port_path) = @_; + my ($r,$url,$group) = @_; my $totalprocessed = 0; my %processing; my %title = ( @@ -732,7 +716,7 @@ sub update_access { } my $file_name = $env{'form.currentpath'}.$env{'form.selectfile'}; $r->print('

'.&mt('Allowing others to retrieve portfolio file: [_1]', - $port_path.$file_name).'

'."\n"); + $file_name).''."\n"); $file_name = &prepend_group($file_name,$group); my ($uname,$udom) = &get_name_dom($group); my ($errors,$outcome,$deloutcome,$new_values,$translation); @@ -828,10 +812,7 @@ sub update_access { } $r->print('
'. - &mt('Display all access settings for this file').''. - '     '. - ''.&mt('Return to directory listing').''); + &mt('Display all access settings for this file').''); } return; } @@ -1001,25 +982,24 @@ sub access_setting_table { $passwd.'" />'); $r->print(&Apache::loncommon::end_data_table_row()); $r->print(&Apache::loncommon::end_data_table()); - - #$r->print(' '); - #&access_element($r,'domains',\%acl_count,\@domains,$access_controls,$now,$then); - #$r->print(' '); - #&access_element($r,'users',\%acl_count,\@users,$access_controls,$now,$then); - #$r->print(''); - #if (@courses > 0 || @groups > 0) { - # $r->print(''); - #} else { - # $r->print(''); - #} - #&access_element($r,'course',\%acl_count,\@courses,$access_controls,$now,$then); - #$r->print(''); - #if (@courses > 0 || @groups > 0) { - # $r->print(' '); - #} else { - # $r->print(' '); - #} - #&access_element($r,'group',\%acl_count,\@groups,$access_controls,$now,$then); + $r->print(' '); + &access_element($r,'domains',\%acl_count,\@domains,$access_controls,$now,$then); + $r->print(' '); + &access_element($r,'users',\%acl_count,\@users,$access_controls,$now,$then); + $r->print(''); + if (@courses > 0 || @groups > 0) { + $r->print(''); + } else { + $r->print(''); + } + &access_element($r,'course',\%acl_count,\@courses,$access_controls,$now,$then); + $r->print(''); + if (@courses > 0 || @groups > 0) { + $r->print(' '); + } else { + $r->print(' '); + } + &access_element($r,'group',\%acl_count,\@groups,$access_controls,$now,$then); $r->print(''); } @@ -1428,7 +1408,11 @@ ENDSMP fileList = fileList + document.forms.checkselect.currentpath.value + document.forms.checkselect[i].value + "," ; } } - opener.document.forms.lonhomework.$env{'form.fieldname'}.value=fileList; + opener.document.forms.lonhomework. +ENDSMP + $javascript .= $env{'form.fieldname'}; + $javascript .= (< @@ -1688,24 +1672,6 @@ sub missing_priv { return; } -sub coursegrp_portfolio_header { - my ($cdom,$cnum,$group,$grp_desc)=@_; - my $gpterm = &Apache::loncommon::group_term(); - my $ucgpterm = $gpterm; - $ucgpterm =~ s/^(\w)/uc($1)/e; - &Apache::lonhtmlcommon::add_breadcrumb - ({href=>"/adm/$cdom/$cnum/$group/smppg", - text=>"$ucgpterm: $grp_desc", - title=>"Go to group's home page"}, - {href=>"//?group=$group", - text=>"Group Portfolio", - title=>"Display group portfolio"},); - my $output = &Apache::lonhtmlcommon::breadcrumbs( - &mt('[_1] portfolio files - [_2]',$gpterm,$grp_desc)); - return $output; -} - - sub handler { # this handles file management my $r = shift; @@ -1713,7 +1679,7 @@ sub handler { ['selectfile','currentpath','meta','lockinfo','currentfile','action', 'fieldname','mode','rename','continue','group','access','setnum', 'cnum','cdom','type','setroles']); - my ($uname,$udom,$portfolio_root,$url,$group,$caller,$title,$grp_desc); + my ($uname,$udom,$portfolio_root,$url,$group,$caller,$title); if ($r->uri =~ m|^(/adm/)([^/]+)|) { $url = $1.$2; $caller = $2; @@ -1737,9 +1703,6 @@ sub handler { my %curr_groups = &Apache::longroup::coursegroups($udom,$uname, $group); if (%curr_groups) { - my %grp_content = &Apache::longroup::get_group_settings( - $curr_groups{$group}); - $grp_desc = &unescape($grp_content{'description'}); if (($view_permission) || (&Apache::lonnet::allowed('rgf', $env{'request.course.id'}.'/'.$group))) { $portfolio_root = &get_portfolio_root($group); @@ -1786,7 +1749,6 @@ sub handler { $can_setacl = 1; } - my $port_path = &get_port_path($group); &Apache::loncommon::no_cache($r); &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; @@ -1864,10 +1826,10 @@ sub handler { } elsif ($env{'form.access'}) { $env{'form.selectfile'} = $env{'form.access'}; $env{'form.action'} = 'chgaccess'; - &display_access($r,$url,$group,$can_setacl,$port_path); + &display_access($r,$url,$group,$can_setacl); } elsif ($env{'form.action'} eq 'chgaccess') { if ($can_setacl) { - &update_access($r,$url,$group,$port_path); + &update_access($r,$url,$group); } else { &missing_priv($r,$url,'setacl',$group); } @@ -1890,10 +1852,6 @@ sub handler { if ($env{'form.currentpath'}) { $current_path = $env{'form.currentpath'}; } - if ($caller eq 'coursegrp_portfolio') { - &Apache::lonhtmlcommon::clear_breadcrumbs(); - $r->print(&coursegrp_portfolio_header($udom,$uname,$group,$grp_desc)); - } my @dir_list=&get_dir_list($portfolio_root,$group); if ($dir_list[0] eq 'no_such_dir'){ # two main reasons for this: