--- loncom/publisher/lonrights.pm 2010/01/27 16:18:17 1.25.2.1 +++ loncom/publisher/lonrights.pm 2010/06/06 02:40:44 1.30 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to show and edit custom distribution rights # -# $Id: lonrights.pm,v 1.25.2.1 2010/01/27 16:18:17 raeburn Exp $ +# $Id: lonrights.pm,v 1.30 2010/06/06 02:40:44 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -55,9 +55,24 @@ sub handler { &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; + # Breadcrumbs + &Apache::lonhtmlcommon::clear_breadcrumbs(); + &Apache::lonhtmlcommon::add_breadcrumb({ + 'text' => 'Construction Space', + 'href' => &Apache::loncommon::authorspace(), + }); + &Apache::lonhtmlcommon::add_breadcrumb({ + 'text' => 'Custom Rights Editor', + 'title' => 'Custom Distribution Rights Editor', + 'href' => '',}); + my $js = &Apache::loncommon::coursebrowser_javascript(). &Apache::loncommon::studentbrowser_javascript(); - $r->print(&Apache::loncommon::start_page('Custom Distribution Rights',$js)); + # Breadcrumbs are included by &start_page + $r->print(&Apache::loncommon::start_page('Custom Distribution Rights',$js) + .&Apache::loncommon::head_subbox( + &Apache::loncommon::CSTR_pageheader()) + ); $r->rflush(); my $uri=$r->uri; @@ -195,19 +210,19 @@ sub handler { $r->print(&Apache::loncommon::start_data_table_row().''); if ($constructmode) { $r->print(&Apache::loncommon::select_form('','action_0', - ('' => '', - 'insertbelow' => &mt('Insert rule below')))); + {'' => '', + 'insertbelow' => &mt('Insert rule below')})); } else { $r->print(' '); } $r->print(''); if ($constructmode) { - $r->print(&Apache::loncommon::select_form - ($token->[2]->{'effect'},'effect_0', - &Apache::lonlocal::texthash + my %lt = &Apache::lonlocal::texthash ('allow' => 'allow', - 'deny' => 'deny'))); + 'deny' => 'deny'); + $r->print(&Apache::loncommon::select_form + ($token->[2]->{'effect'},'effect_0',\%lt)); } else { $r->print($token->[2]->{'effect'}); } @@ -226,26 +241,28 @@ sub handler { # insert, delete, etc $r->print(''.$rulecounter.'. '); if ($constructmode) { + my %lt = &Apache::lonlocal::texthash + ('' => '', + 'delete' => 'Delete this rule', + 'insertabove' => 'Insert rule above', + 'insertbelow' => 'Insert rule below', + 'moveup' => 'Move rule up', + 'movedown' => 'Move rule down' + ); + $r->print(&Apache::loncommon::select_form( - '','action_'.$rulecounter, - &Apache::lonlocal::texthash - ('' => '', - 'delete' => 'Delete this rule', - 'insertabove' => 'Insert rule above', - 'insertbelow' => 'Insert rule below', - 'moveup' => 'Move rule up', - 'movedown' => 'Move rule down'))); + '','action_'.$rulecounter,\%lt)); } $r->print(''. ''); # effect if ($constructmode) { + my %lt = &Apache::lonlocal::texthash + ('allow' => 'allow', + 'deny' => 'deny'); $r->print(&Apache::loncommon::select_form ($token->[2]->{'effect'}, - 'effect_'.$rulecounter, - &Apache::lonlocal::texthash - ('allow' => 'allow', - 'deny' => 'deny'))); + 'effect_'.$rulecounter,\%lt)); } else { $r->print($token->[2]->{'effect'}); } @@ -254,11 +271,11 @@ sub handler { $r->print(''); my $type = ($token->[2]{'type'} || 'course'); if ($constructmode) { + my %lt = &Apache::lonlocal::texthash + ('course' => 'Course', + 'user' => 'User'); $r->print(&Apache::loncommon::select_form($type, - 'type_'.$rulecounter, - &Apache::lonlocal::texthash - ('course' => 'Course', - 'user' => 'User'))); + 'type_'.$rulecounter,\%lt)); } else { $r->print($type); } @@ -313,7 +330,7 @@ sub handler { my $role=$token->[2]->{'role'}; unless ($role) { $role=''; } $r->print(&Apache::loncommon::select_form( - $role,'role_'.$rulecounter,%hash)); + $role,'role_'.$rulecounter,\%hash)); } else { $r->print(&Apache::lonnet::plaintext($token->[2]->{'role'})); }