--- loncom/publisher/lonrights.pm 2003/03/20 21:47:57 1.6 +++ loncom/publisher/lonrights.pm 2003/03/27 20:56:30 1.8 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to show and edit custom distribution rights # -# $Id: lonrights.pm,v 1.6 2003/03/20 21:47:57 www Exp $ +# $Id: lonrights.pm,v 1.8 2003/03/27 20:56:30 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -44,7 +44,8 @@ sub handler { $r->send_http_header; $r->print( - 'LON-CAPA Custom Distribution Rights'); + 'LON-CAPA Custom Distribution Rights'. + &Apache::loncommon::coursebrowser_javascript().''); $r->print(&Apache::loncommon::bodytag('Custom Distribution Rights')); $r->rflush(); @@ -152,7 +153,7 @@ sub handler { $contents=join('',<$fh>); $fh->close(); } - $r->print('
'); + $r->print(''); } unless ($contents=~/\get_token; while ($token->[1] ne 'accessrule') { $token=$parser->get_token; } # print default - $r->print(''); + $r->print(''); if ($constructmode) { $r->print(&Apache::loncommon::select_form('','action_0', - ('' => '', - 'insertbelow' => 'Insert rule below'))); + ('' => '', + 'insertbelow' => 'Insert rule below '))); } else { $r->print(' '); @@ -199,7 +200,7 @@ ENDSTARTTABLE while ($token=$parser->get_token) { if (($token->[0] eq 'S') && ($token->[1] eq 'accessrule')) { $rulecounter++; - $r->print(''); + $r->print(''); # insert, delete, etc $r->print($rulecounter.'. '); if ($constructmode) { @@ -208,11 +209,11 @@ ENDSTARTTABLE ('' => '', 'delete' => 'Delete this rule', 'insertabove' => 'Insert rule above', - 'insertbelow' => 'Insert rule below', + 'insertbelow' => 'Insert rule below ', 'moveup' => 'Move rule up', 'movedown' => 'Move rule down'))); } - $r->print(''); + $r->print(''); # effect if ($constructmode) { $r->print(&Apache::loncommon::select_form @@ -228,8 +229,9 @@ ENDSTARTTABLE my $realm=$token->[2]->{'realm'}; $realm=~s/^\W//; my ($rdom,$rcourse,$rsec)=split(/[\/\_]/,$realm); -# realm role +# realm domain if ($constructmode) { + unless ($rdom) { $rdom=$ENV{'user.domain'}; } $r->print(&Apache::loncommon::select_dom_form($rdom, 'domain_'.$rulecounter)); } else { @@ -244,7 +246,7 @@ ENDSTARTTABLE $r->print($rcourse); } - $r->print(''); + $r->print(''); # realm section if ($constructmode) { $r->print(''); # role if ($constructmode) { my %hash=('' => ''); @@ -267,6 +269,15 @@ ENDSTARTTABLE } else { $r->print(&Apache::lonnet::plaintext($token->[2]->{'role'})); } +# course selection link + $r->print(''); + 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 $r->print(''); }