--- loncom/publisher/lonrights.pm 2003/03/14 02:26:12 1.1 +++ loncom/publisher/lonrights.pm 2011/11/13 21:11:42 1.32 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to show and edit custom distribution rights # -# $Id: lonrights.pm,v 1.1 2003/03/14 02:26:12 www Exp $ +# $Id: lonrights.pm,v 1.32 2011/11/13 21:11:42 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -32,20 +32,344 @@ package Apache::lonrights; use strict; use Apache::Constants qw(:common :http); -use Apache::lonnet(); +use Apache::lonnet; use Apache::loncommon(); +use HTML::LCParser; +use Apache::File; +use Apache::lonlocal; sub handler { my $r=shift; - $r->content_type('text/html'); + 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; - $r->print('