--- loncom/interface/loncommon.pm 2006/01/09 20:38:52 1.302 +++ loncom/interface/loncommon.pm 2006/02/18 01:27:07 1.303 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.302 2006/01/09 20:38:52 albertel Exp $ +# $Id: loncommon.pm,v 1.303 2006/02/18 01:27:07 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3170,7 +3170,7 @@ times for group members. Outer hash key is functions. Inner hash keys are chat,discussion,email,files,homepage,roster. Corresponding values are either on or off, depending on -whther this type of functionality is available for the group. +whether this type of functionality is available for the group. =cut @@ -3181,13 +3181,18 @@ sub get_group_settings { my $parser=HTML::TokeParser->new(\$groupinfo); my $token; my $tool = ''; + my $role = ''; my %content=(); while ($token=$parser->get_token) { if ($token->[0] eq 'S') { my $entry=$token->[1]; - if ($entry eq 'functions') { + if ($entry eq 'functions' || $entry eq 'autosec') { %{$content{$entry}} = (); $tool = $entry; + } elsif ($entry eq 'role') { + if ($tool eq 'autosec') { + $role = $token->[2]{id}; + } } else { my $value=$parser->get_text('/'.$entry); if ($entry eq 'name') { @@ -3197,14 +3202,24 @@ sub get_group_settings { } } elsif ($entry eq 'groupname') { $content{$entry}=&Apache::lonnet::unescape($value); + } elsif (($entry eq 'roles') || ($entry eq 'types') || + ($entry eq 'sectionpick') || ($entry eq 'defpriv')) { + push(@{$content{$entry}},$value); + } elsif ($entry eq 'section') { + if ($tool eq 'autosec' && $role ne '') { + push(@{$content{$tool}{$role}},$value); + } } else { $content{$entry}=$value; } } } elsif ($token->[0] eq 'E') { - if ($token->[1] eq 'functions') { + if ($token->[1] eq 'functions' || $token->[1] eq 'autosec') { $tool = ''; + } elsif ($token->[1] eq 'role') { + $role = ''; } + } } return %content;