--- loncom/interface/portfolio.pm 2006/11/01 02:03:16 1.167 +++ loncom/interface/portfolio.pm 2007/06/11 20:56:38 1.181 @@ -1,7 +1,7 @@ # The LearningOnline Network # portfolio browser # -# $Id: portfolio.pm,v 1.167 2006/11/01 02:03:16 rezaferry Exp $ +# $Id: portfolio.pm,v 1.181 2007/06/11 20:56:38 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -95,13 +95,12 @@ sub display_common { 'createdir_label' => 'Create subdirectory in current directory:'); my $escuri = &HTML::Entities::encode($r->uri,'&<>"'); - my $help_fileupload = &Apache::loncommon::help_open_topic('Portfolio AddFiles'); - my $help_createdir = &Apache::loncommon::help_open_topic('Portfolio CreateDirectory'); - - # TO BE DEPRECATED: This line should be deleted once Portfolio uses breadcrumbs - $r->print(&Apache::loncommon::help_open_topic('Portfolio About', 'Help on the portfolio')); - # END LINE TO BE DEPRECATED + my $help_fileupload = &Apache::loncommon::help_open_topic('Portfolio AddFiles'); + my $help_createdir = &Apache::loncommon::help_open_topic('Portfolio CreateDirectory'); + # FIXME: This line should be deleted once Portfolio uses breadcrumbs + $r->print(&Apache::loncommon::help_open_topic('Portfolio About', 'Help on the portfolio')); + $r->print(<<"TABLE");
'); - &access_element($r,'domains',\%acl_count,\@domains,$access_controls,$now,$then); + $r->print(' | |||||
');
+ my $numconditionals = 0;
+ my $conditionstext;
+ my %cond_status;
+ foreach my $scope ('domains','users','course') {
+ $numconditionals += $acl_count->{$scope};
+ if ($acl_count->{$scope} > 0) {
+ if ($conditionstext ne 'Active') {
+ foreach my $key (keys(%{$conditionals{$scope}})) {
+ $conditionstext = &acl_status($start->{$key},$end->{$key},$now);
+ if ($conditionstext eq 'Active') {
+ last;
+ }
+ }
+ }
+ }
+ }
+ if ($conditionstext eq '') {
+ $conditionstext = 'Off';
+ }
+ my %anchor_fields = (
+ 'access' => $env{'form.selectfile'},
+ 'action' => 'chgconditions',
+ 'currentpath' => $env{'form.currentpath'},
+ );
+ $r->print(''.&mt('Conditional access: [_1]',$conditionstext).''); + if ($numconditionals > 0) { + my $count = 1; + my $chg = 'none'; + $r->print(&mt('You have previously set [_1] conditional access controls.',$numconditionals).' '.&make_anchor($url,\%anchor_fields,&mt('Change Conditions')).''); + $r->print(&Apache::loncommon::start_data_table()); + $r->print(&Apache::loncommon::start_data_table_header_row()); + $r->print(' | '.&mt('Access control').' | '.&mt('Dates available'). + ' | '.&mt('Additional information').' | '); + $r->print(&Apache::loncommon::end_data_table_header_row()); + &build_access_summary($r,$count,$chg,%conditionals); + $r->print(&Apache::loncommon::end_data_table()); + } else { + $r->print(&make_anchor($url,\%anchor_fields,&mt('Add conditional access')).' '.&mt('based on domain, username, or course affiliation.')); + } +} + +sub condition_setting { + my ($r,$access_controls,$now,$then,$acl_count,$domains,$users,$courses) = @_; + $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); + &access_element($r,'users',$acl_count,$users,$access_controls,$now,$then); $r->print(' | ||||
'); } else { $r->print(' | '); } - &access_element($r,'course',\%acl_count,\@courses,$access_controls,$now,$then); + &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(' |