version 1.9, 2006/07/08 00:52:45
|
version 1.14, 2006/12/04 14:59:56
|
Line 40 Input:
|
Line 40 Input:
|
1. Optional course domain |
1. Optional course domain |
2. Optional course number |
2. Optional course number |
3. Optional group name |
3. Optional group name |
|
4. Optional namespace |
|
|
Course domain and number will be taken from user's |
Course domain and number will be taken from user's |
environment if not supplied. Optional group name will |
environment if not supplied. Optional group name will |
be passed to lonnet::get_coursegroups() as a regexp to |
be passed to lonnet function as a regexp to |
use in the call to the dump function. |
use in the call to the dump function. Optional namespace |
|
will determine whether information is retrieved about current |
|
groups (default) or deleted groups (namespace = deleted_groups). |
|
|
Output |
Output |
Returns hash of groups in the course (subject to the |
Returns hash of groups in a course (subject to the |
optional group name filter). In the hash, the keys are |
optional group name filter). In the hash, the keys are |
group names, and their corresponding values |
group names, and their corresponding values |
are scalars containing group information in XML. This |
are scalars containing group information in XML. This |
Line 60 None.
|
Line 63 None.
|
############################################### |
############################################### |
|
|
sub coursegroups { |
sub coursegroups { |
my ($cdom,$cnum,$group) = @_; |
my ($cdom,$cnum,$group,$namespace) = @_; |
if (!defined($cdom) || !defined($cnum)) { |
if (!defined($cdom) || !defined($cnum)) { |
my $cid = $env{'request.course.id'}; |
my $cid = $env{'request.course.id'}; |
|
|
Line 69 sub coursegroups {
|
Line 72 sub coursegroups {
|
$cdom = $env{'course.'.$cid.'.domain'}; |
$cdom = $env{'course.'.$cid.'.domain'}; |
$cnum = $env{'course.'.$cid.'.num'}; |
$cnum = $env{'course.'.$cid.'.num'}; |
} |
} |
my %curr_groups = &Apache::lonnet::get_coursegroups($cdom,$cnum,$group); |
if (!defined($namespace)) { |
if (my $tmp = &Apache::lonnet::error(%curr_groups)) { |
$namespace = 'coursegroups'; |
undef(%curr_groups); |
} |
&Apache::lonnet::logthis('Error retrieving groups: '.$tmp.' in '.$cnum.':'.$cdom); |
my %groups = &Apache::lonnet::get_coursegroups($cdom,$cnum,$group, |
|
$namespace); |
|
if (my $tmp = &Apache::lonnet::error(%groups)) { |
|
undef(%groups); |
|
&Apache::lonnet::logthis('Error retrieving groups: '.$tmp.' in '.$cnum.':'.$cdom.' - '.$namespace); |
|
} |
|
if (defined($groups{'group_allfolders'."\0".'locked_folder'})) { |
|
delete($groups{'group_allfolders'."\0".'locked_folder'}); |
} |
} |
return %curr_groups; |
return %groups; |
} |
} |
|
|
############################################### |
############################################### |
Line 439 sub get_tool_privs {
|
Line 449 sub get_tool_privs {
|
discussion => { |
discussion => { |
cgb => 'Create boards', |
cgb => 'Create boards', |
pgd => 'Post', |
pgd => 'Post', |
pag => 'Anon. posts', |
egp => 'Edit own posts', |
rgi => 'Get identities', |
dgp => 'Hide/Delete any post', |
vgb => 'View boards', |
vgb => 'View boards', |
}, |
}, |
chat => { |
chat => { |
Line 454 sub get_tool_privs {
|
Line 464 sub get_tool_privs {
|
agf => 'Control Access', |
agf => 'Control Access', |
}, |
}, |
roster => { |
roster => { |
vgm => 'View', |
vgm => 'Basic Display', |
|
vmd => 'Detailed Display', |
}, |
}, |
homepage => { |
homepage => { |
vgh => 'View page', |
vgh => 'View page', |
Line 519 sub group_memberlist {
|
Line 530 sub group_memberlist {
|
$current{$user}{'status'} = 'active'; |
$current{$user}{'status'} = 'active'; |
$member_nums{'active'} ++; |
$member_nums{'active'} ++; |
} |
} |
if (@userprivs > 0) { |
if ((@userprivs > 0) && (ref($fixedprivs) eq 'HASH')) { |
foreach my $tool (sort(keys(%{$fixedprivs}))) { |
foreach my $tool (sort(keys(%{$fixedprivs}))) { |
foreach my $priv (keys(%{$$fixedprivs{$tool}})) { |
foreach my $priv (keys(%{$$fixedprivs{$tool}})) { |
if (grep/^$priv$/,@userprivs) { |
if (grep/^$priv$/,@userprivs) { |
Line 530 sub group_memberlist {
|
Line 541 sub group_memberlist {
|
} |
} |
$hastools = 1; |
$hastools = 1; |
} |
} |
if (@{$available} > 0) { |
if ((ref($available) eq 'ARRAY') && (@{$available} > 0)) { |
if (@{$current{$user}{currtools}} > 0) { |
if (@{$current{$user}{currtools}} > 0) { |
if ("@{$available}" ne "@{$current{$user}{currtools}}") { |
if ("@{$available}" ne "@{$current{$user}{currtools}}") { |
foreach my $tool (@{$available}) { |
foreach my $tool (@{$available}) { |
Line 565 sub group_memberlist {
|
Line 576 sub group_memberlist {
|
} |
} |
} |
} |
} |
} |
return (\%current,$hastools,$addtools,\%member_nums); |
return (\%current,\%member_nums,$hastools,$addtools); |
} |
} |
|
|
############################################### |
############################################### |
Line 621 sub get_bbfolder_url {
|
Line 632 sub get_bbfolder_url {
|
############################################### |
############################################### |
|
|
sub get_group_bbinfo { |
sub get_group_bbinfo { |
my ($cdom,$cnum,$group) = @_; |
my ($cdom,$cnum,$group,$boardurl) = @_; |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my @groupboards; |
my @groupboards; |
my %boardshash; |
my %boardshash; |
Line 632 sub get_group_bbinfo {
|
Line 643 sub get_group_bbinfo {
|
my @boards = $navmap->retrieveResources($bbfolderres,undef,0,0); |
my @boards = $navmap->retrieveResources($bbfolderres,undef,0,0); |
foreach my $res (@boards) { |
foreach my $res (@boards) { |
my $url = $res->src(); |
my $url = $res->src(); |
if ($url =~ m|^/adm/\Q$cdom\E/\Q$cnum\E/\d+/bulletinboard|) { |
if ($url =~ m|^(/adm/\Q$cdom\E/\Q$cnum\E/\d+/bulletinboard)|) { |
push(@groupboards,$res->symb()); |
if ($boardurl) { |
$boardshash{$res->symb()} = { |
if ($boardurl =~ /^\Q$1\E/) { |
title => $res->title(), |
push(@groupboards,$res->symb()); |
url => $res->src(), |
$boardshash{$res->symb()} = { |
}; |
title => $res->title(), |
|
url => $res->src(), |
|
}; |
|
last; |
|
} |
|
} else { |
|
push(@groupboards,$res->symb()); |
|
$boardshash{$res->symb()} = { |
|
title => $res->title(), |
|
url => $res->src(), |
|
}; |
|
} |
} |
} |
} |
} |
} |
} |