version 1.151, 2007/06/07 22:34:56
|
version 1.152, 2007/06/07 23:11:05
|
Line 1611 sub custom_role_editor {
|
Line 1611 sub custom_role_editor {
|
&print_username_entry_form($r); |
&print_username_entry_form($r); |
return; |
return; |
} |
} |
my $head_script = <<END_SCRIPT; |
my $head_script = "\n"; |
<script type="text/javascript"> |
$head_script .= '<script type="text/javascript">'."\n"; |
function setchecks() { |
$head_script .= 'function set_ta() {'."\n"; |
document.form1.bre_c.checked = false; |
my @ta_c = split(/:/,$Apache::lonnet::pr{'ta:c'}); |
} |
foreach my $priv_item (@ta_c) { |
</script> |
my ($priv, $dummy) = split(/\&/,$priv_item); |
END_SCRIPT |
$head_script .= "document.form1.$priv"."_c.checked = true;\n"; |
|
} |
|
my @ta_d = split(/:/,$Apache::lonnet::pr{'ta:d'}); |
|
foreach my $priv_item (@ta_d) { |
|
my ($priv, $dummy) = split(/\&/,$priv_item); |
|
$head_script .= "document.form1.$priv"."_d.checked = true;\n"; |
|
} |
|
|
|
$head_script .= '}'."\n"; |
|
$head_script .= '</script>'."\n"; |
$r->print(&Apache::loncommon::start_page('Custom Role Editor',$head_script)); |
$r->print(&Apache::loncommon::start_page('Custom Role Editor',$head_script)); |
my $syspriv=''; |
my $syspriv=''; |
my $dompriv=''; |
my $dompriv=''; |
Line 1641 END_SCRIPT
|
Line 1649 END_SCRIPT
|
my %full=(); |
my %full=(); |
my %courselevel=(); |
my %courselevel=(); |
my %courselevelcurrent=(); |
my %courselevelcurrent=(); |
my @roles = ("st:c","st:d"); |
my @roles = ("ta:c","ta:d","ta:s"); |
#foreach my $item (@roles) { |
|
# &Apache::lonnet::logthis(" roles for $item: ".$Apache::lonnet::pr{$item}); |
|
#} |
|
|
|
foreach my $item (split(/\:/,$Apache::lonnet::pr{'cr:c'})) { |
foreach my $item (split(/\:/,$Apache::lonnet::pr{'cr:c'})) { |
|
|
my ($priv,$restrict)=split(/\&/,$item); |
my ($priv,$restrict)=split(/\&/,$item); |
Line 1683 END_SCRIPT
|
Line 1687 END_SCRIPT
|
'crl' => "Course Level", |
'crl' => "Course Level", |
'dml' => "Domain Level", |
'dml' => "Domain Level", |
'ssl' => "System Level"); |
'ssl' => "System Level"); |
$r->print('<form action=""><input type="button" onClick="setchecks()" value="Click" /></form>'); |
$r->print('Select a Template<br />'); |
|
$r->print('<form action=""><input type="button" onClick="set_ta()" value="TA" /></form>'); |
$r->print(<<ENDCCF); |
$r->print(<<ENDCCF); |
<form name=form1 method="post"> |
<form name=form1 method="post"> |
<input type="hidden" name="phase" value="set_custom_roles" /> |
<input type="hidden" name="phase" value="set_custom_roles" /> |