'.&role_checkboxes($cdom,$cnum,$item,$settings).
+ ''.&role_checkboxes($cdom,$cnum,$item,$settings,undef,undef,$noedit).
'
';
} elsif ($item eq 'plc.users.denied') {
- $datatable .= ''.
- &user_table($cdom,$item,undef,
- $settings->{$item},\%lt);
+ $datatable .= ' | '.
+ &user_table($cdom,$item,undef,
+ $settings->{$item},\%lt,$noedit);
} elsif ($item eq 'pch.roles.denied') {
$datatable .= ' | '.
- ''.&role_checkboxes($cdom,$cnum,$item,$settings).
+ ''.&role_checkboxes($cdom,$cnum,$item,$settings,undef,undef,$noedit).
' ';
} elsif ($item eq 'pch.users.denied') {
$datatable .= ''.
&user_table($cdom,$item,undef,
- $settings->{$item},\%lt);
+ $settings->{$item},\%lt,$noedit);
+ } elsif ($item eq 'pac.roles.denied') {
+ $datatable .= ' | '.
+ ''.&role_checkboxes($cdom,$cnum,$item,$settings,undef,undef,$noedit).
+ ' ';
+ } elsif ($item eq 'pac.users.denied') {
+ $datatable .= ' | '.
+ &user_table($cdom,$item,undef,
+ $settings->{$item},\%lt,$noedit);
} elsif ($item eq 'allow_limited_html_in_feedback') {
- $datatable .= &yesno_radio($item,$settings);
+ $datatable .= &yesno_radio($item,$settings,undef,undef,undef,$noedit);
} elsif ($item eq 'allow_discussion_post_editing') {
$datatable .= ' | '.
&Apache::loncommon::start_data_table().
@@ -3152,7 +3923,7 @@ sub print_discussion {
' | '.&mt('Role').' | '.
&mt('Sections').' | '.
&Apache::loncommon::end_data_table_row().
- &role_checkboxes($cdom,$cnum,$item,$settings,1).
+ &role_checkboxes($cdom,$cnum,$item,$settings,1,undef,$noedit).
&Apache::loncommon::end_data_table().' ';
} elsif ($item eq 'discussion_post_fonts') {
$datatable .= ' '.
@@ -3162,9 +3933,9 @@ sub print_discussion {
' | '.&mt('font-size').' | '.
''.&mt('font-weight').' | '.
''.&mt('font-style').' | '.
- ''.&mt('Other css').' | '.
+ ''.&mt('Other css').' | '.
&Apache::loncommon::end_data_table_row().
- &set_discussion_fonts($cdom,$cnum,$item,$settings).
+ &set_discussion_fonts($cdom,$cnum,$item,$settings,$noedit).
&Apache::loncommon::end_data_table().' ';
}
$datatable .= &item_table_row_end();
@@ -3174,7 +3945,7 @@ sub print_discussion {
}
sub role_checkboxes {
- my ($cdom,$cnum,$item,$settings,$showsections,$crstype) = @_;
+ my ($cdom,$cnum,$item,$settings,$showsections,$crstype,$noedit) = @_;
my @roles = ('st','ad','ta','ep','in');
if ($crstype eq 'Community') {
push(@roles,'co');
@@ -3212,6 +3983,10 @@ sub role_checkboxes {
}
my $numinrow = 3;
my $count = 0;
+ my $disabled;
+ if ($noedit) {
+ $disabled = ' disabled="disabled"';
+ }
foreach my $role (@roles) {
my $checked = '';
if (grep(/^\Q$role\E$/,@current)) {
@@ -3230,11 +4005,11 @@ sub role_checkboxes {
}
}
$output .= ' | ';
if ($showsections) {
$output .= ''.
- &select_sections($item,$role,\@sections,$currsec{$role}).
+ &select_sections($item,$role,\@sections,$currsec{$role},$noedit).
' | ';
}
$count ++;
@@ -3262,11 +4037,11 @@ sub role_checkboxes {
}
}
$output .= ' | ';
if ($showsections) {
$output .= ''.
- &select_sections($item,$role,\@sections,$currsec{$role}).
+ &select_sections($item,$role,\@sections,$currsec{$role},$noedit).
' | '.&Apache::loncommon::end_data_table_row();
}
$total ++;
@@ -3288,11 +4063,15 @@ sub role_checkboxes {
}
sub set_discussion_fonts {
- my ($cdom,$cnum,$item,$settings) = @_;
+ my ($cdom,$cnum,$item,$settings,$noedit) = @_;
my ($classorder,$classtitles) = &discussion_vote_classes();
my ($styleorder,$styleitems) = &discussion_vote_styles();
my $output;
if (ref($classorder) eq 'ARRAY') {
+ my $disabled;
+ if ($noedit) {
+ $disabled = ' disabled="disabled"';
+ }
foreach my $cat (@{$classorder}) {
my %curr = ();
($curr{'size'},$curr{'weight'},$curr{'style'},$curr{'other'}) =
@@ -3309,12 +4088,12 @@ sub set_discussion_fonts {
($currsize,$currunit) = ($1,$2);
$curr{'size'} = $currunit;
}
- $output .= ''.
+ $output .= ''.
' ';
$selitem = 'unit';
}
if ((ref($styleitems) eq 'HASH') && (ref($styleitems->{$item}) eq 'ARRAY')) {
- $output .= ' ';
return $output;
}
sub position_selector {
- my ($pos,$num,$maxnum) = @_;
- my $output = '';
+ my ($pos,$num,$maxnum,$disabled) = @_;
+ my $output = '';
for (my $j=1; $j<=$maxnum; $j++) {
my $sel = '';
if ($pos == $j) {
@@ -4118,7 +5105,7 @@ sub position_selector {
}
sub substitution_selector {
- my ($num,$subst,$limit,$crstype) = @_;
+ my ($num,$subst,$limit,$crstype,$disabled) = @_;
my ($stunametxt,$crsidtxt);
if ($crstype eq 'Community') {
$stunametxt = 'member name';
@@ -4133,7 +5120,7 @@ sub substitution_selector {
a => 'assignment note',
);
my $output .= &mt('Substitution').' '.
- '';
+ '';
if ($subst eq '') {
$output .= '';
}
@@ -4147,7 +5134,7 @@ sub substitution_selector {
}
$output .= ' | '.&mt('Size limit').' '.
'';
+ '" value="'.$limit.'" size="5"'.$disabled.' />';
return $output;
}
@@ -4165,17 +5152,19 @@ sub change_clone {
foreach my $currclone (@allowclone) {
if (!grep(/^$currclone$/,@$oldcloner)) {
if ($currclone ne '*') {
- my ($uname,$udom) = split(/:/,$currclone);
- if ($uname && $udom && $uname ne '*') {
- if (&Apache::lonnet::homeserver($uname,$udom) ne 'no_host') {
- my %currclonecrs = &Apache::lonnet::dump('environment',$udom,$uname,'cloneable');
- if ($currclonecrs{'cloneable'} !~ /\Q$clone_crs\E/) {
- if ($currclonecrs{'cloneable'} eq '') {
- $currclonecrs{'cloneable'} = $clone_crs;
- } else {
- $currclonecrs{'cloneable'} .= ','.$clone_crs;
+ if ($currclone =~ /:/) {
+ my ($uname,$udom) = split(/:/,$currclone);
+ if ($uname && $udom && $uname ne '*') {
+ if (&Apache::lonnet::homeserver($uname,$udom) ne 'no_host') {
+ my %currclonecrs = &Apache::lonnet::dump('environment',$udom,$uname,'cloneable');
+ if ($currclonecrs{'cloneable'} !~ /\Q$clone_crs\E/) {
+ if ($currclonecrs{'cloneable'} eq '') {
+ $currclonecrs{'cloneable'} = $clone_crs;
+ } else {
+ $currclonecrs{'cloneable'} .= ','.$clone_crs;
+ }
+ &Apache::lonnet::put('environment',\%currclonecrs,$udom,$uname);
}
- &Apache::lonnet::put('environment',\%currclonecrs,$udom,$uname);
}
}
}
@@ -4185,24 +5174,26 @@ sub change_clone {
foreach my $oldclone (@$oldcloner) {
if (!grep(/^\Q$oldclone\E$/,@allowclone)) {
if ($oldclone ne '*') {
- my ($uname,$udom) = split(/:/,$oldclone);
- if ($uname && $udom && $uname ne '*' ) {
- if (&Apache::lonnet::homeserver($uname,$udom) ne 'no_host') {
- my %currclonecrs = &Apache::lonnet::dump('environment',$udom,$uname,'cloneable');
- my %newclonecrs = ();
- if ($currclonecrs{'cloneable'} =~ /\Q$clone_crs\E/) {
- if ($currclonecrs{'cloneable'} =~ /,/) {
- my @currclonecrs = split/,/,$currclonecrs{'cloneable'};
- foreach my $crs (@currclonecrs) {
- if ($crs ne $clone_crs) {
- $newclonecrs{'cloneable'} .= $crs.',';
+ if ($oldclone =~ /:/) {
+ my ($uname,$udom) = split(/:/,$oldclone);
+ if ($uname && $udom && $uname ne '*' ) {
+ if (&Apache::lonnet::homeserver($uname,$udom) ne 'no_host') {
+ my %currclonecrs = &Apache::lonnet::dump('environment',$udom,$uname,'cloneable');
+ my %newclonecrs = ();
+ if ($currclonecrs{'cloneable'} =~ /\Q$clone_crs\E/) {
+ if ($currclonecrs{'cloneable'} =~ /,/) {
+ my @currclonecrs = split/,/,$currclonecrs{'cloneable'};
+ foreach my $crs (@currclonecrs) {
+ if ($crs ne $clone_crs) {
+ $newclonecrs{'cloneable'} .= $crs.',';
+ }
}
+ $newclonecrs{'cloneable'} =~ s/,$//;
+ } else {
+ $newclonecrs{'cloneable'} = '';
}
- $newclonecrs{'cloneable'} =~ s/,$//;
- } else {
- $newclonecrs{'cloneable'} = '';
+ &Apache::lonnet::put('environment',\%newclonecrs,$udom,$uname);
}
- &Apache::lonnet::put('environment',\%newclonecrs,$udom,$uname);
}
}
}
|