');
+ 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',
@@ -84,7 +190,7 @@ sub handler {
} else {
$r->print($token->[2]->{'effect'});
}
- $r->print(' | Default');
+ $r->print(' | Default');
if (($token->[2]->{'realm'}) || ($token->[2]->{'role'})) {
$r->print(' - Error! No default set.');
}
@@ -93,8 +199,19 @@ sub handler {
while ($token=$parser->get_token) {
if (($token->[0] eq 'S') && ($token->[1] eq 'accessrule')) {
$rulecounter++;
- $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) {
@@ -107,21 +224,49 @@ sub handler {
$r->print($token->[2]->{'effect'});
}
$r->print(' | ');
-# realm
+# ---- realm
my $realm=$token->[2]->{'realm'};
$realm=~s/^\W//;
- my ($rdom,$rcourse,$rsec)=split(/(\/|\_)/,$realm);
+ 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($token->[2]->{'realm'});
+ $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($token->[2]->{'role'});
+ $r->print(&Apache::lonnet::plaintext($token->[2]->{'role'}));
}
# close row
$r->print(' |
');
@@ -130,7 +275,7 @@ sub handler {
$r->print('