');
+ if ($constructmode) {
+ $r->print(&Apache::loncommon::select_form('','action_0',
+ ('' => '',
+ 'insertbelow' => 'Insert rule below ')));
+
+ } else {
+ $r->print(' ');
+ }
+ $r->print(' | ');
+ if ($constructmode) {
+ $r->print(&Apache::loncommon::select_form
+ ($token->[2]->{'effect'},'effect_0',
+ ('allow' => 'allow',
+ 'deny' => 'deny')));
+ } else {
+ $r->print($token->[2]->{'effect'});
+ }
+ $r->print(' | Default');
+ if (($token->[2]->{'realm'}) || ($token->[2]->{'role'})) {
+ $r->print(' - Error! No default set.');
+ }
+ $r->print(' |
');
+# Additional roles
while ($token=$parser->get_token) {
if (($token->[0] eq 'S') && ($token->[1] eq 'accessrule')) {
- $r->print('');
+# insert, delete, etc
+ $r->print($rulecounter.'. ');
+ if ($constructmode) {
+ $r->print(&Apache::loncommon::select_form(
+ '','action_'.$rulecounter,
+ ('' => '',
+ 'delete' => 'Delete this rule',
+ 'insertabove' => 'Insert rule above',
+ 'insertbelow' => 'Insert rule below ',
+ 'moveup' => 'Move rule up',
+ 'movedown' => 'Move rule down')));
+ }
+ $r->print(' | ');
+# effect
+ if ($constructmode) {
+ $r->print(&Apache::loncommon::select_form
+ ($token->[2]->{'effect'},
+ 'effect_'.$rulecounter,
+ ('allow' => 'allow',
+ 'deny' => 'deny')));
+ } else {
+ $r->print($token->[2]->{'effect'});
+ }
+ $r->print(' | ');
+# ---- realm
+ my $realm=$token->[2]->{'realm'};
+ $realm=~s/^\W//;
+ my ($rdom,$rcourse,$rsec)=split(/[\/\_]/,$realm);
+# realm domain
+ if ($constructmode) {
+ unless ($rdom) { $rdom=$ENV{'user.domain'}; }
+ $r->print(&Apache::loncommon::select_dom_form($rdom,
+ 'domain_'.$rulecounter));
+ } else {
+ $r->print($rdom);
+ }
+ $r->print(' | ');
+# realm course
+ if ($constructmode) {
+ $r->print('');
+ } else {
+ $r->print($rcourse);
+ }
+
+ $r->print(' | ');
+# realm section
+ if ($constructmode) {
+ $r->print('');
+ } else {
+ $r->print($rsec);
+ }
+
+ $r->print(' | ');
+# role
+ if ($constructmode) {
+ my %hash=('' => '');
+ foreach ('au','cc','in','ta','st') {
+ $hash{$_}=&Apache::lonnet::plaintext($_);
+ }
+ my $role=$token->[2]->{'role'};
+ unless ($role) { $role=''; }
+ $r->print(&Apache::loncommon::select_form(
+ $role,'role_'.$rulecounter,%hash));
+ } else {
+ $r->print(&Apache::lonnet::plaintext($token->[2]->{'role'}));
+ }
+# course selection link
+ $r->print(' |