version 1.1060, 2012/03/20 14:28:26
|
version 1.1061, 2012/03/24 23:35:25
|
Line 4272 sub parse_block_record {
|
Line 4272 sub parse_block_record {
|
} |
} |
|
|
sub blocking_status { |
sub blocking_status { |
my ($activity,$uname,$udom) = @_; |
my ($activity,$uname,$udom) = @_; |
my %setters; |
my %setters; |
|
|
# check for active blocking |
# check for active blocking |
my ($startblock,$endblock)=&blockcheck(\%setters,$activity,$uname,$udom); |
my ($startblock,$endblock)=&blockcheck(\%setters,$activity,$uname,$udom); |
|
|
my $blocked = $startblock && $endblock ? 1 : 0; |
my $blocked = $startblock && $endblock ? 1 : 0; |
|
|
# caller just wants to know whether a block is active |
# caller just wants to know whether a block is active |
if (!wantarray) { return $blocked; } |
if (!wantarray) { return $blocked; } |
|
|
# build a link to a popup window containing the details |
# build a link to a popup window containing the details |
my $querystring = "?activity=$activity"; |
my $querystring = "?activity=$activity"; |
# $uname and $udom decide whose portfolio the user is trying to look at |
# $uname and $udom decide whose portfolio the user is trying to look at |
$querystring .= "&udom=$udom" if $udom; |
$querystring .= "&udom=$udom" if $udom; |
$querystring .= "&uname=$uname" if $uname; |
$querystring .= "&uname=$uname" if $uname; |
|
|
my $output .= <<'END_MYBLOCK'; |
my $output .= <<'END_MYBLOCK'; |
function openWindow(url, wdwName, w, h, toolbar,scrollbar) { |
function openWindow(url, wdwName, w, h, toolbar,scrollbar) { |
var options = "width=" + w + ",height=" + h + ","; |
var options = "width=" + w + ",height=" + h + ","; |
options += "resizable=yes,scrollbars="+scrollbar+",status=no,"; |
options += "resizable=yes,scrollbars="+scrollbar+",status=no,"; |
options += "menubar=no,toolbar="+toolbar+",location=no,directories=no"; |
options += "menubar=no,toolbar="+toolbar+",location=no,directories=no"; |
var newWin = window.open(url, wdwName, options); |
var newWin = window.open(url, wdwName, options); |
newWin.focus(); |
newWin.focus(); |
} |
} |
END_MYBLOCK |
END_MYBLOCK |
|
|
$output = Apache::lonhtmlcommon::scripttag($output); |
$output = Apache::lonhtmlcommon::scripttag($output); |
|
|
my $popupUrl = "/adm/blockingstatus/$querystring"; |
my $popupUrl = "/adm/blockingstatus/$querystring"; |
my $text = mt('Communication Blocked'); |
my $text = mt('Communication Blocked'); |
|
|
$output .= <<"END_BLOCK"; |
$output .= <<"END_BLOCK"; |
<div class='LC_comblock'> |
<div class='LC_comblock'> |
<a onclick='openWindow("$popupUrl","Blocking Table",600,300,"no","no");return false;' href='/adm/blockingstatus/$querystring' |
<a onclick='openWindow("$popupUrl","Blocking Table",600,300,"no","no");return false;' href='/adm/blockingstatus/$querystring' |
title='$text'> |
title='$text'> |
Line 4315 END_MYBLOCK
|
Line 4315 END_MYBLOCK
|
|
|
END_BLOCK |
END_BLOCK |
|
|
return ($blocked, $output); |
return ($blocked, $output); |
} |
} |
|
|
############################################### |
############################################### |