version 1.16, 2008/05/01 16:26:29
|
version 1.23, 2010/01/30 18:19:16
|
Line 1
|
Line 1
|
# The LearningOnline Network with CAPA |
# The LearningOnline Network with CAPA |
# accessor routines used to provide information about course groups |
# accessor routines used to provide information about course groups |
# |
# |
|
# $Id$ |
|
# |
# Copyright Michigan State University Board of Trustees |
# Copyright Michigan State University Board of Trustees |
# |
# |
# This file is part of the LearningOnline Network with CAPA (LON-CAPA). |
# This file is part of the LearningOnline Network with CAPA (LON-CAPA). |
Line 28 package Apache::longroup;
|
Line 30 package Apache::longroup;
|
|
|
use strict; |
use strict; |
use Apache::lonnet; |
use Apache::lonnet; |
|
use Apache::lonlocal; |
|
use LONCAPA; |
|
|
############################################### |
############################################### |
=pod |
=pod |
Line 437 sub group_changes {
|
Line 441 sub group_changes {
|
|
|
sub get_fixed_privs { |
sub get_fixed_privs { |
my $fixedprivs = { |
my $fixedprivs = { |
email => {sgm => 1}, |
email => {sgm => 1}, |
discussion => {vgb => 1}, |
discussion => {vgb => 1}, |
chat => {pgc => 1}, |
chat => {pgc => 1}, |
files => {rgf => 1}, |
files => {rgf => 1}, |
roster => {vgm => 1}, |
roster => {vgm => 1}, |
homepage => {vgh => 1}, |
homepage => {vgh => 1}, |
}; |
}; |
return $fixedprivs; |
return $fixedprivs; |
} |
} |
Line 452 sub get_fixed_privs {
|
Line 456 sub get_fixed_privs {
|
sub get_tool_privs { |
sub get_tool_privs { |
my ($gpterm) = @_; |
my ($gpterm) = @_; |
my $toolprivs = { |
my $toolprivs = { |
email => { |
email => { |
sgm => 'Send '.$gpterm.' mail', |
sgm => 'Send '.$gpterm.' message', |
sgb => 'Broadcast mail', |
sgb => 'Broadcast message', |
}, |
}, |
discussion => { |
discussion => { |
cgb => 'Create boards', |
cgb => 'Create boards', |
Line 464 sub get_tool_privs {
|
Line 468 sub get_tool_privs {
|
vgb => 'View boards', |
vgb => 'View boards', |
}, |
}, |
chat => { |
chat => { |
pgc => 'Chat', |
pgc => 'Chat Room', |
}, |
}, |
files => { |
files => { |
rgf => 'Retrieve', |
rgf => 'Retrieve', |
Line 643 sub get_bbfolder_url {
|
Line 647 sub get_bbfolder_url {
|
|
|
sub get_group_bbinfo { |
sub get_group_bbinfo { |
my ($cdom,$cnum,$group,$boardurl) = @_; |
my ($cdom,$cnum,$group,$boardurl) = @_; |
|
my @groupboards = (); |
|
my %boardshash = (); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my @groupboards; |
if (defined($navmap)) { |
my %boardshash; |
my $grpbbmap = &get_bbfolder_url($cdom,$cnum,$group); |
my $grpbbmap = &get_bbfolder_url($cdom,$cnum,$group); |
if ($grpbbmap) { |
if ($grpbbmap) { |
my $bbfolderres = $navmap->getResourceByUrl($grpbbmap); |
my $bbfolderres = $navmap->getResourceByUrl($grpbbmap); |
if ($bbfolderres) { |
if ($bbfolderres) { |
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)|) { |
if ($boardurl) { |
if ($boardurl) { |
if ($boardurl =~ /^\Q$1\E/) { |
if ($boardurl =~ /^\Q$1\E/) { |
push(@groupboards,$res->symb()); |
push(@groupboards,$res->symb()); |
$boardshash{$res->symb()} = { |
$boardshash{$res->symb()} = { |
|
title => $res->title(), |
title => $res->title(), |
url => $res->src(), |
url => $res->src(), |
}; |
}; |
last; |
last; |
} |
} |
} else { |
} else { |
push(@groupboards,$res->symb()); |
push(@groupboards,$res->symb()); |
$boardshash{$res->symb()} = { |
$boardshash{$res->symb()} = { |
title => $res->title(), |
title => $res->title(), |
url => $res->src(), |
url => $res->src(), |
}; |
}; |
|
} |
} |
} |
} |
} |
} |
} |
} |
} |
|
undef($navmap); |
|
} else { |
|
&Apache::lonnet::logthis('Retrieval of group boards failed - could not create navmap object for group: '.$group.' in course: '.$cdom.':'.$cnum); |
} |
} |
undef($navmap); |
|
return (\@groupboards,\%boardshash); |
return (\@groupboards,\%boardshash); |
} |
} |
|
|