version 1.3, 2009/07/26 20:39:46
|
version 1.4, 2009/07/27 11:30:05
|
Line 59 sub handler {
|
Line 59 sub handler {
|
'Communication Blocking Status Information', |
'Communication Blocking Status Information', |
undef, {'only_body' => 1, })); |
undef, {'only_body' => 1, })); |
Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['activity']); |
Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['activity']); |
my ($blocked, $blocktext) = &Apache::loncommon::blocking_status_print($env{'form.activity'}); |
my ($blocked, $blocktext) = print_blocking_table($env{'form.activity'}); |
$r->print($blocktext); |
$r->print($blocktext); |
|
|
$r->print(Apache::loncommon::end_page()); |
$r->print(Apache::loncommon::end_page()); |
return OK; |
return OK; |
} |
} |
|
sub print_blocking_table{ |
|
my ($activity,$uname,$udom) = @_; |
|
my %setters; |
|
my ($blocked,$output,$ownitem,$is_course); |
|
my ($startblock,$endblock)=&Apache::loncommon::blockcheck(\%setters,$activity,$uname,$udom); |
|
if ($startblock && $endblock) { |
|
$blocked = 1; |
|
my $category; |
|
if ($activity eq 'boards') { |
|
$category = 'Discussion posts in this course'; |
|
} elsif ($activity eq 'chat') { |
|
$category = 'Chat'; |
|
} elsif ($activity eq 'msgdisplay') { |
|
$category = 'This message'; |
|
} elsif ($activity eq 'blogs') { |
|
$category = 'Blogs'; |
|
} elsif ($activity eq 'port') { |
|
if (defined($uname) && defined($udom)) { |
|
if ($uname eq $env{'user.name'} && |
|
$udom eq $env{'user.domain'}) { |
|
$ownitem = 1; |
|
} |
|
} |
|
$is_course = &Apache::lonnet::is_course($udom,$uname); |
|
if ($ownitem) { |
|
$category = 'Your portfolio files'; |
|
} elsif ($is_course) { |
|
my $coursedesc; |
|
foreach my $course (keys(%setters)) { |
|
my %courseinfo = |
|
&Apache::lonnet::coursedescription($course); |
|
$coursedesc = $courseinfo{'description'}; |
|
} |
|
$category = "Group portfolio in the course '$coursedesc'"; |
|
} else { |
|
$category = 'Portfolio files belonging to '; |
|
if ($env{'user.name'} eq 'public' && |
|
$env{'user.domain'} eq 'public') { |
|
$category .= &plainname($uname,$udom); |
|
} else { |
|
$category .= &aboutmewrapper(&plainname($uname,$udom),$uname,$udom); |
|
} |
|
} |
|
} elsif ($activity eq 'groups') { |
|
$category = 'Groups in this course'; |
|
} else { |
|
$category = 'Communication'; |
|
} |
|
my $showstart = &Apache::lonlocal::locallocaltime($startblock); |
|
my $showend = &Apache::lonlocal::locallocaltime($endblock); |
|
$output = '<br />'.&mt('[_1] will be inaccessible between [_2] and [_3] because communication is being blocked.',$category,$showstart,$showend).'<br />'; |
|
if (!($activity eq 'port' && !($ownitem) && !($is_course))) { |
|
$output .= &Apache::loncommon::build_block_table($startblock,$endblock,\%setters); |
|
} |
|
} |
|
return ($blocked,$output); |
|
} |
|
|
1; |
1; |
__END__ |
__END__ |