version 1.7, 2003/03/21 14:13:30
|
version 1.8, 2003/03/27 20:56:30
|
Line 44 sub handler {
|
Line 44 sub handler {
|
$r->send_http_header; |
$r->send_http_header; |
|
|
$r->print( |
$r->print( |
'<html><head><title>LON-CAPA Custom Distribution Rights</title></head>'); |
'<html><head><title>LON-CAPA Custom Distribution Rights</title>'. |
|
&Apache::loncommon::coursebrowser_javascript().'</head>'); |
|
|
$r->print(&Apache::loncommon::bodytag('Custom Distribution Rights')); |
$r->print(&Apache::loncommon::bodytag('Custom Distribution Rights')); |
$r->rflush(); |
$r->rflush(); |
Line 152 sub handler {
|
Line 153 sub handler {
|
$contents=join('',<$fh>); |
$contents=join('',<$fh>); |
$fh->close(); |
$fh->close(); |
} |
} |
$r->print('<form method="post">'); |
$r->print('<form name="rules" method="post">'); |
} |
} |
unless ($contents=~/\<accessrule/s) { |
unless ($contents=~/\<accessrule/s) { |
$contents='<accessrule effect="deny" />'; |
$contents='<accessrule effect="deny" />'; |
Line 199 ENDSTARTTABLE
|
Line 200 ENDSTARTTABLE
|
while ($token=$parser->get_token) { |
while ($token=$parser->get_token) { |
if (($token->[0] eq 'S') && ($token->[1] eq 'accessrule')) { |
if (($token->[0] eq 'S') && ($token->[1] eq 'accessrule')) { |
$rulecounter++; |
$rulecounter++; |
$r->print('<tr><td align="right">'); |
$r->print('<tr><td align="right" rowspan="2">'); |
# insert, delete, etc |
# insert, delete, etc |
$r->print($rulecounter.'. '); |
$r->print($rulecounter.'. '); |
if ($constructmode) { |
if ($constructmode) { |
Line 212 ENDSTARTTABLE
|
Line 213 ENDSTARTTABLE
|
'moveup' => 'Move rule up', |
'moveup' => 'Move rule up', |
'movedown' => 'Move rule down'))); |
'movedown' => 'Move rule down'))); |
} |
} |
$r->print('</td><td>'); |
$r->print('</td><td rowspan="2">'); |
# effect |
# effect |
if ($constructmode) { |
if ($constructmode) { |
$r->print(&Apache::loncommon::select_form |
$r->print(&Apache::loncommon::select_form |
Line 245 ENDSTARTTABLE
|
Line 246 ENDSTARTTABLE
|
$r->print($rcourse); |
$r->print($rcourse); |
} |
} |
|
|
$r->print('</td><td>'); |
$r->print('</td><td rowspan="2">'); |
# realm section |
# realm section |
if ($constructmode) { |
if ($constructmode) { |
$r->print('<input input type="text" size="5" name="section_'. |
$r->print('<input input type="text" size="5" name="section_'. |
Line 254 ENDSTARTTABLE
|
Line 255 ENDSTARTTABLE
|
$r->print($rsec); |
$r->print($rsec); |
} |
} |
|
|
$r->print('</td><td>'); |
$r->print('</td><td rowspan="2">'); |
# role |
# role |
if ($constructmode) { |
if ($constructmode) { |
my %hash=('' => ''); |
my %hash=('' => ''); |
Line 268 ENDSTARTTABLE
|
Line 269 ENDSTARTTABLE
|
} else { |
} else { |
$r->print(&Apache::lonnet::plaintext($token->[2]->{'role'})); |
$r->print(&Apache::lonnet::plaintext($token->[2]->{'role'})); |
} |
} |
|
# course selection link |
|
$r->print('</td></tr><tr><td colspan="2" align="right">'); |
|
if ($rcourse) { |
|
my %descript= |
|
&Apache::lonnet::coursedescription($rdom.'_'.$rcourse); |
|
$r->print($descript{'description'}.' '); |
|
} |
|
$r->print(&Apache::loncommon::selectcourse_link('rules', |
|
'course_'.$rulecounter,'domain_'.$rulecounter)); |
# close row |
# close row |
$r->print('</td></tr>'); |
$r->print('</td></tr>'); |
} |
} |