--- loncom/publisher/lonrights.pm 2003/09/22 15:39:53 1.10 +++ loncom/publisher/lonrights.pm 2004/05/18 13:44:56 1.14 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to show and edit custom distribution rights # -# $Id: lonrights.pm,v 1.10 2003/09/22 15:39:53 www Exp $ +# $Id: lonrights.pm,v 1.14 2004/05/18 13:44:56 taceyjo1 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -41,6 +41,17 @@ use Apache::lonlocal; sub handler { my $r=shift; + my $target = $ENV{'form.grade_target'}; + if ($target eq 'meta') { + &Apache::loncommon::content_type($r,'text/html'); + $r->send_http_header; + $ENV{'request.uri'}=$r->uri; + my $file = &Apache::lonnet::filelocation("",$r->uri); + my $content=&Apache::lonnet::getfile($file); + my $result=&Apache::lonxml::xmlparse(undef,'meta',$content); + $r->print($result); + return OK; + } &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; @@ -163,16 +174,18 @@ sub handler { my $token; my $rulecounter=0; my $colzero=&mt($constructmode?'Edit action':'Rule'); -my %lt=&Apache::loncommon::texthash('ef' => 'Effect', - 'do' => 'Domain', - 'co' => 'Course', - 'se' => 'Section/Group', - 'ro' => 'Role'); + my %lt=&Apache::lonlocal::texthash('ef' => 'Effect', + 'do' => 'Domain', + 'co' => 'Course', + 'se' => 'Section/Group', + 'ro' => 'Role', + 'ua' => 'Use Access', + 'sa' => 'Source Access'); # ---------------------------------------------------------- Start table output $r->print(< $colzero$lt{'ef'}$lt{'do'}$lt{'co'} -$lt{'se'}$lt{'ro'} +$lt{'se'}$lt{'ro'}$lt{'ua'}$lt{'sa'} ENDSTARTTABLE # --------------------------------------------------------------------- Default # Fast forward to first rule @@ -197,7 +210,7 @@ ENDSTARTTABLE } else { $r->print($token->[2]->{'effect'}); } - $r->print('Default'); + $r->print('Default'); if (($token->[2]->{'realm'}) || ($token->[2]->{'role'})) { $r->print(' - '.&mt('Error! No default set.'). ''); @@ -276,6 +289,12 @@ ENDSTARTTABLE } else { $r->print(&Apache::lonnet::plaintext($token->[2]->{'role'})); } +# use access + # if ($constructmode) { + # + # } else { + # $r->print(&Apache::lonnet::plaintext($token->[2]->{'role'})); + # } # course selection link $r->print(''); if ($rcourse) { @@ -283,8 +302,10 @@ ENDSTARTTABLE &Apache::lonnet::coursedescription($rdom.'_'.$rcourse); $r->print($descript{'description'}.'   '); } - $r->print(&Apache::loncommon::selectcourse_link('rules', - 'course_'.$rulecounter,'domain_'.$rulecounter)); + if ($constructmode) { + $r->print(&Apache::loncommon::selectcourse_link('rules', + 'course_'.$rulecounter,'domain_'.$rulecounter)); + } # close row $r->print(''); }