version 1.49.2.12, 2013/12/27 15:06:40
|
version 1.84, 2017/02/07 15:44:23
|
Line 137 whether Domain coordinators who are curr
|
Line 137 whether Domain coordinators who are curr
|
advanced course user .db file for a course are to be hidden (e.g., |
advanced course user .db file for a course are to be hidden (e.g., |
in syllabus, or from course user lists). |
in syllabus, or from course user lists). |
|
|
Inputs: $cdom,$item,$settings,$crstype |
Inputs: $cdom,$item,$settings,$crstype,$noedit |
where $cdom is course domain, item is nothideprivileged, $settings is |
where $cdom is course domain, item is nothideprivileged, $settings is |
HASH ref of the current values for nothideprivileged, $crstype is |
HASH ref of the current values for nothideprivileged, $crstype is |
course type (Course or Community). |
course type (Course or Community). |
Line 215 use Apache::lonnet;
|
Line 215 use Apache::lonnet;
|
use Apache::loncommon(); |
use Apache::loncommon(); |
use Apache::lonhtmlcommon(); |
use Apache::lonhtmlcommon(); |
use Apache::lonconfigsettings; |
use Apache::lonconfigsettings; |
|
use Apache::lonrelrequtils; |
use Apache::lonparmset; |
use Apache::lonparmset; |
|
use Apache::courseclassifier; |
use Apache::lonlocal; |
use Apache::lonlocal; |
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
|
|
|
my $registered_cleanup; |
|
my $modified_courses; |
|
|
sub handler { |
sub handler { |
my $r=shift; |
my $r=shift; |
if ($r->header_only) { |
if ($r->header_only) { |
Line 228 sub handler {
|
Line 233 sub handler {
|
} |
} |
my $context = 'course'; |
my $context = 'course'; |
my $cid = $env{'request.course.id'}; |
my $cid = $env{'request.course.id'}; |
my ($cnum,$cdom) = &get_course($cid); |
my ($cnum,$cdom,$chome) = &get_course($cid); |
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
my $parm_permission = &Apache::lonnet::allowed('opa',$cid); |
my ($parm_permission,$allowed) = &get_permission($cid); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
if ($parm_permission && $navmap) { |
if ($allowed && $navmap) { |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
} else { |
} else { |
Line 257 sub handler {
|
Line 262 sub handler {
|
return HTTP_NOT_ACCEPTABLE; |
return HTTP_NOT_ACCEPTABLE; |
} |
} |
|
|
|
$registered_cleanup=0; |
|
@{$modified_courses}=(); |
|
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
['phase','actions','origin']); |
['phase','actions','origin']); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
Line 302 sub handler {
|
Line 310 sub handler {
|
idnu => 'Course ID or number', |
idnu => 'Course ID or number', |
unco => 'Unique code', |
unco => 'Unique code', |
desc => 'Course Description', |
desc => 'Course Description', |
cred => 'Student credits', |
cred => 'Student credits', |
ownr => 'Course Owner', |
ownr => 'Course Owner', |
cown => 'Course Co-owners', |
cown => 'Course Co-owners', |
catg => 'Categorize course', |
catg => 'Categorize course', |
Line 336 sub handler {
|
Line 344 sub handler {
|
$phase = $env{'form.phase'}; |
$phase = $env{'form.phase'}; |
} |
} |
|
|
if ($phase eq 'categorizecourse') { |
if (($phase eq 'categorizecourse') && ($parm_permission->{'categorizecourse'})) { |
&assign_course_categories($r,$crstype); |
&assign_course_categories($r,$crstype); |
return OK; |
return OK; |
} |
} |
|
|
if ($phase eq 'releaseinfo') { |
if (($phase eq 'releaseinfo') && ($parm_permission->{'releaseinfo'})) { |
my $loncaparev = $env{'course.'.$cid.'.internal.releaserequired'}; |
my $loncaparev = $env{'course.'.$cid.'.internal.releaserequired'}; |
if ($loncaparev) { |
if ($loncaparev) { |
&display_loncaparev_constraints($r,$navmap,$loncaparev,$crstype); |
if (&display_loncaparev_constraints($r,$navmap,$loncaparev,$crstype)) { |
|
push(@{$modified_courses},[$cdom,$cnum,$chome,$crstype]); |
|
unless ($registered_cleanup) { |
|
my $handlers = $r->get_handlers('PerlCleanupHandler'); |
|
$r->set_handlers('PerlCleanupHandler' => [\&update_releasereq,@{$handlers}]); |
|
$registered_cleanup=1; |
|
} |
|
} |
return OK; |
return OK; |
} |
} |
} |
} |
Line 367 sub handler {
|
Line 382 sub handler {
|
'co-owners' => $lt{'cown'}, |
'co-owners' => $lt{'cown'}, |
'description' => $lt{'desc'}, |
'description' => $lt{'desc'}, |
'courseid' => $lt{'idnu'}, |
'courseid' => $lt{'idnu'}, |
'uniquecode' => $lt{'unco'}, |
'uniquecode' => $lt{'unco'}, |
'categories' => $lt{'catg'}, |
'categories' => $lt{'catg'}, |
'hidefromcat' => $lt{'excc'}, |
'hidefromcat' => $lt{'excc'}, |
'cloners' => $lt{'clon'}, |
'cloners' => $lt{'clon'}, |
Line 404 sub handler {
|
Line 419 sub handler {
|
{ text => 'Discussion and Chat', |
{ text => 'Discussion and Chat', |
help => 'Course_Prefs_Discussions', |
help => 'Course_Prefs_Discussions', |
ordered => ['pch.roles.denied','pch.users.denied', |
ordered => ['pch.roles.denied','pch.users.denied', |
|
'pac.roles.denied','pac.users.denied', |
'plc.roles.denied','plc.users.denied', |
'plc.roles.denied','plc.users.denied', |
'allow_limited_html_in_feedback', |
'allow_limited_html_in_feedback', |
'allow_discussion_post_editing', |
'allow_discussion_post_editing', |
Line 413 sub handler {
|
Line 429 sub handler {
|
'pch.users.denied' => 'No Resource Discussion', |
'pch.users.denied' => 'No Resource Discussion', |
'plc.roles.denied' => 'No Chat room use', |
'plc.roles.denied' => 'No Chat room use', |
'plc.users.denied' => 'No Chat room use', |
'plc.users.denied' => 'No Chat room use', |
|
'pac.roles.denied' => 'No Anonymous Resource Discussion', |
|
'pac.users.denied' => 'No Anonymous Resource Discussion', |
allow_limited_html_in_feedback => 'Allow limited HTML in discussion', |
allow_limited_html_in_feedback => 'Allow limited HTML in discussion', |
allow_discussion_post_editing => 'Users can edit/delete own discussion posts', |
allow_discussion_post_editing => 'Users can edit/delete own discussion posts', |
discussion_post_fonts => 'Discussion post fonts based on likes/unlikes', |
discussion_post_fonts => 'Discussion post fonts based on likes/unlikes', |
}, |
}, |
}, |
}, |
'classlists' => |
'classlists' => |
Line 449 sub handler {
|
Line 467 sub handler {
|
help => 'Course_Prefs_Display', |
help => 'Course_Prefs_Display', |
ordered => ['default_xml_style','pageseparators', |
ordered => ['default_xml_style','pageseparators', |
'disable_receipt_display','texengine', |
'disable_receipt_display','texengine', |
'tthoptions'], |
'tthoptions','uselcmath','usejsme'], |
itemtext => { |
itemtext => { |
default_xml_style => 'Default XML style file', |
default_xml_style => 'Default XML style file', |
pageseparators => 'Visibly Separate Items on Pages', |
pageseparators => 'Visibly Separate Items on Pages', |
disable_receipt_display => 'Disable display of problem receipts', |
disable_receipt_display => 'Disable display of problem receipts', |
texengine => 'Force use of a specific math rendering engine', |
texengine => 'Force use of a specific math rendering engine', |
tthoptions => 'Default set of options to pass to tth/m when converting TeX', |
tthoptions => 'Default set of options to pass to tth/m when converting TeX', |
|
uselcmath => 'Student formula entry uses inline preview, not DragMath pop-up', |
|
usejsme => 'Molecule editor uses JSME (HTML5) in place of JME (Java)', |
}, |
}, |
}, |
}, |
'grading' => |
'grading' => |
Line 476 sub handler {
|
Line 496 sub handler {
|
help => 'Course_Prefs_Printouts', |
help => 'Course_Prefs_Printouts', |
ordered => ['problem_stream_switch','suppress_tries', |
ordered => ['problem_stream_switch','suppress_tries', |
'default_paper_size','print_header_format', |
'default_paper_size','print_header_format', |
'disableexampointprint'], |
'disableexampointprint','canuse_pdfforms'], |
itemtext => { |
itemtext => { |
problem_stream_switch => 'Allow problems to be split over pages', |
problem_stream_switch => 'Allow problems to be split over pages', |
suppress_tries => 'Suppress number of tries in printing', |
suppress_tries => 'Suppress number of tries in printing', |
Line 518 sub handler {
|
Line 538 sub handler {
|
}], |
}], |
}, |
}, |
); |
); |
if ($phase eq 'process') { |
if (($phase eq 'process') && ($parm_permission->{'process'})) { |
my @allitems = &get_allitems(%prefs); |
my @allitems = &get_allitems(%prefs); |
&Apache::lonconfigsettings::make_changes($r,$cdom,$phase,$context, |
&Apache::lonconfigsettings::make_changes($r,$cdom,$phase,$context, |
\@prefs_order,\%prefs,\%values, |
\@prefs_order,\%prefs,\%values, |
$cnum,undef,\@allitems,'coursepref'); |
$cnum,undef,\@allitems, |
} elsif ($phase eq 'display') { |
'coursepref',$parm_permission); |
my $jscript = &get_jscript($cid,$cdom,$phase,$crstype); |
} elsif (($phase eq 'display') && ($parm_permission->{'display'})) { |
|
my $jscript = &get_jscript($cid,$cdom,$phase,$crstype,\%values); |
my @allitems = &get_allitems(%prefs); |
my @allitems = &get_allitems(%prefs); |
&Apache::lonconfigsettings::display_settings($r,$cdom,$phase,$context, |
&Apache::lonconfigsettings::display_settings($r,$cdom,$phase,$context, |
\@prefs_order,\%prefs,\%values,undef,$jscript,\@allitems,$crstype,'coursepref'); |
\@prefs_order,\%prefs,\%values,undef,$jscript,\@allitems,$crstype, |
|
'coursepref',$parm_permission); |
} else { |
} else { |
&Apache::lonconfigsettings::display_choices($r,$phase,$context, |
&Apache::lonconfigsettings::display_choices($r,$phase,$context, |
\@prefs_order,\%prefs,'coursepref'); |
\@prefs_order,\%prefs, |
|
'coursepref',$parm_permission); |
} |
} |
return OK; |
return OK; |
} |
} |
|
|
|
sub get_permission { |
|
my ($cid) = @_; |
|
my %permission; |
|
my $allowed = 0; |
|
return (\%permission,$allowed) unless ($cid); |
|
if (&Apache::lonnet::allowed('opa',$cid)) { |
|
%permission= ( |
|
'pickactions' => 1, |
|
'categorizecourse' => 1, |
|
'releaseinfo' => 1, |
|
'process' => 1, |
|
'display' => 1, |
|
); |
|
} elsif (&Apache::lonnet::allowed('vpa',$env{'request.course.id'})) { |
|
%permission = ( |
|
'pickactions' => 1, |
|
'releaseinfo' => 1, |
|
'display' => 1, |
|
); |
|
} |
|
foreach my $perm (values(%permission)) { |
|
if ($perm) { $allowed=1; last; } |
|
} |
|
return (\%permission,$allowed); |
|
} |
|
|
sub get_allitems { |
sub get_allitems { |
my (%prefs) = @_; |
my (%prefs) = @_; |
my @allitems; |
my @allitems; |
Line 552 sub get_allitems {
|
Line 601 sub get_allitems {
|
} |
} |
|
|
sub print_config_box { |
sub print_config_box { |
my ($r,$cdom,$phase,$action,$item,$settings,$allitems,$crstype) = @_; |
my ($r,$cdom,$phase,$action,$item,$settings,$allitems,$crstype,$parm_permission) = @_; |
my $ordered = $item->{'ordered'}; |
my $ordered = $item->{'ordered'}; |
my $itemtext = $item->{'itemtext'}; |
my $itemtext = $item->{'itemtext'}; |
|
my $noedit; |
|
if (ref($parm_permission) eq 'HASH') { |
|
unless ($parm_permission->{'process'}) { |
|
$noedit = 1; |
|
} |
|
} |
my $rowtotal = 0; |
my $rowtotal = 0; |
my $output = |
my $output = |
'<table class="LC_nested_outer"> |
'<table class="LC_nested_outer"> |
Line 589 sub print_config_box {
|
Line 644 sub print_config_box {
|
} |
} |
$rowtotal ++; |
$rowtotal ++; |
if ($action eq 'feedback') { |
if ($action eq 'feedback') { |
$output .= &print_feedback('top',$cdom,$settings,$ordered,$itemtext,\$rowtotal); |
$output .= &print_feedback('top',$cdom,$settings,$ordered,$itemtext,\$rowtotal,$noedit); |
} elsif ($action eq 'classlists') { |
} elsif ($action eq 'classlists') { |
$output .= &print_classlists('top',$cdom,$settings,$itemtext,\$rowtotal,$crstype); |
$output .= &print_classlists('top',$cdom,$settings,$itemtext,\$rowtotal,$crstype,$noedit); |
} |
} |
$output .= ' |
$output .= ' |
</table> |
</table> |
Line 612 sub print_config_box {
|
Line 667 sub print_config_box {
|
$output .= &mt($item->{'header'}->[1]->{'col2'}).'</td> |
$output .= &mt($item->{'header'}->[1]->{'col2'}).'</td> |
</tr>'; |
</tr>'; |
if ($action eq 'classlists') { |
if ($action eq 'classlists') { |
$output .= &print_classlists('middle',$cdom,$settings,$itemtext,\$rowtotal,$crstype). |
$output .= &print_classlists('middle',$cdom,$settings,$itemtext,\$rowtotal,$crstype,$noedit). |
' |
' |
</table> |
</table> |
</td> |
</td> |
Line 651 sub print_config_box {
|
Line 706 sub print_config_box {
|
} |
} |
$rowtotal ++; |
$rowtotal ++; |
if ($action eq 'courseinfo') { |
if ($action eq 'courseinfo') { |
$output .= &print_courseinfo($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype); |
$output .= &print_courseinfo($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype,$noedit); |
} elsif ($action eq 'localization') { |
} elsif ($action eq 'localization') { |
$output .= &print_localization($cdom,$settings,$ordered,$itemtext,\$rowtotal); |
$output .= &print_localization($cdom,$settings,$ordered,$itemtext,\$rowtotal,$noedit); |
} elsif ($action eq 'feedback') { |
} elsif ($action eq 'feedback') { |
$output .= &print_feedback('bottom',$cdom,$settings,$ordered,$itemtext,\$rowtotal); |
$output .= &print_feedback('bottom',$cdom,$settings,$ordered,$itemtext,\$rowtotal,$noedit); |
} elsif ($action eq 'discussion') { |
} elsif ($action eq 'discussion') { |
$output .= &print_discussion($cdom,$settings,$ordered,$itemtext,\$rowtotal); |
$output .= &print_discussion($cdom,$settings,$ordered,$itemtext,\$rowtotal,$noedit); |
} elsif (($action eq 'classlists') || ($action eq 'viewableroster')) { |
} elsif (($action eq 'classlists') || ($action eq 'viewableroster')) { |
$output .= &print_classlists('bottom',$cdom,$settings,$itemtext,\$rowtotal,$crstype); |
$output .= &print_classlists('bottom',$cdom,$settings,$itemtext,\$rowtotal,$crstype,$noedit); |
} elsif ($action eq 'appearance') { |
} elsif ($action eq 'appearance') { |
$output .= &print_appearance($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype); |
$output .= &print_appearance($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype,$noedit); |
} elsif ($action eq 'grading') { |
} elsif ($action eq 'grading') { |
$output .= &print_grading($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype); |
$output .= &print_grading($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype,$noedit); |
} elsif ($action eq 'printouts') { |
} elsif ($action eq 'printouts') { |
$output .= &print_printouts($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype); |
$output .= &print_printouts($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype,$noedit); |
} elsif ($action eq 'spreadsheet') { |
} elsif ($action eq 'spreadsheet') { |
$output .= &print_spreadsheet($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype); |
$output .= &print_spreadsheet($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype,$noedit); |
} elsif ($action eq 'bridgetasks') { |
} elsif ($action eq 'bridgetasks') { |
$output .= &print_bridgetasks($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype); |
$output .= &print_bridgetasks($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype,$noedit); |
} elsif ($action eq 'other') { |
} elsif ($action eq 'other') { |
$output .= &print_other($cdom,$settings,$allitems,\$rowtotal,$crstype); |
$output .= &print_other($cdom,$settings,$allitems,\$rowtotal,$crstype,$noedit); |
} |
} |
$output .= ' |
$output .= ' |
</table> |
</table> |
Line 770 sub process_changes {
|
Line 825 sub process_changes {
|
my @clonedoms; |
my @clonedoms; |
if (exists($env{'form.cloners_activate'})) { |
if (exists($env{'form.cloners_activate'})) { |
my $actnum = $env{'form.cloners_activate'}; |
my $actnum = $env{'form.cloners_activate'}; |
if ($actnum ne '') { |
if ($actnum ne '-1') { |
if ($env{'form.cloners_dom_'.$actnum} ne '') { |
if ($env{'form.cloners_dom_'.$actnum} ne '') { |
my $clonedom = $env{'form.cloners_dom_'.$actnum}; |
my $clonedom = $env{'form.cloners_dom_'.$actnum}; |
if (&check_clone($clonedom,$disallowed) eq 'ok') { |
if (&check_clone($clonedom,$disallowed) eq 'ok') { |
Line 788 sub process_changes {
|
Line 843 sub process_changes {
|
my $clonedom = $env{'form.cloners_dom_'.$i}; |
my $clonedom = $env{'form.cloners_dom_'.$i}; |
if (&check_clone($clonedom,$disallowed) eq 'ok') { |
if (&check_clone($clonedom,$disallowed) eq 'ok') { |
if (!grep(/^\*:\Q$clonedom\E$/,@clonedoms)) { |
if (!grep(/^\*:\Q$clonedom\E$/,@clonedoms)) { |
push (@clonedoms,'*:'.$clonedom); |
push(@clonedoms,'*:'.$clonedom); |
} |
} |
} |
} |
} |
} |
Line 834 sub process_changes {
|
Line 889 sub process_changes {
|
} |
} |
} |
} |
} |
} |
|
if (ref($values) eq 'HASH') { |
|
my (@code_order,%codedefaults); |
|
&Apache::lonnet::auto_instcode_defaults($cdom,\%codedefaults, |
|
\@code_order); |
|
my $clonebycode; |
|
if ($env{'form.cloners_instcode'}) { |
|
if (@code_order > 0) { |
|
my @standardnames = &Apache::loncommon::get_standard_codeitems(); |
|
my %local_to_standard; |
|
for (my $i=0; $i<@code_order; $i++) { |
|
$local_to_standard{$code_order[$i]} = $standardnames[$i]; |
|
} |
|
foreach my $item (@code_order) { |
|
my $key = $local_to_standard{$item}; |
|
if ($key ne '') { |
|
if ($env{'form.'.$key}) { |
|
$clonebycode .= $key.'='.&escape($env{'form.'.$key}).'&'; |
|
} |
|
} |
|
} |
|
$clonebycode =~ s/\&$//; |
|
} |
|
} |
|
if ($clonebycode) { |
|
if ($newvalues{$entry}) { |
|
$newvalues{$entry} .= ','.$clonebycode; |
|
} else { |
|
$newvalues{$entry} = $clonebycode; |
|
} |
|
} |
|
} |
} |
} |
if (ref($disallowed) eq 'HASH') { |
if (ref($disallowed) eq 'HASH') { |
if (ref($disallowed->{'cloners'}) eq 'HASH') { |
if (ref($disallowed->{'cloners'}) eq 'HASH') { |
Line 973 sub process_changes {
|
Line 1059 sub process_changes {
|
} |
} |
} |
} |
} |
} |
} elsif (($entry eq 'plc.roles.denied') || ($entry eq 'pch.roles.denied')) { |
} elsif (($entry eq 'plc.roles.denied') || ($entry eq 'pch.roles.denied') || |
|
($entry eq 'pac.roles.denied')) { |
my @denied = &Apache::loncommon::get_env_multiple('form.'.$entry); |
my @denied = &Apache::loncommon::get_env_multiple('form.'.$entry); |
@denied = sort(@denied); |
@denied = sort(@denied); |
my $deniedstr = ''; |
my $deniedstr = ''; |
Line 981 sub process_changes {
|
Line 1068 sub process_changes {
|
$deniedstr = join(',',@denied); |
$deniedstr = join(',',@denied); |
} |
} |
$newvalues{$entry} = $deniedstr; |
$newvalues{$entry} = $deniedstr; |
} elsif (($entry eq 'plc.users.denied') || ($entry eq 'pch.users.denied')) { |
} elsif (($entry eq 'plc.users.denied') || ($entry eq 'pch.users.denied') || |
|
($entry eq 'pac.users.denied')) { |
my $total = $env{'form.'.$entry.'_total'}; |
my $total = $env{'form.'.$entry.'_total'}; |
my $userstr = ''; |
my $userstr = ''; |
my @denied; |
my @denied; |
Line 1033 sub process_changes {
|
Line 1121 sub process_changes {
|
my ($classorder,$classtitles) = &discussion_vote_classes(); |
my ($classorder,$classtitles) = &discussion_vote_classes(); |
my $fontchange = 0; |
my $fontchange = 0; |
foreach my $class (@{$classorder}) { |
foreach my $class (@{$classorder}) { |
my $ext_entry = $entry.'_'.$class; |
my $ext_entry = $entry.'_'.$class; |
my $size = $env{'form.'.$ext_entry.'_size'}; |
my $size = $env{'form.'.$ext_entry.'_size'}; |
my $unit = $env{'form.'.$ext_entry.'_unit'}; |
my $unit = $env{'form.'.$ext_entry.'_unit'}; |
my $weight = $env{'form.'.$ext_entry.'_weight'}; |
my $weight = $env{'form.'.$ext_entry.'_weight'}; |
my $style = $env{'form.'.$ext_entry.'_style'}; |
my $style = $env{'form.'.$ext_entry.'_style'}; |
my $other = $env{'form.'.$ext_entry.'_other'}; |
my $other = $env{'form.'.$ext_entry.'_other'}; |
$size =~ s/,//g; |
$size =~ s/,//g; |
$unit =~ s/,//g; |
$unit =~ s/,//g; |
$weight =~ s/,//g; |
$weight =~ s/,//g; |
$style =~ s/,//g; |
$style =~ s/,//g; |
$other =~ s/[^\w;:\s\-\%.]//g; |
$other =~ s/[^\w;:\s\-\%.]//g; |
Line 1048 sub process_changes {
|
Line 1136 sub process_changes {
|
$newvalues{$ext_entry} = join(',',($size.$unit,$weight,$style,$other)); |
$newvalues{$ext_entry} = join(',',($size.$unit,$weight,$style,$other)); |
my $current = $values->{$ext_entry}; |
my $current = $values->{$ext_entry}; |
if ($values->{$ext_entry} eq '') { |
if ($values->{$ext_entry} eq '') { |
$current = ',,,'; |
$current = ',,,'; |
} |
} |
if ($newvalues{$ext_entry} ne $current) { |
if ($newvalues{$ext_entry} ne $current) { |
$changes->{$ext_entry} = $newvalues{$ext_entry}; |
$changes->{$ext_entry} = $newvalues{$ext_entry}; |
Line 1057 sub process_changes {
|
Line 1145 sub process_changes {
|
} |
} |
if ($fontchange) { |
if ($fontchange) { |
$changes->{$entry} = 1; |
$changes->{$entry} = 1; |
} |
} |
} elsif ($entry eq 'nothideprivileged') { |
} elsif ($entry eq 'nothideprivileged') { |
my @curr_nothide; |
my @curr_nothide; |
my @new_nothide; |
my @new_nothide; |
Line 1132 sub process_changes {
|
Line 1220 sub process_changes {
|
my $newtext = $maxnum-1; |
my $newtext = $maxnum-1; |
$newhdr[$env{'form.printfmthdr_pos_'.$newtext}] = $env{'form.printfmthdr_text_'.$newtext}; |
$newhdr[$env{'form.printfmthdr_pos_'.$newtext}] = $env{'form.printfmthdr_text_'.$newtext}; |
$newvalues{$entry} = join('',@newhdr); |
$newvalues{$entry} = join('',@newhdr); |
} elsif (($entry eq 'languages') || |
} elsif (($entry eq 'languages') || |
($entry eq 'checkforpriv')) { |
($entry eq 'checkforpriv')) { |
my $settings; |
my $settings; |
my $total = $env{'form.'.$entry.'_total'}; |
my $total = $env{'form.'.$entry.'_total'}; |
Line 1148 sub process_changes {
|
Line 1236 sub process_changes {
|
} |
} |
if ($env{'form.'.$entry.'_'.$total} ne '') { |
if ($env{'form.'.$entry.'_'.$total} ne '') { |
my $new = $env{'form.'.$entry.'_'.$total}; |
my $new = $env{'form.'.$entry.'_'.$total}; |
if ($entry eq 'languages') { |
if ($entry eq 'languages') { |
my %langchoices = &get_lang_choices(); |
my %langchoices = &get_lang_choices(); |
if ($langchoices{$new}) { |
if ($langchoices{$new}) { |
$settings .= $new; |
$settings .= $new; |
Line 1391 sub store_changes {
|
Line 1479 sub store_changes {
|
$displayval = &Apache::lonlocal::locallocaltime($displayval); |
$displayval = &Apache::lonlocal::locallocaltime($displayval); |
} elsif ($key eq 'categories') { |
} elsif ($key eq 'categories') { |
$displayval = $env{'form.categories_display'}; |
$displayval = $env{'form.categories_display'}; |
} elsif ($key eq 'canuse_pdfforms') { |
} elsif (($key eq 'canuse_pdfforms') || ($key eq 'usejsme') || ($key eq 'uselcmath')) { |
if ($changes->{$item}{$key} eq '1') { |
if ($changes->{$item}{$key} eq '1') { |
$displayval = &mt('Yes'); |
$displayval = &mt('Yes'); |
} elsif ($changes->{$item}{$key} eq '0') { |
} elsif ($changes->{$item}{$key} eq '0') { |
Line 1663 sub get_course {
|
Line 1751 sub get_course {
|
} |
} |
my $cdom=$env{'course.'.$courseid.'.domain'}; |
my $cdom=$env{'course.'.$courseid.'.domain'}; |
my $cnum=$env{'course.'.$courseid.'.num'}; |
my $cnum=$env{'course.'.$courseid.'.num'}; |
return ($cnum,$cdom); |
my $chome=$env{'course.'.$courseid.'.home'}; |
|
return ($cnum,$cdom,$chome); |
} |
} |
|
|
sub get_jscript { |
sub get_jscript { |
my ($cid,$cdom,$phase,$crstype) = @_; |
my ($cid,$cdom,$phase,$crstype,$settings) = @_; |
my ($can_toggle_cat,$can_categorize) = &can_modify_catsettings($cdom,$crstype); |
my ($can_toggle_cat,$can_categorize) = &can_modify_catsettings($cdom,$crstype); |
my ($jscript,$categorize_js,$loncaparev_js); |
my ($jscript,$categorize_js,$loncaparev_js,$instcode_js); |
my $stubrowse_js = &Apache::loncommon::studentbrowser_javascript(); |
my $stubrowse_js = &Apache::loncommon::studentbrowser_javascript(); |
my $browse_js = &Apache::loncommon::browser_and_searcher_javascript('parmset'); |
my $browse_js = &Apache::loncommon::browser_and_searcher_javascript('parmset'); |
my $cloners_js = &cloners_javascript($phase); |
my $cloners_js = &cloners_javascript($phase); |
|
my @code_order; |
|
if ($crstype ne 'Community') { |
|
if (ref($settings) eq 'HASH') { |
|
my %codedefaults; |
|
&Apache::lonnet::auto_instcode_defaults($cdom,\%codedefaults, |
|
\@code_order); |
|
if (@code_order > 0) { |
|
if ($phase eq 'display') { |
|
my @actions = &Apache::loncommon::get_env_multiple('form.actions'); |
|
if (grep(/^courseinfo$/,@actions)) { |
|
if ($settings->{'cloners'} ne '') { |
|
unless ($settings->{'cloners'} eq '*') { |
|
my @cloners = split(/,/,$settings->{'cloners'}); |
|
my @standardnames = &Apache::loncommon::get_standard_codeitems(); |
|
my %local_to_standard; |
|
for (my $i=0; $i<@code_order; $i++) { |
|
$local_to_standard{$code_order[$i]} = $standardnames[$i]; |
|
} |
|
foreach my $cloner (@cloners) { |
|
if (($cloner !~ /^\Q*:\E$match_domain$/) && |
|
($cloner !~ /^$match_username\:$match_domain$/)) { |
|
foreach my $item (split(/\&/,$cloner)) { |
|
my ($key,$val) = split(/\=/,$item); |
|
$val = &unescape($val); |
|
foreach my $code (@code_order) { |
|
if ($key eq $local_to_standard{$code}) { |
|
$env{'form.'.$key} = $val; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
my @codetitles; |
|
(undef,$instcode_js) = |
|
&Apache::courseclassifier::instcode_selectors($cdom,'display',undef, |
|
\@codetitles); |
|
$instcode_js .= <<ENDSCRIPT; |
|
function toggleCloners(callerradio) { |
|
if (document.getElementById('LC_cloners_instcode')) { |
|
if (callerradio.value == 1) { |
|
document.getElementById('LC_cloners_instcode').style.display = "block"; |
|
} else { |
|
uncheckOfficialLists(); |
|
document.getElementById('LC_cloners_instcode').style.display = "none"; |
|
} |
|
} |
|
} |
|
|
|
if (!document.getElementsByClassName) { |
|
function getElementsByClassName(node, classname) { |
|
var a = []; |
|
var re = new RegExp('(^| )'+classname+'( |$)'); |
|
var els = node.getElementsByTagName("*"); |
|
for(var i=0,j=els.length; i<j; i++) |
|
if(re.test(els[i].className))a.push(els[i]); |
|
return a; |
|
} |
|
} |
|
|
|
function uncheckOfficialLists() { |
|
var codepicks; |
|
if (document.getElementsByClassName) { |
|
codepicks = document.getElementsByClassName('LC_cloners_instcodes'); |
|
} else { |
|
codepicks = getElementsByClassName(document.body,'LC_cloners_instcodes'); |
|
} |
|
if (codepicks.length) { |
|
for (var i=0; i<codepicks.length; i++) { |
|
codepicks[i].selectedIndex = 0; |
|
} |
|
} |
|
} |
|
|
|
ENDSCRIPT |
|
} |
|
} |
|
} |
if ($can_categorize) { |
if ($can_categorize) { |
$categorize_js = <<ENDSCRIPT; |
$categorize_js = <<ENDSCRIPT; |
function catsbrowser() { |
function catsbrowser() { |
Line 1713 function syllabusinfo() {
|
Line 1883 function syllabusinfo() {
|
} |
} |
ENDSCRIPT |
ENDSCRIPT |
$jscript = '<script type="text/javascript" language="Javascript">'."\n". |
$jscript = '<script type="text/javascript" language="Javascript">'."\n". |
'// <![CDATA['."\n". |
'// <![CDATA['."\n". |
$browse_js."\n".$categorize_js."\n".$loncaparev_js."\n". |
$browse_js."\n".$categorize_js."\n".$loncaparev_js."\n". |
$cloners_js."\n". |
$cloners_js."\n".$instcode_js. |
$syllabus_js."\n".'//]]>'."\n". |
$syllabus_js."\n".'//]]>'."\n". |
'</script>'."\n".$stubrowse_js."\n"; |
'</script>'."\n".$stubrowse_js."\n"; |
return $jscript; |
return $jscript; |
Line 1751 function update_cloners(caller,num) {
|
Line 1921 function update_cloners(caller,num) {
|
if (document.$formname.cloners_activate[i].value == '0') { |
if (document.$formname.cloners_activate[i].value == '0') { |
document.$formname.cloners_activate[i].checked = false; |
document.$formname.cloners_activate[i].checked = false; |
} |
} |
if (document.$formname.cloners_activate[i].value == '') { |
if (document.$formname.cloners_activate[i].value == '-1') { |
document.$formname.cloners_activate[i].checked = true; |
document.$formname.cloners_activate[i].checked = true; |
} |
} |
} |
} |
Line 1804 ENDSCRIPT
|
Line 1974 ENDSCRIPT
|
|
|
|
|
sub print_courseinfo { |
sub print_courseinfo { |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$crstype) = @_; |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$crstype,$noedit) = @_; |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
return; |
return; |
} |
} |
my ($cathash,$categoriesform,$autocoowner); |
my ($cathash,$categoriesform,$autocoowner,$clonedefaults,$disabled); |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
my %domconf = |
my %domconf = |
&Apache::lonnet::get_dom('configuration',['coursecategories','autoenroll'],$cdom); |
&Apache::lonnet::get_dom('configuration', |
|
['coursecategories','autoenroll','coursedefaults'],$cdom); |
if (ref($domconf{'coursecategories'}) eq 'HASH') { |
if (ref($domconf{'coursecategories'}) eq 'HASH') { |
$cathash = $domconf{'coursecategories'}{'cats'}; |
$cathash = $domconf{'coursecategories'}{'cats'}; |
if (ref($cathash) eq 'HASH') { |
if (ref($cathash) eq 'HASH') { |
$categoriesform = |
$categoriesform = |
&Apache::loncommon::assign_categories_table($cathash, |
&Apache::loncommon::assign_categories_table($cathash, |
$settings->{'categories'},$crstype)."\n"; |
$settings->{'categories'},$crstype,$disabled)."\n"; |
} |
} |
} |
} |
if (ref($domconf{'autoenroll'}) eq 'HASH') { |
if (ref($domconf{'autoenroll'}) eq 'HASH') { |
$autocoowner = $domconf{'autoenroll'}{'co-owners'}; |
$autocoowner = $domconf{'autoenroll'}{'co-owners'}; |
} |
} |
|
my ($currcanclone,@code_order,$cloner_instcode); |
|
my %codedefaults; |
|
&Apache::lonnet::auto_instcode_defaults($cdom,\%codedefaults, |
|
\@code_order); |
|
if ($settings->{'cloners'}) { |
|
unless ($settings->{'cloners'} eq '*') { |
|
my @currclone = split(/,/,$settings->{'cloners'}); |
|
foreach my $item (@currclone) { |
|
unless ($item eq '*') { |
|
if (($item !~ /\:/) && ($item =~ /=/)) { |
|
$cloner_instcode = 1; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
if (ref($domconf{'coursedefaults'}) eq 'HASH') { |
|
my $canclone = $domconf{'coursedefaults'}{'canclone'}; |
|
if (ref($canclone) eq 'HASH') { |
|
if (ref($canclone->{'instcode'}) eq 'ARRAY') { |
|
if ($settings->{'internal.coursecode'}) { |
|
my @posscodes; |
|
if (@code_order > 0) { |
|
$currcanclone = 'instcode'; |
|
foreach my $item (@{$canclone->{'instcode'}}) { |
|
if (grep(/^\Q$item\E$/,@code_order)) { |
|
push(@posscodes,$item); |
|
} |
|
} |
|
my $codestr = join(' + ',@posscodes); |
|
$clonedefaults = &mt('Default for official courses is to also allow cloning if [_1] match in cloner and cloned.', |
|
'"<span class="LC_nobreak" style="font-style:italic">'.$codestr.'</span>"').'<br />'; |
|
} |
|
} |
|
} |
|
} elsif ($canclone eq 'domain') { |
|
$clonedefaults = &mt('Default is for any course requester in [_1] domain to be able to clone.', |
|
'<span class="LC_nobreak" style="font-style:italic">'.$cdom.'</span>').'<br />'; |
|
$currcanclone = 'domain'; |
|
} |
|
if ($clonedefaults) { |
|
if ($settings->{'cloners'} ne '') { |
|
$clonedefaults .= '<br />'.&mt('Default does [_1]not[_2] currently apply because values have been set in the course.','<b>','</b>'); |
|
} else { |
|
$clonedefaults .= &mt('Default is disregarded if [_1]any[_2] values are set here in the course.','<i>','</i>'); |
|
} |
|
$clonedefaults = '<br /><br />'.$clonedefaults; |
|
} |
|
} |
if (!defined($categoriesform)) { |
if (!defined($categoriesform)) { |
$categoriesform = &mt('No categories defined in this domain.'); |
$categoriesform = &mt('No categories defined in this domain.'); |
} |
} |
|
|
my ($can_toggle_cat,$can_categorize) = &can_modify_catsettings($cdom,$crstype); |
my ($can_toggle_cat,$can_categorize) = &can_modify_catsettings($cdom,$crstype); |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
|
Line 1835 sub print_courseinfo {
|
Line 2057 sub print_courseinfo {
|
} else { |
} else { |
$replace = &mt('To replace the standard title for a course role, enter a title, otherwise leave blank'); |
$replace = &mt('To replace the standard title for a course role, enter a title, otherwise leave blank'); |
} |
} |
|
my ($editmap,$editsyllabus); |
|
unless ($noedit) { |
|
$editmap = (' 'x2). |
|
'<a href="javascript:openbrowser'. |
|
"('display','url','sequence')\">". |
|
&mt('Select Map').'</a><br /><span class="LC_warning"> '. |
|
&mt('Modification may make assessment data inaccessible!'). |
|
'</span>'; |
|
$editsyllabus = &mt('[_1]Edit[_2]','<a href="/public/'.$cdom.'/'.$cnum.'/syllabus?forceedit=1">', |
|
'</a>'); |
|
} |
my %items = ( |
my %items = ( |
'url' => { |
'url' => { |
text => '<b>'.&mt($itemtext->{'url'}).'</b>'.(' 'x2). |
text => '<b>'.&mt($itemtext->{'url'}).'</b>'.$editmap, |
'<a href="javascript:openbrowser'. |
|
"('display','url','sequence')\">". |
|
&mt('Select Map').'</a><br /><span class="LC_warning"> '. |
|
&mt('Modification may make assessment data inaccessible!'). |
|
'</span>', |
|
input => 'textbox', |
input => 'textbox', |
size => '55', |
size => '55', |
advanced => 1 |
advanced => 1 |
Line 1872 sub print_courseinfo {
|
Line 2100 sub print_courseinfo {
|
}, |
}, |
'cloners' => { |
'cloners' => { |
text => '<b>'.&mt($itemtext->{'cloners'}).'</b><br />'. |
text => '<b>'.&mt($itemtext->{'cloners'}).'</b><br />'. |
&mt('Owner and Coordinators included automatically'), |
&mt('Owner and Coordinators included automatically'). |
|
$clonedefaults, |
input => 'textbox', |
input => 'textbox', |
size => '40' |
size => '40' |
}, |
}, |
Line 1886 sub print_courseinfo {
|
Line 2115 sub print_courseinfo {
|
'externalsyllabus' => { |
'externalsyllabus' => { |
text => '<b>'.&mt($itemtext->{'externalsyllabus'}).'</b><br />'. |
text => '<b>'.&mt($itemtext->{'externalsyllabus'}).'</b><br />'. |
&mt('(Syllabus type in use)').(' ' x2). |
&mt('(Syllabus type in use)').(' ' x2). |
&mt('[_1]Edit[_2]','<a href="/public/'.$cdom.'/'.$cnum.'/syllabus?forceedit=1">', |
$editsyllabus, |
'</a>'), |
|
}, |
}, |
'hidefromcat' => { |
'hidefromcat' => { |
text => '<b>'.&mt($itemtext->{'hidefromcat'}).'</b><br />'. |
text => '<b>'.&mt($itemtext->{'hidefromcat'}).'</b><br />'. |
Line 1919 sub print_courseinfo {
|
Line 2147 sub print_courseinfo {
|
next if (!$env{'course.'.$env{'request.course.id'}.'.internal.uniquecode'}); |
next if (!$env{'course.'.$env{'request.course.id'}.'.internal.uniquecode'}); |
} |
} |
unless (($item eq 'cloners') || ($item eq 'rolenames')) { |
unless (($item eq 'cloners') || ($item eq 'rolenames')) { |
$colspan = 2; |
$colspan = 2; |
} |
} |
$count ++; |
$count ++; |
if (exists $items{$item}{advanced} && $items{$item}{advanced} == 1) { |
if (exists $items{$item}{advanced} && $items{$item}{advanced} == 1) { |
Line 1928 sub print_courseinfo {
|
Line 2156 sub print_courseinfo {
|
$datatable .= &item_table_row_start($items{$item}{text},$count,undef,$colspan); |
$datatable .= &item_table_row_start($items{$item}{text},$count,undef,$colspan); |
} |
} |
if ($items{$item}{input} eq 'radio') { |
if ($items{$item}{input} eq 'radio') { |
$datatable .= &yesno_radio($item,$settings); |
$datatable .= &yesno_radio($item,$settings,undef,undef,undef,$noedit); |
} elsif ($item eq 'cloners') { |
} elsif ($item eq 'cloners') { |
my $includeempty = 1; |
my $includeempty = 1; |
my $num = 0; |
my $num = 0; |
Line 1942 sub print_courseinfo {
|
Line 2170 sub print_courseinfo {
|
$datatable .= ' checked="checked" '; |
$datatable .= ' checked="checked" '; |
} |
} |
$datatable .= 'onchange="javascript:update_cloners('. |
$datatable .= 'onchange="javascript:update_cloners('. |
"'cloners_all'".');" />'.&mt('Yes').'</label>'. |
"'cloners_all'".');"'.$disabled.' />'.&mt('Yes').'</label>'. |
(' 'x2).'<input type="radio" name="cloners_all" value="0" '; |
(' 'x2).'<label>'. |
|
'<input type="radio" name="cloners_all" value="0" '; |
if ($settings->{$item} ne '*') { |
if ($settings->{$item} ne '*') { |
$datatable .= ' checked="checked" '; |
$datatable .= ' checked="checked" '; |
} |
} |
$datatable .= ' onchange="javascript:update_cloners('. |
$datatable .= ' onchange="javascript:update_cloners('. |
"'cloners_all'".');"/>'.&mt('No').'</label></td>'. |
"'cloners_all'".');"'.$disabled.' />'.&mt('No').'</label></td>'. |
&Apache::loncommon::end_data_table_row(). |
&Apache::loncommon::end_data_table_row(). |
&Apache::loncommon::end_data_table(). |
&Apache::loncommon::end_data_table(). |
'<table><tr><td align="left"><b>'.&mt('Or'). |
'<table><tr><td align="left"><b>'.&mt('Or'). |
Line 1956 sub print_courseinfo {
|
Line 2185 sub print_courseinfo {
|
&Apache::loncommon::start_data_table(); |
&Apache::loncommon::start_data_table(); |
my @cloners; |
my @cloners; |
if ($settings->{$item} eq '') { |
if ($settings->{$item} eq '') { |
$datatable .= &new_cloners_dom_row($cdom,'0'); |
unless ($noedit) { |
|
my $default; |
|
if ($currcanclone eq 'domain') { |
|
$default = '0'; |
|
} |
|
$datatable .= &new_cloners_dom_row($cdom,'0',$default); |
|
} |
} elsif ($settings->{$item} ne '*') { |
} elsif ($settings->{$item} ne '*') { |
my @entries = split(/,/,$settings->{$item}); |
my @entries = split(/,/,$settings->{$item}); |
if (@entries > 0) { |
if (@entries > 0) { |
Line 1977 sub print_courseinfo {
|
Line 2212 sub print_courseinfo {
|
'</b><input type="hidden" name="cloners_dom_'.$num. |
'</b><input type="hidden" name="cloners_dom_'.$num. |
'" value="'.$udom.'" /></span><br />'. |
'" value="'.$udom.'" /></span><br />'. |
'<span class="LC_nobreak"><label><input type="checkbox" '. |
'<span class="LC_nobreak"><label><input type="checkbox" '. |
'name="cloners_delete" value="'.$num.'" onchange="javascript:update_cloners('."'cloners_delete','$num'".');" />'. |
'name="cloners_delete" value="'.$num.'" onchange="javascript:update_cloners('."'cloners_delete','$num'".');"'.$disabled.' />'. |
&mt('Delete').'</label></span></td>'. |
&mt('Delete').'</label></span></td>'. |
&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table_row(); |
$num ++; |
$num ++; |
Line 2000 sub print_courseinfo {
|
Line 2235 sub print_courseinfo {
|
'<td align="left"><span class="LC_nobreak">'. |
'<td align="left"><span class="LC_nobreak">'. |
$add_domtitle.'</span><br />'. |
$add_domtitle.'</span><br />'. |
&Apache::loncommon::select_dom_form('','cloners_newdom', |
&Apache::loncommon::select_dom_form('','cloners_newdom', |
$includeempty). |
$includeempty,undef,undef, |
|
undef,undef,$noedit). |
'<input type="hidden" name="cloners_total" value="'.$num.'" />'. |
'<input type="hidden" name="cloners_total" value="'.$num.'" />'. |
'</td>'.&Apache::loncommon::end_data_table_row(). |
'</td>'.&Apache::loncommon::end_data_table_row(). |
&Apache::loncommon::end_data_table(). |
&Apache::loncommon::end_data_table(). |
Line 2012 sub print_courseinfo {
|
Line 2248 sub print_courseinfo {
|
&mt('Specific users').' (<tt>'. |
&mt('Specific users').' (<tt>'. |
&mt('user:domain,user:domain').'</tt>)<br />'. |
&mt('user:domain,user:domain').'</tt>)<br />'. |
&Apache::lonhtmlcommon::textbox($item,$cloners_str, |
&Apache::lonhtmlcommon::textbox($item,$cloners_str, |
$items{$item}{'size'}). |
$items{$item}{'size'},$disabled). |
'</td>'.&Apache::loncommon::end_data_table_row(). |
'</td>'.&Apache::loncommon::end_data_table_row(). |
&Apache::loncommon::end_data_table(); |
&Apache::loncommon::end_data_table(); |
|
if (@code_order > 0) { |
|
my (%cat_items,@codetitles,%cat_titles,%cat_order); |
|
my ($jscript,$totcodes,$numtitles,$lasttitle) = |
|
&Apache::courseclassifier::instcode_selectors_data($cdom,'display', |
|
\%cat_items,\@codetitles, |
|
\%cat_titles,\%cat_order); |
|
my $showncodes = 'off'; |
|
my $checkedoff = ' checked="checked"'; |
|
my $checkedon = ''; |
|
if ($cloner_instcode) { |
|
$checkedon = $checkedoff; |
|
$checkedoff = ''; |
|
$showncodes = 'on'; |
|
} |
|
$datatable .= '<table><tr><td align="left"><b>'.&mt('And'). |
|
'</b></td></tr></table>'. |
|
&Apache::loncommon::start_data_table(). |
|
&Apache::loncommon::start_data_table_row(). |
|
'<td align="left"><span class="LC_nobreak">'. |
|
&mt('Cloning by official course(s) based on course category').(' 'x2). |
|
'<label>'. |
|
'<input type="radio" name="cloners_instcode" value="1" onclick="toggleCloners(this);"'.$checkedon.$disabled.' />'.&mt('Yes').'</label>'. |
|
(' '). |
|
'<label>'. |
|
'<input type="radio" name="cloners_instcode" value="0" onclick="toggleCloners(this);"'.$checkedoff.$disabled.' />'.&mt('No').'</label>'. |
|
&Apache::courseclassifier::build_instcode_selectors($numtitles, |
|
$lasttitle,\%cat_items,\@codetitles,\%cat_titles,\%cat_order, |
|
$showncodes,'LC_cloners_instcodes','LC_cloners_instcode',$noedit). |
|
'</td>'.&Apache::loncommon::end_data_table_row(). |
|
&Apache::loncommon::end_data_table(); |
|
} |
} elsif ($item eq 'rolenames') { |
} elsif ($item eq 'rolenames') { |
$datatable .= '</td><td align="right">'. |
$datatable .= '</td><td align="right">'. |
&Apache::loncommon::start_data_table(); |
&Apache::loncommon::start_data_table(); |
Line 2032 sub print_courseinfo {
|
Line 2299 sub print_courseinfo {
|
'</span></td><td align="left">'. |
'</span></td><td align="left">'. |
&Apache::lonhtmlcommon::textbox('rolenames_'.$role, |
&Apache::lonhtmlcommon::textbox('rolenames_'.$role, |
$settings->{$role.'.plaintext'}, |
$settings->{$role.'.plaintext'}, |
$items{$item}{size}).'</td>'. |
$items{$item}{size},$disabled).'</td>'. |
&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table_row(); |
} |
} |
$datatable .= &Apache::loncommon::end_data_table().'</td>'; |
$datatable .= &Apache::loncommon::end_data_table().'</td>'; |
} elsif ($item eq 'categories') { |
} elsif ($item eq 'categories') { |
my $launcher = 'onfocus="this.blur();javascript:catsbrowser();"'; |
my $launcher; |
|
if ($noedit) { |
|
$launcher = $disabled; |
|
} else { |
|
$launcher = 'onfocus="this.blur();javascript:catsbrowser();"'; |
|
} |
$datatable .= '<input type="hidden" name="categories" value="'.$settings->{$item}.'" />'. |
$datatable .= '<input type="hidden" name="categories" value="'.$settings->{$item}.'" />'. |
&Apache::lonhtmlcommon::textbox($item.'_display',$settings->{$item}, |
&Apache::lonhtmlcommon::textbox($item.'_display',$settings->{$item}, |
$items{$item}{size},$launcher); |
$items{$item}{size},$launcher); |
Line 2056 sub print_courseinfo {
|
Line 2328 sub print_courseinfo {
|
my $clonesrc = $env{'course.'.$env{'request.course.id'}.'.clonedfrom'}; |
my $clonesrc = $env{'course.'.$env{'request.course.id'}.'.clonedfrom'}; |
my $clonedfrom = &mt('None'); |
my $clonedfrom = &mt('None'); |
if ($clonesrc =~ m{/$match_domain/$match_courseid}) { |
if ($clonesrc =~ m{/$match_domain/$match_courseid}) { |
my %clonesrcinfo = &Apache::lonnet::coursedescription($cdom.'/'.$cnum); |
my %clonesrcinfo = &Apache::lonnet::coursedescription($clonesrc); |
if ($clonesrcinfo{'description'}) { |
if ($clonesrcinfo{'description'}) { |
$clonedfrom = $clonesrcinfo{'description'}.' '.($clonesrc); |
$clonedfrom = $clonesrcinfo{'description'}.' '.($clonesrc); |
} |
} |
} |
} |
$datatable .= $clonedfrom; |
$datatable .= $clonedfrom; |
} elsif ($item eq 'uniquecode') { |
} elsif ($item eq 'uniquecode') { |
my $code = $env{'course.'.$env{'request.course.id'}.'.internal.uniquecode'}; |
my $code = $env{'course.'.$env{'request.course.id'}.'.internal.uniquecode'}; |
if ($code) { |
if ($code) { |
$datatable .= $code; |
$datatable .= $code; |
} |
} |
Line 2077 sub print_courseinfo {
|
Line 2349 sub print_courseinfo {
|
if (($crstype eq 'Course') && ($env{'course.'.$env{'request.course.id'}.'.internal.coursecode'}) && ($autocoowner)) { |
if (($crstype eq 'Course') && ($env{'course.'.$env{'request.course.id'}.'.internal.coursecode'}) && ($autocoowner)) { |
$datatable .= &show_autocoowners(@currcoown); |
$datatable .= &show_autocoowners(@currcoown); |
} else { |
} else { |
$datatable .= &coowner_invitations($cnum,$cdom,@currcoown); |
$datatable .= &coowner_invitations($cnum,$cdom,\@currcoown,$noedit); |
} |
} |
} else { |
} else { |
if (($crstype eq 'Course') && ($env{'course.'.$env{'request.course.id'}.'.internal.coursecode'}) && ($autocoowner)) { |
if (($crstype eq 'Course') && ($env{'course.'.$env{'request.course.id'}.'.internal.coursecode'}) && ($autocoowner)) { |
$datatable .= &show_autocoowners(@currcoown); |
$datatable .= &show_autocoowners(@currcoown); |
} else { |
} else { |
$datatable .= &manage_coownership($cnum,$cdom,@currcoown); |
$datatable .= &manage_coownership($cnum,$cdom,\@currcoown,$noedit); |
} |
} |
} |
} |
} elsif ($item eq 'externalsyllabus') { |
} elsif ($item eq 'externalsyllabus') { |
Line 2110 sub print_courseinfo {
|
Line 2382 sub print_courseinfo {
|
} elsif ($uploaded) { |
} elsif ($uploaded) { |
$datatable .= &mt('Uploaded file'); |
$datatable .= &mt('Uploaded file'); |
} else { |
} else { |
$datatable .= &mt('Standard template'); |
$datatable .= &mt('Standard template'); |
} |
} |
$datatable .= (' ' x 2). |
$datatable .= (' ' x 2). |
&mt('[_1]View[_2]', |
&mt('[_1]View[_2]', |
'<a href="javascript:syllabusinfo();">', |
'<a href="javascript:syllabusinfo();">', |
'</a>'); |
'</a>'); |
} elsif ($item eq 'loncaparev') { |
} elsif ($item eq 'loncaparev') { |
my $loncaparev = $env{'course.'.$env{'request.course.id'}.'.internal.releaserequired'}; |
my $loncaparev = $env{'course.'.$env{'request.course.id'}.'.internal.releaserequired'}; |
my $showreqd; |
my $showreqd; |
Line 2127 sub print_courseinfo {
|
Line 2399 sub print_courseinfo {
|
} |
} |
$datatable .= $showreqd; |
$datatable .= $showreqd; |
} else { |
} else { |
$datatable .= &Apache::lonhtmlcommon::textbox($item,$settings->{$item},$items{$item}{size}); |
$datatable .= &Apache::lonhtmlcommon::textbox($item,$settings->{$item},$items{$item}{size},$disabled); |
} |
} |
$datatable .= &item_table_row_end(); |
$datatable .= &item_table_row_end(); |
} |
} |
Line 2136 sub print_courseinfo {
|
Line 2408 sub print_courseinfo {
|
} |
} |
|
|
sub new_cloners_dom_row { |
sub new_cloners_dom_row { |
my ($newdom,$num) = @_; |
my ($newdom,$num,$default) = @_; |
my $output; |
my ($output,$checkedon,$checkedoff); |
if ($newdom ne '') { |
if ($newdom ne '') { |
|
if ($num eq $default) { |
|
$checkedon = 'checked="checked" '; |
|
} else { |
|
$checkedoff = 'checked="checked" '; |
|
} |
$output .= &Apache::loncommon::start_data_table_row(). |
$output .= &Apache::loncommon::start_data_table_row(). |
'<td valign="top"><span class="LC_nobreak">'. |
'<td valign="top"><span class="LC_nobreak">'. |
&mt('Any user in domain:').' <b>'.$newdom.'</b>'. |
&mt('Any user in domain:').' <b>'.$newdom.'</b>'. |
(' 'x2).'<label><input type="radio" '. |
(' 'x2).'<label><input type="radio" '. |
'name="cloners_activate" value="'.$num.'" '. |
'name="cloners_activate" value="'.$num.'" '.$checkedon. |
'onchange="javascript:update_cloners('. |
'onchange="javascript:update_cloners('. |
"'cloners_activate','$num'".');" />'. |
"'cloners_activate','$num'".');" />'. |
&mt('Yes').'</label>'.(' 'x2). |
&mt('Yes').'</label>'.(' 'x2). |
'<label><input type="radio" '. |
'<label><input type="radio" '. |
'name="cloners_activate" value="" checked="checked" '. |
'name="cloners_activate" value="-1" '.$checkedoff. |
'onchange="javascript:update_cloners('. |
'onchange="javascript:update_cloners('. |
"'cloners_activate','$num'".');" />'. |
"'cloners_activate','$num'".');" />'. |
&mt('No').'</label><input type="hidden" name="cloners_dom_'. |
&mt('No').'</label><input type="hidden" name="cloners_dom_'. |
Line 2209 sub assign_course_categories {
|
Line 2486 sub assign_course_categories {
|
} else { |
} else { |
$alert = &mt("Use 'Save' in the main window to save course categories"); |
$alert = &mt("Use 'Save' in the main window to save course categories"); |
} |
} |
|
&js_escape(\$alert); |
$catwin_js = <<ENDSCRIPT; |
$catwin_js = <<ENDSCRIPT; |
<script type="text/javascript"> |
<script type="text/javascript"> |
|
|
Line 2285 ENDSCRIPT
|
Line 2563 ENDSCRIPT
|
|
|
sub display_loncaparev_constraints { |
sub display_loncaparev_constraints { |
my ($r,$navmap,$loncaparev,$crstype) = @_; |
my ($r,$navmap,$loncaparev,$crstype) = @_; |
|
my ($reqdmajor,$reqdminor); |
my $cid = $env{'request.course.id'}; |
my $cid = $env{'request.course.id'}; |
my $cdom = $env{'course.'.$cid.'.domain'}; |
my $cdom = $env{'course.'.$cid.'.domain'}; |
my $cnum = $env{'course.'.$cid.'.num'}; |
my $cnum = $env{'course.'.$cid.'.num'}; |
Line 2294 sub display_loncaparev_constraints {
|
Line 2573 sub display_loncaparev_constraints {
|
'section/group' => 'section/group', |
'section/group' => 'section/group', |
'user' => 'user', |
'user' => 'user', |
); |
); |
my (%checkparms,%checkresponsetypes,%checkcrstypes,%anonsurvey,%randomizetry); |
&Apache::lonrelrequtils::init_global_hashes(); |
&Apache::loncommon::build_release_hashes(\%checkparms,\%checkresponsetypes, |
if (defined($Apache::lonrelrequtils::checkcrstypes{$crstype})) { |
\%checkcrstypes,\%anonsurvey,\%randomizetry); |
($reqdmajor,$reqdminor) = split(/\./,$Apache::lonrelrequtils::checkcrstypes{$crstype}); |
if (defined($checkcrstypes{$crstype})) { |
|
$output .= '<h4>'.&mt('Course type: [_1] requires [_2] or newer',$crstype, |
$output .= '<h4>'.&mt('Course type: [_1] requires [_2] or newer',$crstype, |
$checkcrstypes{$crstype}).'</h4>'; |
$Apache::lonrelrequtils::checkcrstypes{$crstype}).'</h4>'; |
} |
} |
my (%fromparam,%rowspan,%bymap,%byresource,@scopeorder,%toshow,%allmaps, |
my (%fromparam,%rowspan,%bymap,%byresource,@scopeorder,%toshow,%allmaps, |
%byresponsetype,%bysubmission); |
%byresponsetype,%bysubmission,%fromblocks); |
@scopeorder = ('all','section/group','user'); |
@scopeorder = ('all','section/group','user'); |
|
my $now = time; |
my $resourcedata = &Apache::lonparmset::readdata($cnum,$cdom); |
my $resourcedata = &Apache::lonparmset::readdata($cnum,$cdom); |
if (ref($resourcedata) eq 'HASH') { |
if (ref($resourcedata) eq 'HASH') { |
foreach my $key (keys(%{$resourcedata})) { |
foreach my $key (keys(%{$resourcedata})) { |
foreach my $item (keys(%checkparms)) { |
my %found; |
|
foreach my $item (keys(%Apache::lonrelrequtils::checkparms)) { |
if ($key =~ /(\Q$item\E)$/) { |
if ($key =~ /(\Q$item\E)$/) { |
if (ref($checkparms{$item}) eq 'ARRAY') { |
if (ref($Apache::lonrelrequtils::checkparms{$item}) eq 'ARRAY') { |
my $value = $resourcedata->{$key}; |
my $value = $resourcedata->{$key}; |
if ($item eq 'examcode') { |
if ($item eq 'examcode') { |
if (&Apache::lonnet::validCODE($value)) { |
if (&Apache::lonnet::validCODE($value)) { |
$value = 'valid'; |
$value = 'valid'; |
} else { |
} else { |
$value = ''; |
$value = ''; |
} |
} |
} |
} elsif ($item eq 'printstartdate') { |
my ($middle,$scope,$which,$level,$map,$resource); |
if ($value =~ /^\d+$/) { |
if (grep(/^\Q$value\E$/,@{$checkparms{$item}})) { |
if ($value > $now) { |
my $stdtype = &Apache::lonparmset::standard_parameter_types($item); |
$value = 'future'; |
my $stdname = &Apache::lonparmset::standard_parameter_names($item); |
} |
my $valname = &get_param_description($stdtype,$value); |
} |
my $rev = $Apache::lonnet::needsrelease{'parameter:'.$item.':'.$value}; |
} elsif ($item eq 'printenddate') { |
my $start = $cid.'.'; |
if ($value =~ /^\d+$/) { |
if ($key =~ /^\Q$start\E(\[useropt\:($match_username\:$match_domain)\]\.)/) { |
if ($value < $now) { |
$middle = $1; |
$value = 'past'; |
$which = $2; |
} |
$scope = 'user'; |
} |
} elsif ($key =~ /^\Q$start\E(\[(\w+)\]\.)/) { |
} |
$middle = $1; |
if (grep(/^\Q$value\E$/,@{$Apache::lonrelrequtils::checkparms{$item}})) { |
$which = $2; |
my $stdtype = &Apache::lonparmset::standard_parameter_types($item); |
$scope = 'section/group'; |
$found{$item}{'valname'} = &get_param_description($stdtype,$value); |
} else { |
$found{$item}{'rev'} = $Apache::lonnet::needsrelease{'parameter:'.$item.':'.$value.'::'}; |
$scope = 'all'; |
} |
} |
} |
my $what="$stdname=$valname"; |
} |
if ($key =~ /^\Q$start$middle\E\w+\.\Q$item\E$/) { |
} |
$level = 'general'; |
foreach my $item (keys(%Apache::lonrelrequtils::checkparmvalsmatch)) { |
if ($scope eq 'all') { |
if (ref($Apache::lonrelrequtils::checkparmvalsmatch{$item}) eq 'ARRAY') { |
if (ref($fromparam{$rev}{$scope}) eq 'ARRAY') { |
my $value = $resourcedata->{$key}; |
unless(grep(/^\Q$what\E$/,@{$fromparam{$rev}{$scope}})) { |
foreach my $valuematch (@{$Apache::lonrelrequtils::checkparmvalsmatch{$item}}) { |
push(@{$fromparam{$rev}{$scope}},$what); |
if ($value =~ /$valuematch/) { |
} |
my $stdtype = &Apache::lonparmset::standard_parameter_types($item); |
} else { |
$found{$item}{'valname'} = &get_param_description($stdtype,$value,1); |
push(@{$fromparam{$rev}{$scope}},$what); |
$found{$item}{'rev'} = |
} |
$Apache::lonnet::needsrelease{'parameter:'.$item.'::'.$valuematch.':'}; |
} else { |
last; |
if (ref($fromparam{$rev}{$scope}{$which}) eq 'ARRAY') { |
} |
unless (grep(/^\Q$what\E$/,@{$fromparam{$rev}{$scope}{$which}})) { |
} |
push(@{$fromparam{$rev}{$scope}{$which}},$what); |
} |
} |
} |
} else { |
foreach my $item (keys(%Apache::lonrelrequtils::checkparmnamesmatch)) { |
push(@{$fromparam{$rev}{$scope}{$which}},$what); |
my $regexp; |
} |
if ($item eq 'maplevelrecurse') { |
} |
$regexp = '\.(?:sequence|page)___\(rec\)\.'; |
$rowspan{$rev} ++; |
} |
} elsif ($key =~ /^\Q$start$middle\E(.+)___\(all\).\w+\.\Q$item\E$/) { |
if ($regexp ne '') { |
$level = 'folder'; |
if ($key =~ /$regexp.*\.(\w+)$/) { |
$map = $1; |
my $name = $1; |
if ($scope eq 'all') { |
my $value = $resourcedata->{$key}; |
if (ref($bymap{$map}{$rev}{$scope}) eq 'ARRAY') { |
if ($name eq 'type') { |
unless(grep(/^\Q$what\E$/,@{$bymap{$map}{$rev}{$scope}})) { |
last unless (($value eq 'problem') || ($value eq 'practice') || ($value eq 'exam') || |
push(@{$bymap{$map}{$rev}{$scope}},$what); |
($value eq 'survey') || ($value eq 'surveycred') || ($value eq 'anonsurvey') || |
} |
($value eq 'anonsurveycred') || ($value eq 'randomizetry') || ($value eq 'library')); |
} else { |
} |
push(@{$bymap{$map}{$rev}{$scope}},$what); |
my $stdtype = &Apache::lonparmset::standard_parameter_types($name); |
} |
$found{$name}{'valname'} = &get_param_description($stdtype,$value); |
} else { |
$found{$name}{'extra'} = &mt('Recursive into sub-folders'); |
if (ref($bymap{$map}{$rev}{$scope}{$which}) eq 'ARRAY') { |
$found{$name}{'rev'} = |
unless(grep(/^\Q$what\E$/,@{$bymap{$map}{$rev}{$scope}{$which}})) { |
$Apache::lonnet::needsrelease{'parameter::::'.$item}; |
push(@{$bymap{$map}{$rev}{$scope}{$which}},$what); |
} |
} |
} |
} else { |
} |
push(@{$bymap{$map}{$rev}{$scope}{$which}},$what); |
foreach my $item (keys(%found)) { |
} |
my $stdname = &Apache::lonparmset::standard_parameter_names($item); |
} |
my $rev = $found{$item}{'rev'}; |
} elsif ($key =~ /^\Q$start$middle\E(.+)\.\w+\.\Q$item\E$/) { |
my $valname = $found{$item}{'valname'}; |
$level = 'resource'; |
my $extra = $found{$item}{'extra'}; |
$resource = $1; |
my ($middle,$scope,$which,$level,$map,$resource); |
if ($scope eq 'all') { |
my $start = $cid.'.'; |
if (ref($byresource{$resource}{$rev}{$scope}) eq 'ARRAY') { |
if ($key =~ /^\Q$start\E(\[useropt\:($match_username\:$match_domain)\]\.)/) { |
unless(grep(/^\Q$what\E$/,@{$byresource{$resource}{$rev}{$scope}})) { |
$middle = $1; |
push(@{$byresource{$resource}{$rev}{$scope}},$what); |
$which = $2; |
} |
$scope = 'user'; |
} else { |
} elsif ($key =~ /^\Q$start\E(\[(\w+)\]\.)/) { |
push(@{$byresource{$resource}{$rev}{$scope}},$what); |
$middle = $1; |
} |
$which = $2; |
} else { |
$scope = 'section/group'; |
if (ref($byresource{$resource}{$rev}{$scope}{$which}) eq 'ARRAY') { |
} else { |
unless (grep(/^\Q$what\E$/,@{$byresource{$resource}{$rev}{$scope}{$which}})) { |
$scope = 'all'; |
push(@{$byresource{$resource}{$rev}{$scope}{$which}},$what); |
} |
} |
my $what="$stdname=$valname"; |
} else { |
if ($extra) { |
push(@{$byresource{$resource}{$rev}{$scope}{$which}},$what); |
$what .= "<br/>$extra<br />"; |
} |
} |
} |
if ($key =~ /^\Q$start$middle\E\w+\.\Q$item\E$/) { |
} |
$level = 'general'; |
|
if ($scope eq 'all') { |
|
if (ref($fromparam{$rev}{$scope}) eq 'ARRAY') { |
|
unless(grep(/^\Q$what\E$/,@{$fromparam{$rev}{$scope}})) { |
|
push(@{$fromparam{$rev}{$scope}},$what); |
|
} |
|
} else { |
|
push(@{$fromparam{$rev}{$scope}},$what); |
|
} |
|
} else { |
|
if (ref($fromparam{$rev}{$scope}{$which}) eq 'ARRAY') { |
|
unless (grep(/^\Q$what\E$/,@{$fromparam{$rev}{$scope}{$which}})) { |
|
push(@{$fromparam{$rev}{$scope}{$which}},$what); |
|
} |
|
} else { |
|
push(@{$fromparam{$rev}{$scope}{$which}},$what); |
|
} |
|
} |
|
$rowspan{$rev} ++; |
|
} elsif ($key =~ /^\Q$start$middle\E(.+)___\((all|rec)\).\w+\.\Q$item\E$/) { |
|
$level = 'folder'; |
|
$map = $1; |
|
if ($scope eq 'all') { |
|
if (ref($bymap{$map}{$rev}{$scope}) eq 'ARRAY') { |
|
unless(grep(/^\Q$what\E$/,@{$bymap{$map}{$rev}{$scope}})) { |
|
push(@{$bymap{$map}{$rev}{$scope}},$what); |
|
} |
|
} else { |
|
push(@{$bymap{$map}{$rev}{$scope}},$what); |
|
} |
|
} else { |
|
if (ref($bymap{$map}{$rev}{$scope}{$which}) eq 'ARRAY') { |
|
unless(grep(/^\Q$what\E$/,@{$bymap{$map}{$rev}{$scope}{$which}})) { |
|
push(@{$bymap{$map}{$rev}{$scope}{$which}},$what); |
|
} |
|
} else { |
|
push(@{$bymap{$map}{$rev}{$scope}{$which}},$what); |
|
} |
|
} |
|
} elsif ($key =~ /^\Q$start$middle\E(.+)\.\w+\.\Q$item\E$/) { |
|
$level = 'resource'; |
|
$resource = $1; |
|
if ($scope eq 'all') { |
|
if (ref($byresource{$resource}{$rev}{$scope}) eq 'ARRAY') { |
|
unless(grep(/^\Q$what\E$/,@{$byresource{$resource}{$rev}{$scope}})) { |
|
push(@{$byresource{$resource}{$rev}{$scope}},$what); |
|
} |
|
} else { |
|
push(@{$byresource{$resource}{$rev}{$scope}},$what); |
|
} |
|
} else { |
|
if (ref($byresource{$resource}{$rev}{$scope}{$which}) eq 'ARRAY') { |
|
unless (grep(/^\Q$what\E$/,@{$byresource{$resource}{$rev}{$scope}{$which}})) { |
|
push(@{$byresource{$resource}{$rev}{$scope}{$which}},$what); |
|
} |
|
} else { |
|
push(@{$byresource{$resource}{$rev}{$scope}{$which}},$what); |
} |
} |
} |
} |
} |
} |
Line 2411 sub display_loncaparev_constraints {
|
Line 2747 sub display_loncaparev_constraints {
|
'<th>'.&mt('Extent').'</th><th>'.&mt('Setting').'</th>'. |
'<th>'.&mt('Extent').'</th><th>'.&mt('Setting').'</th>'. |
&Apache::loncommon::end_data_table_header_row(); |
&Apache::loncommon::end_data_table_header_row(); |
foreach my $rev (keys(%fromparam)) { |
foreach my $rev (keys(%fromparam)) { |
|
my ($major,$minor) = split(/\./,$rev); |
|
($reqdmajor,$reqdminor) = |
|
&Apache::lonrelrequtils::update_reqd_loncaparev($major,$minor,$reqdmajor,$reqdminor); |
$output .= &Apache::loncommon::start_data_table_row(). |
$output .= &Apache::loncommon::start_data_table_row(). |
'<td rowspan="'.$rowspan{$rev}.'">'.$rev.'</td>'; |
'<td rowspan="'.$rowspan{$rev}.'">'.$rev.'</td>'; |
my $newrow; |
my $newrow; |
Line 2441 sub display_loncaparev_constraints {
|
Line 2780 sub display_loncaparev_constraints {
|
} |
} |
} |
} |
|
|
|
my %comm_blocks = &Apache::lonnet::dump('comm_block',$cdom,$cnum); |
|
my $now = time; |
|
if (keys(%comm_blocks) > 0) { |
|
foreach my $block (keys(%comm_blocks)) { |
|
if ($block =~ /^firstaccess____(.+)$/) { |
|
my $rev = $Apache::lonnet::needsrelease{'course:commblock:timer'}; |
|
if (ref($comm_blocks{$block}) eq 'HASH') { |
|
push(@{$fromblocks{'timer'}{$rev}},&unescape($comm_blocks{$block}{'event'}). |
|
' '.&mt('set by [_1]', |
|
&Apache::loncommon::plainname(split(/:/,$comm_blocks{$block}{'setter'})))); |
|
} |
|
next; |
|
} elsif ($block =~ /^(\d+)____(\d+)$/) { |
|
my ($start,$end) = ($1,$2); |
|
next if ($end < $now); |
|
} |
|
if (ref($comm_blocks{$block}) eq 'HASH') { |
|
if (ref($comm_blocks{$block}{'blocks'}) eq 'HASH') { |
|
if (ref($comm_blocks{$block}{'blocks'}{'docs'}) eq 'HASH') { |
|
if (keys(%{$comm_blocks{$block}{'blocks'}{'docs'}}) > 0) { |
|
my $rev = $Apache::lonnet::needsrelease{'course:commblock:docs'}; |
|
push(@{$fromblocks{'docs'}{$rev}},&unescape($comm_blocks{$block}{'event'}). |
|
' '. |
|
&mt('set by [_1]', |
|
&Apache::loncommon::plainname(split(/:/,$comm_blocks{$block}{'setter'})))); |
|
} |
|
} elsif ($comm_blocks{$block}{'blocks'}{'printout'} eq 'on') { |
|
my $rev = $Apache::lonnet::needsrelease{'course:commblock:printout'}; |
|
push(@{$fromblocks{'printout'}{$rev}},&unescape($comm_blocks{$block}{'event'}). |
|
' '. |
|
&mt('set by [_1]', |
|
&Apache::loncommon::plainname(split(/:/,$comm_blocks{$block}{'setter'})))); |
|
|
|
} |
|
} |
|
} |
|
} |
|
if (keys(%fromblocks)) { |
|
my %lt = ( |
|
docs => 'Content blocking', |
|
printout => 'Printout generation', |
|
timer => 'Timed quiz trigger', |
|
); |
|
$output .= '<h4>'.&mt('Requirements from exam blocking').'</h4>'. |
|
&Apache::loncommon::start_data_table(). |
|
&Apache::loncommon::start_data_table_header_row(). |
|
'<th>'.&mt('Release').'</th><th>'.&mt('Setting').'</th>'. |
|
'<th>'.&mt('Event(s)').'</th>'. |
|
&Apache::loncommon::end_data_table_header_row(); |
|
foreach my $type ('docs','printout','timer') { |
|
if (ref($fromblocks{$type}) eq 'HASH') { |
|
foreach my $rev (keys(%{$fromblocks{$type}})) { |
|
my ($major,$minor) = split(/\./,$rev); |
|
($reqdmajor,$reqdminor) = |
|
&Apache::lonrelrequtils::update_reqd_loncaparev($major,$minor,$reqdmajor,$reqdminor); |
|
$output .= &Apache::loncommon::start_data_table_row(). |
|
'<td>'.$rev.'</td><td>'.$lt{$type}.'</td><td>'; |
|
foreach my $event (sort(@{$fromblocks{$type}{$rev}})) { |
|
$output .= $event.'<br />'; |
|
} |
|
$output =~ s{\Q<br />\E$}{}; |
|
$output .= '</td>'.&Apache::loncommon::end_data_table_row(); |
|
} |
|
} |
|
} |
|
$output .= &Apache::loncommon::end_data_table().'<br />'; |
|
} |
|
} |
|
|
if (defined($navmap)) { |
if (defined($navmap)) { |
my %anonsubms=&Apache::lonnet::dump('nohist_anonsurveys',$cdom,$cnum); |
my %anonsubms=&Apache::lonnet::dump('nohist_anonsurveys',$cdom,$cnum); |
my $rev_anonsurv=$Apache::lonnet::needsrelease{'parameter:type:anonsurvey'}; |
my $rev_anonsurv=$Apache::lonnet::needsrelease{'parameter:type:anonsurvey::'}; |
my %randtrysubms=&Apache::lonnet::dump('nohist_randomizetry',$cdom,$cnum); |
my %randtrysubms=&Apache::lonnet::dump('nohist_randomizetry',$cdom,$cnum); |
my $rev_randtry=$Apache::lonnet::needsrelease{'parameter:type:randomizetry'}; |
my $rev_randtry=$Apache::lonnet::needsrelease{'parameter:type:randomizetry::'}; |
my $stdtype=&Apache::lonparmset::standard_parameter_types('type'); |
my $stdtype=&Apache::lonparmset::standard_parameter_types('type'); |
my $stdname=&Apache::lonparmset::standard_parameter_names('type'); |
my $stdname=&Apache::lonparmset::standard_parameter_names('type'); |
my $valanon=&get_param_description($stdtype,'anonsurvey'); |
my $valanon=&get_param_description($stdtype,'anonsurvey'); |
my $valrandtry=&get_param_description($stdtype,'randomizetry'); |
my $valrandtry=&get_param_description($stdtype,'randomizetry'); |
|
my %checkedrev; |
foreach my $res ($navmap->retrieveResources(undef,sub { $_[0]->is_problem() },1,0)) { |
foreach my $res ($navmap->retrieveResources(undef,sub { $_[0]->is_problem() },1,0)) { |
my @parts = @{$res->parts()}; |
my @parts = @{$res->parts()}; |
my $symb = $res->symb(); |
my $symb = $res->symb(); |
Line 2467 sub display_loncaparev_constraints {
|
Line 2875 sub display_loncaparev_constraints {
|
push(@{$bysubmission{$symb}{$rev}},$what); |
push(@{$bysubmission{$symb}{$rev}},$what); |
} |
} |
$allmaps{$enclosing_map} = 1; |
$allmaps{$enclosing_map} = 1; |
|
unless ($checkedrev{'anonsurvey'}) { |
|
my ($major,$minor) = split(/\./,$rev); |
|
($reqdmajor,$reqdminor) = |
|
&Apache::lonrelrequtils::update_reqd_loncaparev($major,$minor, |
|
$reqdmajor,$reqdminor); |
|
$checkedrev{'anonsurvey'} = 1; |
|
} |
} |
} |
if (exists($randtrysubms{$symb."\0".$part})) { |
if (exists($randtrysubms{$symb."\0".$part})) { |
my $rev = $rev_randtry; |
my $rev = $rev_randtry; |
Line 2479 sub display_loncaparev_constraints {
|
Line 2894 sub display_loncaparev_constraints {
|
push(@{$bysubmission{$symb}{$rev}},$what); |
push(@{$bysubmission{$symb}{$rev}},$what); |
} |
} |
$allmaps{$enclosing_map} = 1; |
$allmaps{$enclosing_map} = 1; |
|
unless ($checkedrev{'randomizetry'}) { |
|
my ($major,$minor) = split(/\./,$rev); |
|
($reqdmajor,$reqdminor) = |
|
&Apache::lonrelrequtils::update_reqd_loncaparev($major,$minor, |
|
$reqdmajor,$reqdminor); |
|
$checkedrev{'randomizetry'} = 1; |
|
} |
} |
} |
} |
} |
my %responses = $res->responseTypes(); |
my %responses = $res->responseTypes(); |
foreach my $key (keys(%responses)) { |
foreach my $key (keys(%responses)) { |
if (exists($checkresponsetypes{$key})) { |
if (exists($Apache::lonrelrequtils::checkresponsetypes{$key})) { |
push(@{$byresponsetype{$symb}{$checkresponsetypes{$key}}},$key); |
my $rev = $Apache::lonrelrequtils::checkresponsetypes{$key}; |
|
unless ($checkedrev{$key}) { |
|
my ($major,$minor) = split(/\./,$rev); |
|
($reqdmajor,$reqdminor) = |
|
&Apache::lonrelrequtils::update_reqd_loncaparev($major,$minor, |
|
$reqdmajor,$reqdminor); |
|
$checkedrev{$key} = 1; |
|
} |
|
push(@{$byresponsetype{$symb}{$rev}},$key); |
$allmaps{$enclosing_map} = 1; |
$allmaps{$enclosing_map} = 1; |
} |
} |
} |
} |
Line 2502 sub display_loncaparev_constraints {
|
Line 2932 sub display_loncaparev_constraints {
|
} |
} |
foreach my $map (keys(%allmaps)) { |
foreach my $map (keys(%allmaps)) { |
my $mapres = $navmap->getResourceByUrl($map); |
my $mapres = $navmap->getResourceByUrl($map); |
my $mapsymb = $mapres->symb(); |
|
$toshow{$mapsymb} = 1; |
|
if (ref($mapres)) { |
if (ref($mapres)) { |
|
my $mapsymb = $mapres->symb(); |
|
$toshow{$mapsymb} = 1; |
my $pcslist = $mapres->map_hierarchy(); |
my $pcslist = $mapres->map_hierarchy(); |
if ($pcslist ne '') { |
if ($pcslist ne '') { |
foreach my $pc (split(/,/,$pcslist)) { |
foreach my $pc (split(/,/,$pcslist)) { |
Line 2545 sub display_loncaparev_constraints {
|
Line 2975 sub display_loncaparev_constraints {
|
'</p>'); |
'</p>'); |
} |
} |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
|
my ($currmajor,$currminor) = split(/\./,$loncaparev); |
|
if (($currmajor != $reqdmajor) || ($currminor != $reqdminor)) { |
|
return 1; |
|
} |
return; |
return; |
} |
} |
|
|
Line 2686 sub show_contents_view {
|
Line 3120 sub show_contents_view {
|
} |
} |
$r->print(&Apache::loncommon::end_data_table()); |
$r->print(&Apache::loncommon::end_data_table()); |
} |
} |
|
return; |
} |
} |
|
|
sub releases_by_map { |
sub releases_by_map { |
my ($r,$bymap,$url,$scopeorder,$lt) = @_; |
my ($r,$bymap,$url,$scopeorder,$lt) = @_; |
return unless ((ref($bymap) eq 'HASH') && (ref($scopeorder) eq 'ARRAY')); |
return unless ((ref($bymap) eq 'HASH') && (ref($scopeorder) eq 'ARRAY')); |
|
my $newrow = 0; |
if (ref($bymap->{$url}) eq 'HASH') { |
if (ref($bymap->{$url}) eq 'HASH') { |
foreach my $rev (sort(keys(%{$bymap->{$url}}))) { |
foreach my $rev (sort(keys(%{$bymap->{$url}}))) { |
|
if ($newrow) { |
|
$r->print(&Apache::loncommon::end_data_table_row(). |
|
&Apache::loncommon::continue_data_table_row()); |
|
} |
$r->print('<td valign="middle">'.$rev.'</td><td>'); |
$r->print('<td valign="middle">'.$rev.'</td><td>'); |
if (ref($bymap->{$url}{$rev}) eq 'HASH') { |
if (ref($bymap->{$url}{$rev}) eq 'HASH') { |
$r->print('<table border="0">'); |
$r->print('<table border="0">'); |
Line 2714 sub releases_by_map {
|
Line 3154 sub releases_by_map {
|
$r->print('</table>'); |
$r->print('</table>'); |
} |
} |
$r->print('</td>'); |
$r->print('</td>'); |
|
$newrow = 1; |
} |
} |
} else { |
} else { |
$r->print('<td colspan="2"> </td>'); |
$r->print('<td colspan="2"> </td>'); |
Line 2722 sub releases_by_map {
|
Line 3163 sub releases_by_map {
|
} |
} |
|
|
sub get_param_description { |
sub get_param_description { |
my ($stdtype,$value) = @_; |
my ($stdtype,$value,$regexp) = @_; |
my $name = $value; |
my ($name,$parammatches,$paramstrings,@possibles); |
my $paramstrings = &Apache::lonparmset::standard_string_options($stdtype); |
if ($stdtype =~ /^string/) { |
unless (ref($paramstrings) eq 'ARRAY') { |
$paramstrings = &Apache::lonparmset::standard_string_options($stdtype); |
return $name; |
} elsif ($stdtype eq 'date_interval') { |
|
$paramstrings = &Apache::lonparmset::standard_interval_options($stdtype); |
|
} |
|
if ($regexp) { |
|
if ($stdtype =~ /^string/) { |
|
$parammatches = &Apache::lonparmset::standard_string_matches($stdtype); |
|
} elsif ($stdtype eq 'date_interval') { |
|
$parammatches = &Apache::lonparmset::standard_interval_matches($stdtype); |
|
} |
|
if (ref($parammatches) eq 'ARRAY') { |
|
@possibles = @{$parammatches}; |
|
} else { |
|
undef($regexp); |
|
$name = $value; |
|
} |
|
} |
|
unless ($regexp) { |
|
$name = $value; |
|
if (ref($paramstrings) eq 'ARRAY') { |
|
@possibles = @{$paramstrings}; |
|
} else { |
|
if (($stdtype eq 'date_start') || ($stdtype eq 'date_end')) { |
|
if ($name == 0) { |
|
$name = &mt('Never'); |
|
} elsif (($name ne '') && ($name !~ /\D/)) { |
|
$name = &Apache::lonlocal::locallocaltime($name); |
|
} |
|
} |
|
return $name; |
|
} |
} |
} |
foreach my $possibilities (@{$paramstrings}) { |
foreach my $possibilities (@possibles) { |
next unless (ref($possibilities) eq 'ARRAY'); |
next unless (ref($possibilities) eq 'ARRAY'); |
my ($thing, $description) = @{ $possibilities }; |
my $gotregexmatch = ''; |
if ($thing eq $value) { |
if ($regexp) { |
$name = $description; |
last if ($gotregexmatch); |
last; |
my ($item,$pattern) = @{ $possibilities }; |
|
if ($value =~ /$pattern/) { |
|
if (ref($paramstrings) eq 'ARRAY') { |
|
foreach my $possibles (@{$paramstrings}) { |
|
next unless (ref($possibles) eq 'ARRAY'); |
|
my ($thing,$description) = @{$possibles}; |
|
if ($thing eq $item) { |
|
$name = $description; |
|
$gotregexmatch = 1; |
|
last; |
|
} |
|
} |
|
last if ($gotregexmatch); |
|
} |
|
} |
|
} else { |
|
my ($thing,$description) = @{ $possibilities }; |
|
if ($thing eq $value) { |
|
$name = $description; |
|
last; |
|
} |
} |
} |
} |
} |
return $name; |
return $name; |
} |
} |
|
|
|
sub update_releasereq { |
|
my $readmap = 1; |
|
my $getrelreq = 1; |
|
if (ref($modified_courses) eq 'ARRAY') { |
|
foreach my $item (@{$modified_courses}) { |
|
if (ref($item) eq 'ARRAY') { |
|
my ($cdom,$cnum,$chome,$crstype) = @{$item}; |
|
&Apache::lonrelrequtils::modify_course_relreq(undef,undef,$cnum,$cdom, |
|
$chome,$crstype,$cdom.'_'.$cnum, |
|
$readmap,$getrelreq); |
|
} |
|
} |
|
$modified_courses = []; |
|
} |
|
undef($registered_cleanup); |
|
return; |
|
} |
|
|
sub show_autocoowners { |
sub show_autocoowners { |
my (@currcoown) = @_; |
my (@currcoown) = @_; |
my $output = '<i><span class="LC_nobreak">'.&mt('Co-ownership is set automatically when a Course Coordinator role[_1] is assigned to official course personnel (from institutional data).','</span><br /><span class="LC_nobreak">').'</span></i>'; |
my $output = '<i><span class="LC_nobreak">'.&mt('Co-ownership is set automatically when a Course Coordinator role[_1] is assigned to official course personnel (from institutional data).','</span><br /><span class="LC_nobreak">').'</span></i>'; |
Line 2752 sub show_autocoowners {
|
Line 3260 sub show_autocoowners {
|
} |
} |
|
|
sub coowner_invitations { |
sub coowner_invitations { |
my ($cnum,$cdom,@currcoown) = @_; |
my ($cnum,$cdom,$currcoownref,$noedit) = @_; |
my ($output,@pendingcoown,@othercoords); |
my ($output,@pendingcoown,@othercoords,@currcoown); |
my $pendingcoowners = |
my $pendingcoowners = |
$env{'course.'.$env{'request.course.id'}.'.internal.pendingco-owners'}; |
$env{'course.'.$env{'request.course.id'}.'.internal.pendingco-owners'}; |
if ($pendingcoowners) { |
if ($pendingcoowners) { |
@pendingcoown = split(',',$pendingcoowners); |
@pendingcoown = split(',',$pendingcoowners); |
} |
} |
|
if (ref($currcoownref) eq 'ARRAY') { |
|
@currcoown == @{$currcoownref}; |
|
} |
|
my $disabled; |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
my $ccrole = 'cc'; |
my $ccrole = 'cc'; |
my %ccroles = &Apache::lonnet::get_my_roles($cnum,$cdom,undef,undef,[$ccrole]); |
my %ccroles = &Apache::lonnet::get_my_roles($cnum,$cdom,undef,undef,[$ccrole]); |
foreach my $key (sort(keys(%ccroles))) { |
foreach my $key (sort(keys(%ccroles))) { |
Line 2776 sub coowner_invitations {
|
Line 3291 sub coowner_invitations {
|
'<td><i>'.&mt('Current co-owners').'</i></td><td>'; |
'<td><i>'.&mt('Current co-owners').'</i></td><td>'; |
foreach my $person (@currcoown) { |
foreach my $person (@currcoown) { |
my ($co_uname,$co_dom) = split(':',$person); |
my ($co_uname,$co_dom) = split(':',$person); |
$output .= '<span class="LC_nobreak"><label><input type="checkbox" name="coowners" checked="checked" value="'.$person.'" />'.&Apache::loncommon::plainname($co_uname,$co_dom).'</label></span>'.(' 'x2).' '; |
$output .= '<span class="LC_nobreak"><label><input type="checkbox" name="coowners" checked="checked" value="'.$person.'"'.$disabled.' />'.&Apache::loncommon::plainname($co_uname,$co_dom).'</label></span>'.(' 'x2).' '; |
} |
} |
$output .= '</td>'. |
$output .= '</td>'. |
&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table_row(); |
Line 2786 sub coowner_invitations {
|
Line 3301 sub coowner_invitations {
|
'<td><i>'.&mt('Invited as co-owners [_1](agreement pending)','<br />').'</i></td><td>'; |
'<td><i>'.&mt('Invited as co-owners [_1](agreement pending)','<br />').'</i></td><td>'; |
foreach my $person (@pendingcoown) { |
foreach my $person (@pendingcoown) { |
my ($co_uname,$co_dom) = split(':',$person); |
my ($co_uname,$co_dom) = split(':',$person); |
$output .= '<span class="LC_nobreak"><label><input type="checkbox" name="pendingcoowners" checked="checked" value="'.$person.'" />'.&Apache::loncommon::plainname($co_uname,$co_dom).'</label></span>'.(' 'x2).' '; |
$output .= '<span class="LC_nobreak"><label><input type="checkbox" name="pendingcoowners" checked="checked" value="'.$person.'"'.$disabled.' />'.&Apache::loncommon::plainname($co_uname,$co_dom).'</label></span>'.(' 'x2).' '; |
} |
} |
$output .= '</td>'. |
$output .= '</td>'. |
&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table_row(); |
Line 2796 sub coowner_invitations {
|
Line 3311 sub coowner_invitations {
|
'<td><i>'.&mt('Invite other Coordinators [_1]to become co-owners','<br />').'</i></td><td>'; |
'<td><i>'.&mt('Invite other Coordinators [_1]to become co-owners','<br />').'</i></td><td>'; |
foreach my $person (@othercoords) { |
foreach my $person (@othercoords) { |
my ($co_uname,$co_dom) = split(':',$person); |
my ($co_uname,$co_dom) = split(':',$person); |
$output .= '<span class="LC_nobreak"><label><input type="checkbox" name="invitecoowners" value="'.$person.'" />'.&Apache::loncommon::plainname($co_uname,$co_dom).'</label></span>'.(' 'x2).' '; |
$output .= '<span class="LC_nobreak"><label><input type="checkbox" name="invitecoowners" value="'.$person.'"'.$disabled.' />'.&Apache::loncommon::plainname($co_uname,$co_dom).'</label></span>'.(' 'x2).' '; |
} |
} |
$output .= '</td>'. |
$output .= '</td>'. |
&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table_row(); |
Line 2809 sub coowner_invitations {
|
Line 3324 sub coowner_invitations {
|
} |
} |
|
|
sub manage_coownership { |
sub manage_coownership { |
my ($cnum,$cdom,@currcoown) = @_; |
my ($cnum,$cdom,$currcoownref,$noedit) = @_; |
my (@pendingcoown); |
my (@pendingcoown,@currcoown); |
my $pendingcoowners = |
my $pendingcoowners = |
$env{'course.'.$env{'request.course.id'}.'.internal.pendingco-owners'}; |
$env{'course.'.$env{'request.course.id'}.'.internal.pendingco-owners'}; |
if ($pendingcoowners) { |
if ($pendingcoowners) { |
@pendingcoown = split(',',$pendingcoowners); |
@pendingcoown = split(',',$pendingcoowners); |
} |
} |
|
if (ref($currcoownref) eq 'ARRAY') { |
|
@currcoown == @{$currcoownref}; |
|
} |
|
my $disabled; |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
my ($is_coowner,$is_pending,$output); |
my ($is_coowner,$is_pending,$output); |
my $uname = $env{'user.name'}; |
my $uname = $env{'user.name'}; |
my $udom = $env{'user.domain'}; |
my $udom = $env{'user.domain'}; |
Line 2847 sub manage_coownership {
|
Line 3369 sub manage_coownership {
|
if ($is_coowner) { |
if ($is_coowner) { |
$output .= &mt('You are currently a co-owner:').' <label><input type="checkbox" name="remove_coowoner" value="'.$uname.':'.$udom.'" />'.&mt('Discontinue?').'</label>'; |
$output .= &mt('You are currently a co-owner:').' <label><input type="checkbox" name="remove_coowoner" value="'.$uname.':'.$udom.'" />'.&mt('Discontinue?').'</label>'; |
} else { |
} else { |
$output .= &mt('The course owner has invited you to become a co-owner:').' <label><input type="radio" name="pending_coowoner" value="accept" />'.&mt('Accept?').'</label>'.(' 'x2). |
$output .= &mt('The course owner has invited you to become a co-owner:').' <label><input type="radio" name="pending_coowoner" value="accept"'.$disabled.' />'.&mt('Accept?').'</label>'.(' 'x2). |
'<label><input type="radio" name=pending_coowoner" value="decline" />'.&mt('Decline?').'</label>'; |
'<label><input type="radio" name=pending_coowoner" value="decline"'.$disabled.' />'.&mt('Decline?').'</label>'; |
} |
} |
$output .= '</span>'; |
$output .= '</span>'; |
if (@currcoown) { |
if (@currcoown) { |
Line 2862 sub manage_coownership {
|
Line 3384 sub manage_coownership {
|
} |
} |
|
|
sub print_localization { |
sub print_localization { |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal) = @_; |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$noedit) = @_; |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
return; |
return; |
} |
} |
Line 2881 sub print_localization {
|
Line 3403 sub print_localization {
|
input => 'selectbox', |
input => 'selectbox', |
}, |
}, |
); |
); |
my $datatable; |
my ($datatable,$disabled); |
my $count = 0; |
my $count = 0; |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
foreach my $item (@{$ordered}) { |
foreach my $item (@{$ordered}) { |
$count ++; |
$count ++; |
my $colspan; |
my $colspan; |
Line 2895 sub print_localization {
|
Line 3420 sub print_localization {
|
my $timezone = &Apache::lonlocal::gettimezone(); |
my $timezone = &Apache::lonlocal::gettimezone(); |
$datatable .= |
$datatable .= |
&Apache::loncommon::select_timezone($item,$timezone,undef, |
&Apache::loncommon::select_timezone($item,$timezone,undef, |
$includeempty); |
$includeempty,$disabled); |
} elsif ($item eq 'datelocale') { |
} elsif ($item eq 'datelocale') { |
my $includeempty = 1; |
my $includeempty = 1; |
my $locale_obj = &Apache::lonlocal::getdatelocale(); |
my $locale_obj = &Apache::lonlocal::getdatelocale(); |
Line 2905 sub print_localization {
|
Line 3430 sub print_localization {
|
} |
} |
$datatable .= |
$datatable .= |
&Apache::loncommon::select_datelocale($item,$currdatelocale, |
&Apache::loncommon::select_datelocale($item,$currdatelocale, |
undef,$includeempty); |
undef,$includeempty,$disabled); |
} else { |
} else { |
if ($settings->{$item} eq '') { |
if ($settings->{$item} eq '') { |
$datatable .= '</td><td align="right">'. |
unless ($noedit) { |
&Apache::loncommon::select_language('languages_0','',1); |
$datatable .= '</td><td align="right">'. |
|
&Apache::loncommon::select_language('languages_0','',1); |
|
} |
} else { |
} else { |
my $num = 0; |
my $num = 0; |
my @languages = split(/\s*[,;:]\s*/,$settings->{$item}); |
my @languages = split(/\s*[,;:]\s*/,$settings->{$item}); |
Line 2929 sub print_localization {
|
Line 3456 sub print_localization {
|
'</b><input type="hidden" name="languages_'.$num. |
'</b><input type="hidden" name="languages_'.$num. |
'" value="'.$lang.'" /></span><br />'. |
'" value="'.$lang.'" /></span><br />'. |
'<span class="LC_nobreak"><label><input type="checkbox" '. |
'<span class="LC_nobreak"><label><input type="checkbox" '. |
'name="languages_delete" value="'.$num.'" />'. |
'name="languages_delete" value="'.$num.'"'.$disabled.' />'. |
&mt('Delete').'</label></span></td>'. |
&mt('Delete').'</label></span></td>'. |
&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table_row(); |
$num ++; |
$num ++; |
} |
} |
} |
} |
$datatable .= &Apache::loncommon::start_data_table_row(). |
unless ($noedit) { |
|
$datatable .= |
|
&Apache::loncommon::start_data_table_row(). |
'<td align="left"><span class="LC_nobreak">'. |
'<td align="left"><span class="LC_nobreak">'. |
&mt('Additional language:'). '</span><br />'. |
&mt('Additional language:'). '</span><br />'. |
&Apache::loncommon::select_language('languages_'.$num,'',1). |
&Apache::loncommon::select_language('languages_'.$num,'',1). |
'<input type="hidden" name="languages_total" value="'.$num.'" />'. |
'<input type="hidden" name="languages_total" value="'.$num.'" />'. |
'</td>'.&Apache::loncommon::end_data_table_row(). |
'</td>'.&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table().'<br />'; |
} |
|
$datatable .= &Apache::loncommon::end_data_table().'<br />'; |
} |
} |
} |
} |
$datatable .= &item_table_row_end(); |
$datatable .= &item_table_row_end(); |
Line 2962 sub get_lang_choices {
|
Line 3492 sub get_lang_choices {
|
} |
} |
|
|
sub print_feedback { |
sub print_feedback { |
my ($position,$cdom,$settings,$ordered,$itemtext,$rowtotal) = @_; |
my ($position,$cdom,$settings,$ordered,$itemtext,$rowtotal,$noedit) = @_; |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
return; |
return; |
} |
} |
Line 2997 sub print_feedback {
|
Line 3527 sub print_feedback {
|
del => 'Delete?', |
del => 'Delete?', |
sec => 'Sections:', |
sec => 'Sections:', |
); |
); |
|
my $disabled; |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
foreach my $item (@{$ordered}) { |
foreach my $item (@{$ordered}) { |
$count ++; |
$count ++; |
if ($position eq 'top') { |
if ($position eq 'top') { |
Line 3007 sub print_feedback {
|
Line 3540 sub print_feedback {
|
} |
} |
if ($position eq 'top') { |
if ($position eq 'top') { |
my $includeempty = 0; |
my $includeempty = 0; |
$datatable .= '</td><td align="right">'. |
$datatable .= '</td><td align="right">'. |
&user_table($cdom,$item,\@sections, |
&user_table($cdom,$item,\@sections, |
$settings->{$item},\%lt); |
$settings->{$item},\%lt,$noedit); |
} else { |
} else { |
$datatable .= &Apache::lonhtmlcommon::textbox($item.'.text', |
$datatable .= &Apache::lonhtmlcommon::textbox($item.'.text', |
$settings->{$item.'.text'},$items{$item}{size}); |
$settings->{$item.'.text'},$items{$item}{size},$disabled); |
} |
} |
$datatable .= &item_table_row_end(); |
$datatable .= &item_table_row_end(); |
} |
} |
Line 3021 sub print_feedback {
|
Line 3554 sub print_feedback {
|
} |
} |
|
|
sub user_table { |
sub user_table { |
my ($cdom,$item,$sections,$currvalue,$lt) = @_; |
my ($cdom,$item,$sections,$currvalue,$lt,$noedit) = @_; |
my $output; |
my $output; |
if ($currvalue eq '') { |
if ($currvalue eq '') { |
$output .= &select_recipient($item,'0',$cdom,$sections); |
unless ($noedit) { |
|
$output .= &select_recipient($item,'0',$cdom,$sections); |
|
} |
} else { |
} else { |
my $num = 0; |
my $num = 0; |
my @curr = split(/,/,$currvalue); |
my @curr = split(/,/,$currvalue); |
$output .= '<table class="LC_data_table">'; |
$output .= '<table class="LC_data_table">'; |
my ($currusers); |
my ($currusers); |
|
my $disabled; |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
foreach my $val (@curr) { |
foreach my $val (@curr) { |
next if ($val eq ''); |
next if ($val eq ''); |
my ($uname,$udom,$seclist) = ($val =~ /^($match_username):($match_domain)(\(?[^\)]*\)?)$/); |
my ($uname,$udom,$seclist) = ($val =~ /^($match_username):($match_domain)(\(?[^\)]*\)?)$/); |
Line 3041 sub user_table {
|
Line 3580 sub user_table {
|
$currusers .= '<tr>'. |
$currusers .= '<tr>'. |
'<td valign="top"><span class="LC_nobreak">'. |
'<td valign="top"><span class="LC_nobreak">'. |
'<label><input type="checkbox" '. |
'<label><input type="checkbox" '. |
'name="'.$item.'_delete" value="'.$num.'" />'. |
'name="'.$item.'_delete" value="'.$num.'"'.$disabled.' />'. |
$lt->{'del'}.'</label>'. |
$lt->{'del'}.'</label>'. |
'<input type="hidden" name="'.$item.'_user_'. |
'<input type="hidden" name="'.$item.'_user_'. |
$num.'" value="'.$uname.':'.$udom.'" />'.(' 'x2). |
$num.'" value="'.$uname.':'.$udom.'" />'.(' 'x2). |
Line 3052 sub user_table {
|
Line 3591 sub user_table {
|
if (@{$sections}) { |
if (@{$sections}) { |
$currusers.= (' 'x3).$lt->{'sec'}.' '. |
$currusers.= (' 'x3).$lt->{'sec'}.' '. |
&select_sections($item,$num,$sections, |
&select_sections($item,$num,$sections, |
\@selsec); |
\@selsec,$noedit); |
} |
} |
} |
} |
$currusers .= '</span></td></tr>'; |
$currusers .= '</span></td></tr>'; |
Line 3070 sub user_table {
|
Line 3609 sub user_table {
|
'<table>'.$currusers.'</table></td>'. |
'<table>'.$currusers.'</table></td>'. |
'</tr>'; |
'</tr>'; |
} |
} |
$output .= '<tr>'. |
unless ($noedit) { |
|
$output .= |
|
'<tr>'. |
'<td align="left"><span class="LC_nobreak"><i>'. |
'<td align="left"><span class="LC_nobreak"><i>'. |
$lt->{'add'}.'</i></span><br />'. |
$lt->{'add'}.'</i></span><br />'. |
&select_recipient($item,$num,$cdom,$sections). |
&select_recipient($item,$num,$cdom,$sections). |
'<input type="hidden" name="'.$item.'_total" value="'.$num.'" />'. |
'<input type="hidden" name="'.$item.'_total" value="'.$num.'" />'. |
'</td></tr></table>'; |
'</td></tr>'; |
|
} |
|
$output .= '</table>'; |
} |
} |
return $output; |
return $output; |
} |
} |
Line 3102 sub select_recipient {
|
Line 3645 sub select_recipient {
|
} |
} |
|
|
sub select_sections { |
sub select_sections { |
my ($item,$num,$sections,$selected) = @_; |
my ($item,$num,$sections,$selected,$noedit) = @_; |
my ($output,@currsecs,$allsec); |
my ($output,@currsecs,$allsec,$disabled); |
if (ref($selected) eq 'ARRAY') { |
if (ref($selected) eq 'ARRAY') { |
@currsecs = @{$selected}; |
@currsecs = @{$selected}; |
} |
} |
if (!@currsecs) { |
if (!@currsecs) { |
$allsec = ' selected="selected"'; |
$allsec = ' selected="selected"'; |
} |
} |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
if (ref($sections) eq 'ARRAY') { |
if (ref($sections) eq 'ARRAY') { |
if (@{$sections}) { |
if (@{$sections}) { |
my $mult; |
my $mult; |
Line 3119 sub select_sections {
|
Line 3665 sub select_sections {
|
$mult .= ' size="4"'; |
$mult .= ' size="4"'; |
} |
} |
} |
} |
$output = '<select name="'.$item.'_sections_'.$num.'"'.$mult.'>'. |
$output = '<select name="'.$item.'_sections_'.$num.'"'.$mult.$disabled.'>'. |
' <option value=""'.$allsec.'>'.&mt('All').'</option>'; |
' <option value=""'.$allsec.'>'.&mt('All').'</option>'; |
foreach my $sec (@{$sections}) { |
foreach my $sec (@{$sections}) { |
my $is_sel; |
my $is_sel; |
Line 3135 sub select_sections {
|
Line 3681 sub select_sections {
|
} |
} |
|
|
sub print_discussion { |
sub print_discussion { |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal) = @_; |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$noedit) = @_; |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
return; |
return; |
} |
} |
Line 3165 sub print_discussion {
|
Line 3711 sub print_discussion {
|
&mt('(specific user(s))'), |
&mt('(specific user(s))'), |
input => 'checkbox', |
input => 'checkbox', |
}, |
}, |
|
|
|
'pac.roles.denied' => { |
|
text => '<span class="LC_nobreak"><b>'.&mt($itemtext->{'pac.roles.denied'}).'</b>'. |
|
&Apache::loncommon::help_open_topic("Course_Disable_Anonymous_Discussion").'</span><br />'. |
|
&mt('(role-based)'), |
|
input => 'checkbox', |
|
}, |
|
|
|
'pac.users.denied' => { |
|
text => '<span class="LC_nobreak"><b>'.&mt($itemtext->{'pac.users.denied'}).'</b><br />'. |
|
&mt('(specific user(s))'), |
|
input => 'checkbox', |
|
}, |
|
|
'allow_limited_html_in_feedback' => { |
'allow_limited_html_in_feedback' => { |
text => '<b>'.&mt($itemtext->{'allow_limited_html_in_feedback'}).'</b>', |
text => '<b>'.&mt($itemtext->{'allow_limited_html_in_feedback'}).'</b>', |
input => 'radio', |
input => 'radio', |
Line 3197 sub print_discussion {
|
Line 3757 sub print_discussion {
|
my $colspan; |
my $colspan; |
if ($item eq 'allow_limited_html_in_feedback') { |
if ($item eq 'allow_limited_html_in_feedback') { |
$colspan = 2; |
$colspan = 2; |
} |
} |
$datatable .= &item_table_row_start($items{$item}{text},$count,undef,$colspan); |
$datatable .= &item_table_row_start($items{$item}{text},$count,undef,$colspan); |
if ($item eq 'plc.roles.denied') { |
if ($item eq 'plc.roles.denied') { |
$datatable .= '</td><td align="right">'. |
$datatable .= '</td><td align="right">'. |
'<table>'.&role_checkboxes($cdom,$cnum,$item,$settings). |
'<table>'.&role_checkboxes($cdom,$cnum,$item,$settings,undef,undef,$noedit). |
'</table>'; |
'</table>'; |
} elsif ($item eq 'plc.users.denied') { |
} elsif ($item eq 'plc.users.denied') { |
$datatable .= '</td><td align="right">'. |
$datatable .= '</td><td align="right">'. |
&user_table($cdom,$item,undef, |
&user_table($cdom,$item,undef, |
$settings->{$item},\%lt); |
$settings->{$item},\%lt,$noedit); |
} elsif ($item eq 'pch.roles.denied') { |
} elsif ($item eq 'pch.roles.denied') { |
$datatable .= '</td><td align="right">'. |
$datatable .= '</td><td align="right">'. |
'<table>'.&role_checkboxes($cdom,$cnum,$item,$settings). |
'<table>'.&role_checkboxes($cdom,$cnum,$item,$settings,undef,undef,$noedit). |
'</table>'; |
'</table>'; |
} elsif ($item eq 'pch.users.denied') { |
} elsif ($item eq 'pch.users.denied') { |
$datatable .= '</td><td align="right">'. |
$datatable .= '</td><td align="right">'. |
&user_table($cdom,$item,undef, |
&user_table($cdom,$item,undef, |
$settings->{$item},\%lt); |
$settings->{$item},\%lt,$noedit); |
|
} elsif ($item eq 'pac.roles.denied') { |
|
$datatable .= '</td><td align="right">'. |
|
'<table>'.&role_checkboxes($cdom,$cnum,$item,$settings,undef,undef,$noedit). |
|
'</table>'; |
|
} elsif ($item eq 'pac.users.denied') { |
|
$datatable .= '</td><td align="right">'. |
|
&user_table($cdom,$item,undef, |
|
$settings->{$item},\%lt,$noedit); |
} elsif ($item eq 'allow_limited_html_in_feedback') { |
} 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') { |
} elsif ($item eq 'allow_discussion_post_editing') { |
$datatable .= '</td><td align="right"><br />'. |
$datatable .= '</td><td align="right"><br />'. |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table(). |
Line 3224 sub print_discussion {
|
Line 3792 sub print_discussion {
|
'<th align="left">'.&mt('Role').'</th><th>'. |
'<th align="left">'.&mt('Role').'</th><th>'. |
&mt('Sections').'</th>'. |
&mt('Sections').'</th>'. |
&Apache::loncommon::end_data_table_row(). |
&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().'<br />'; |
&Apache::loncommon::end_data_table().'<br />'; |
} elsif ($item eq 'discussion_post_fonts') { |
} elsif ($item eq 'discussion_post_fonts') { |
$datatable .= '</td><td align="right"><br />'. |
$datatable .= '</td><td align="right"><br />'. |
Line 3234 sub print_discussion {
|
Line 3802 sub print_discussion {
|
'<th align="center">'.&mt('font-size').'</th>'. |
'<th align="center">'.&mt('font-size').'</th>'. |
'<th align="center">'.&mt('font-weight').'</th>'. |
'<th align="center">'.&mt('font-weight').'</th>'. |
'<th align="center">'.&mt('font-style').'</th>'. |
'<th align="center">'.&mt('font-style').'</th>'. |
'<th align="center">'.&mt('Other css').'</th>'. |
'<th align="center">'.&mt('Other css').'</th>'. |
&Apache::loncommon::end_data_table_row(). |
&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().'<br />'; |
&Apache::loncommon::end_data_table().'<br />'; |
} |
} |
$datatable .= &item_table_row_end(); |
$datatable .= &item_table_row_end(); |
Line 3246 sub print_discussion {
|
Line 3814 sub print_discussion {
|
} |
} |
|
|
sub role_checkboxes { |
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'); |
my @roles = ('st','ad','ta','ep','in'); |
if ($crstype eq 'Community') { |
if ($crstype eq 'Community') { |
push(@roles,'co'); |
push(@roles,'co'); |
Line 3284 sub role_checkboxes {
|
Line 3852 sub role_checkboxes {
|
} |
} |
my $numinrow = 3; |
my $numinrow = 3; |
my $count = 0; |
my $count = 0; |
|
my $disabled; |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
foreach my $role (@roles) { |
foreach my $role (@roles) { |
my $checked = ''; |
my $checked = ''; |
if (grep(/^\Q$role\E$/,@current)) { |
if (grep(/^\Q$role\E$/,@current)) { |
Line 3302 sub role_checkboxes {
|
Line 3874 sub role_checkboxes {
|
} |
} |
} |
} |
$output .= '<td align="left"><span class="LC_nobreak"><label><input type="checkbox" name="'. |
$output .= '<td align="left"><span class="LC_nobreak"><label><input type="checkbox" name="'. |
$item.'" value="'.$role.'"'.$checked.'/> '. |
$item.'" value="'.$role.'"'.$checked.$disabled.'/> '. |
$plrole.'</label></span></td>'; |
$plrole.'</label></span></td>'; |
if ($showsections) { |
if ($showsections) { |
$output .= '<td align="left">'. |
$output .= '<td align="left">'. |
&select_sections($item,$role,\@sections,$currsec{$role}). |
&select_sections($item,$role,\@sections,$currsec{$role},$noedit). |
'</td></tr>'; |
'</td></tr>'; |
} |
} |
$count ++; |
$count ++; |
Line 3334 sub role_checkboxes {
|
Line 3906 sub role_checkboxes {
|
} |
} |
} |
} |
$output .= '<td><span class="LC_nobreak"><label><input type="checkbox" name="'. |
$output .= '<td><span class="LC_nobreak"><label><input type="checkbox" name="'. |
$item.'" value="'.$value.'"'.$checked.' /> '.$rolename. |
$item.'" value="'.$value.'"'.$checked.$disabled.' /> '.$rolename. |
'</label></span></td>'; |
'</label></span></td>'; |
if ($showsections) { |
if ($showsections) { |
$output .= '<td>'. |
$output .= '<td>'. |
&select_sections($item,$role,\@sections,$currsec{$role}). |
&select_sections($item,$role,\@sections,$currsec{$role},$noedit). |
'</td>'.&Apache::loncommon::end_data_table_row(); |
'</td>'.&Apache::loncommon::end_data_table_row(); |
} |
} |
$total ++; |
$total ++; |
Line 3360 sub role_checkboxes {
|
Line 3932 sub role_checkboxes {
|
} |
} |
|
|
sub set_discussion_fonts { |
sub set_discussion_fonts { |
my ($cdom,$cnum,$item,$settings) = @_; |
my ($cdom,$cnum,$item,$settings,$noedit) = @_; |
my ($classorder,$classtitles) = &discussion_vote_classes(); |
my ($classorder,$classtitles) = &discussion_vote_classes(); |
my ($styleorder,$styleitems) = &discussion_vote_styles(); |
my ($styleorder,$styleitems) = &discussion_vote_styles(); |
my $output; |
my $output; |
if (ref($classorder) eq 'ARRAY') { |
if (ref($classorder) eq 'ARRAY') { |
|
my $disabled; |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
foreach my $cat (@{$classorder}) { |
foreach my $cat (@{$classorder}) { |
my %curr = (); |
my %curr = (); |
($curr{'size'},$curr{'weight'},$curr{'style'},$curr{'other'}) = |
($curr{'size'},$curr{'weight'},$curr{'style'},$curr{'other'}) = |
Line 3381 sub set_discussion_fonts {
|
Line 3957 sub set_discussion_fonts {
|
($currsize,$currunit) = ($1,$2); |
($currsize,$currunit) = ($1,$2); |
$curr{'size'} = $currunit; |
$curr{'size'} = $currunit; |
} |
} |
$output .= '<input type="textbox" name="discussion_post_fonts_'.$cat.'_'.$item.'" value="'.$currsize.'" size="5">'. |
$output .= '<input type="textbox" name="discussion_post_fonts_'.$cat.'_'.$item.'" value="'.$currsize.'" size="5"'.$disabled.' />'. |
' '; |
' '; |
$selitem = 'unit'; |
$selitem = 'unit'; |
} |
} |
if ((ref($styleitems) eq 'HASH') && (ref($styleitems->{$item}) eq 'ARRAY')) { |
if ((ref($styleitems) eq 'HASH') && (ref($styleitems->{$item}) eq 'ARRAY')) { |
$output .= '<select name="discussion_post_fonts_'.$cat.'_'.$selitem.'">'; |
$output .= '<select name="discussion_post_fonts_'.$cat.'_'.$selitem.'"'.$disabled.'>'; |
foreach my $val (@{$styleitems->{$item}}) { |
foreach my $val (@{$styleitems->{$item}}) { |
my $sel; |
my $sel; |
if ($val eq $curr{$item}) { |
if ($val eq $curr{$item}) { |
Line 3397 sub set_discussion_fonts {
|
Line 3973 sub set_discussion_fonts {
|
} |
} |
} |
} |
} |
} |
$output .= '</span></td><td><input type="textbox" size="10" name="discussion_post_fonts_'.$cat.'_other" value="'.$curr{'other'}.'" /></td>'; |
$output .= '</span></td><td><input type="textbox" size="10" name="discussion_post_fonts_'.$cat.'_other" value="'.$curr{'other'}.'"'.$disabled.' /></td>'; |
} |
} |
$output .= &Apache::loncommon::end_data_table_row(); |
$output .= &Apache::loncommon::end_data_table_row(); |
} |
} |
Line 3406 sub set_discussion_fonts {
|
Line 3982 sub set_discussion_fonts {
|
|
|
sub discussion_vote_classes { |
sub discussion_vote_classes { |
my $classorder = ['twoplus','oneplus','zero','oneminus','twominus']; |
my $classorder = ['twoplus','oneplus','zero','oneminus','twominus']; |
my %classtitles = &Apache::lonlocal::texthash( |
my %classtitles = &Apache::lonlocal::texthash( |
'twoplus' => 'Two sigma above mean', |
'twoplus' => 'Two sigma above mean', |
'oneplus' => 'One sigma above mean', |
'oneplus' => 'One sigma above mean', |
'zero' => 'Within one sigma of mean', |
'zero' => 'Within one sigma of mean', |
Line 3429 sub discussion_vote_styles {
|
Line 4005 sub discussion_vote_styles {
|
} |
} |
|
|
sub print_classlists { |
sub print_classlists { |
my ($position,$cdom,$settings,$itemtext,$rowtotal,$crstype) = @_; |
my ($position,$cdom,$settings,$itemtext,$rowtotal,$crstype,$noedit) = @_; |
my @ordered; |
my @ordered; |
if ($position eq 'top') { |
if ($position eq 'top') { |
@ordered = ('default_enrollment_start_date', |
@ordered = ('default_enrollment_start_date', |
Line 3472 sub print_classlists {
|
Line 4048 sub print_classlists {
|
'defaultcredits' => { |
'defaultcredits' => { |
text => '<b>'.&mt($itemtext->{'defaultcredits'}).'</b>', |
text => '<b>'.&mt($itemtext->{'defaultcredits'}).'</b>', |
}, |
}, |
|
|
'nothideprivileged' => { |
'nothideprivileged' => { |
text => '<b>'.&mt($itemtext->{'nothideprivileged'}).'</b>', |
text => '<b>'.&mt($itemtext->{'nothideprivileged'}).'</b>', |
input => 'checkbox', |
input => 'checkbox', |
Line 3503 sub print_classlists {
|
Line 4079 sub print_classlists {
|
($settings->{'student_classlist_view'} eq 'section')) { |
($settings->{'student_classlist_view'} eq 'section')) { |
$settings->{'student_classlist_view'} = 'disabled'; |
$settings->{'student_classlist_view'} = 'disabled'; |
} |
} |
return &make_item_rows($cdom,\%items,\@ordered,$settings,$rowtotal,$crstype,'classlists'); |
return &make_item_rows($cdom,\%items,\@ordered,$settings,$rowtotal,$crstype,'classlists',$noedit); |
} |
} |
|
|
sub print_appearance { |
sub print_appearance { |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$crstype) = @_; |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$crstype,$noedit) = @_; |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
return; |
return; |
} |
} |
Line 3540 sub print_appearance {
|
Line 4116 sub print_appearance {
|
input => 'selectbox', |
input => 'selectbox', |
options => { |
options => { |
MathJax => 'MathJax', |
MathJax => 'MathJax', |
jsMath => 'jsMath', |
|
mimetex => &mt('Convert to Images'), |
mimetex => &mt('Convert to Images'), |
tth => &mt('TeX to HTML'), |
tth => &mt('TeX to HTML'), |
}, |
}, |
order => ['MathJax','jsMath','mimetex','tth'], |
order => ['MathJax','mimetex','tth'], |
nullval => $mathdef, |
nullval => $mathdef, |
}, |
}, |
'tthoptions' => { |
'tthoptions' => { |
Line 3552 sub print_appearance {
|
Line 4127 sub print_appearance {
|
input => 'textbox', |
input => 'textbox', |
size => 40, |
size => 40, |
}, |
}, |
|
'uselcmath' => { |
|
text => '<b>'.&mt($itemtext->{'uselcmath'}).'</b>', |
|
input => 'radio', |
|
}, |
|
'usejsme' => { |
|
text => '<b>'.&mt($itemtext->{'usejsme'}).'</b>', |
|
input => 'radio', |
|
}, |
); |
); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'appearance'); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'appearance',$noedit); |
} |
} |
|
|
sub print_grading { |
sub print_grading { |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$crstype) = @_; |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$crstype,$noedit) = @_; |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
return; |
return; |
} |
} |
Line 3568 sub print_grading {
|
Line 4151 sub print_grading {
|
input => 'selectbox', |
input => 'selectbox', |
options => { |
options => { |
standard => &mt('Standard: shows points'), |
standard => &mt('Standard: shows points'), |
|
categories => &mt('Categories: shows points according to categories'), |
external => &mt('External: shows number of completed parts and totals'), |
external => &mt('External: shows number of completed parts and totals'), |
externalnototals => &mt('External: shows only number of completed parts'), |
externalnototals => &mt('External: shows only number of completed parts'), |
spreadsheet => &mt('Spreadsheet: (with link to detailed scores)'), |
spreadsheet => &mt('Spreadsheet: (with link to detailed scores)'), |
}, |
}, |
order => ['standard','external','externalnototals','spreadsheet'], |
order => ['standard','categories','external','externalnototals','spreadsheet'], |
}, |
}, |
'rndseed' => { |
'rndseed' => { |
text => '<b>'.&mt($itemtext->{'rndseed'}).'</b>'. |
text => '<b>'.&mt($itemtext->{'rndseed'}).'</b>'. |
Line 3608 sub print_grading {
|
Line 4192 sub print_grading {
|
input => 'radio', |
input => 'radio', |
}, |
}, |
); |
); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'grading'); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'grading',$noedit); |
} |
} |
|
|
sub print_printouts { |
sub print_printouts { |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$crstype) = @_; |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$crstype,$noedit) = @_; |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
return; |
return; |
} |
} |
Line 3661 sub print_printouts {
|
Line 4245 sub print_printouts {
|
nullval => &mt('None specified - use domain default'), |
nullval => &mt('None specified - use domain default'), |
} |
} |
); |
); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'printouts'); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'printouts',$noedit); |
} |
} |
|
|
sub print_spreadsheet { |
sub print_spreadsheet { |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$crstype) = @_; |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$crstype,$noedit) = @_; |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
return; |
return; |
} |
} |
Line 3697 sub print_spreadsheet {
|
Line 4281 sub print_spreadsheet {
|
input => 'radio', |
input => 'radio', |
}, |
}, |
); |
); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'spreadsheet'); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'spreadsheet',$noedit); |
} |
} |
|
|
sub print_bridgetasks { |
sub print_bridgetasks { |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$crstype) = @_; |
my ($cdom,$settings,$ordered,$itemtext,$rowtotal,$crstype,$noedit) = @_; |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
unless ((ref($settings) eq 'HASH') && (ref($ordered) eq 'ARRAY') && (ref($itemtext) eq 'HASH')) { |
return; |
return; |
} |
} |
Line 3739 sub print_bridgetasks {
|
Line 4323 sub print_bridgetasks {
|
input => 'radio', |
input => 'radio', |
}, |
}, |
); |
); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'bridgetasks'); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype,'bridgetasks',$noedit); |
} |
} |
|
|
sub print_other { |
sub print_other { |
my ($cdom,$settings,$allitems,$rowtotal,$crstype) = @_; |
my ($cdom,$settings,$allitems,$rowtotal,$crstype,$noedit) = @_; |
unless ((ref($settings) eq 'HASH') && (ref($allitems) eq 'ARRAY')) { |
unless ((ref($settings) eq 'HASH') && (ref($allitems) eq 'ARRAY')) { |
return; |
return; |
} |
} |
Line 3764 sub print_other {
|
Line 4348 sub print_other {
|
input => 'textbox', |
input => 'textbox', |
size => '30', |
size => '30', |
}; |
}; |
my $output = &make_item_rows($cdom,\%items,\@ordered,$settings,$rowtotal,$crstype,'other'); |
my $output = &make_item_rows($cdom,\%items,\@ordered,$settings,$rowtotal,$crstype,'other',$noedit); |
} |
} |
|
|
sub get_other_items { |
sub get_other_items { |
Line 3813 sub item_table_row_end {
|
Line 4397 sub item_table_row_end {
|
} |
} |
|
|
sub yesno_radio { |
sub yesno_radio { |
my ($item,$settings) = @_; |
my ($item,$settings,$unsetdefault,$valueyes,$valueno,$noedit) = @_; |
my $itemon = ' '; |
my $itemon = ' '; |
my $itemoff = ' checked="checked" '; |
my $itemoff = ' checked="checked" '; |
|
if (($valueyes eq '') && ($valueno eq '')) { |
|
$valueyes = 'yes'; |
|
$valueno = ''; |
|
} |
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
if ($settings->{$item} eq 'yes') { |
if ($settings->{$item} eq $valueyes) { |
$itemon = $itemoff; |
$itemon = $itemoff; |
$itemoff = ' '; |
$itemoff = ' '; |
} |
} |
|
unless (exists($settings->{$item})) { |
|
if ($unsetdefault eq $valueyes) { |
|
$itemon = $itemoff; |
|
$itemoff = ' '; |
|
} |
|
} |
|
} |
|
my $disabled; |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
} |
} |
return '<span class="LC_nobreak"><label>'. |
return '<span class="LC_nobreak"><label>'. |
'<input type="radio" name="'.$item.'"'. |
'<input type="radio" name="'.$item.'"'. |
$itemon.' value="yes" />'.&mt('Yes').'</label> '. |
$itemon.' value="'.$valueyes.'"'.$disabled.' />'.&mt('Yes').'</label> '. |
'<label><input type="radio" name="'.$item.'"'. |
'<label><input type="radio" name="'.$item.'"'. |
$itemoff.' value="" />'.&mt('No').'</label></span>'; |
$itemoff.' value="'.$valueno.'"'.$disabled.' />'.&mt('No').'</label></span>'; |
} |
} |
|
|
sub select_from_options { |
sub select_from_options { |
my ($item,$order,$options,$curr,$nullval,$multiple,$maxsize,$onchange) = @_; |
my ($item,$order,$options,$curr,$nullval,$multiple,$maxsize,$onchange,$noedit) = @_; |
my $output; |
my $output; |
|
my $disabled; |
|
if ($noedit) { |
|
$disabled = ' disabled=disabled"'; |
|
} |
if ((ref($order) eq 'ARRAY') && (ref($options) eq 'HASH')) { |
if ((ref($order) eq 'ARRAY') && (ref($options) eq 'HASH')) { |
$output='<select name="'.$item.'" '.$onchange; |
$output='<select name="'.$item.'" '.$onchange; |
if ($multiple) { |
if ($multiple) { |
Line 3842 sub select_from_options {
|
Line 4444 sub select_from_options {
|
$output .= ' size="'.$maxsize.'"'; |
$output .= ' size="'.$maxsize.'"'; |
} |
} |
} |
} |
$output .= '>'."\n"; |
$output .= $disabled.'>'."\n"; |
if ($nullval ne '') { |
if ($nullval ne '') { |
$output .= '<option value=""'; |
$output .= '<option value=""'; |
if (ref($curr) eq 'ARRAY') { |
if (ref($curr) eq 'ARRAY') { |
Line 3875 sub select_from_options {
|
Line 4477 sub select_from_options {
|
} |
} |
|
|
sub make_item_rows { |
sub make_item_rows { |
my ($cdom,$items,$ordered,$settings,$rowtotal,$crstype,$caller) = @_; |
my ($cdom,$items,$ordered,$settings,$rowtotal,$crstype,$caller,$noedit) = @_; |
my $datatable; |
my $datatable; |
if ((ref($items) eq 'HASH') && (ref($ordered) eq 'ARRAY')) { |
if ((ref($items) eq 'HASH') && (ref($ordered) eq 'ARRAY')) { |
my $count = 0; |
my $count = 0; |
Line 3901 sub make_item_rows {
|
Line 4503 sub make_item_rows {
|
} |
} |
$datatable .= $showcredits; |
$datatable .= $showcredits; |
} elsif ($item eq 'nothideprivileged') { |
} elsif ($item eq 'nothideprivileged') { |
$datatable .= ¬hidepriv_row($cdom,$item,$settings,$crstype); |
$datatable .= ¬hidepriv_row($cdom,$item,$settings,$crstype,$noedit); |
} elsif ($item eq 'checkforpriv') { |
} elsif ($item eq 'checkforpriv') { |
$datatable .= &checkforpriv_row($cdom,$item,$settings,$crstype); |
$datatable .= &checkforpriv_row($cdom,$item,$settings,$crstype,$noedit); |
} elsif ($item eq 'print_header_format') { |
} elsif ($item eq 'print_header_format') { |
$datatable .= &print_hdrfmt_row($item,$settings); |
$datatable .= &print_hdrfmt_row($item,$settings,$noedit); |
} elsif ($items->{$item}{input} eq 'dates') { |
} elsif ($items->{$item}{input} eq 'dates') { |
|
my $disabled; |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
$datatable .= |
$datatable .= |
&Apache::lonhtmlcommon::date_setter('display',$item, |
&Apache::lonhtmlcommon::date_setter('display',$item, |
$settings->{$item}); |
$settings->{$item},$disabled); |
} elsif ($items->{$item}{input} eq 'radio') { |
} elsif ($items->{$item}{input} eq 'radio') { |
$datatable .= &yesno_radio($item,$settings); |
my ($unsetdefault,$valueyes,$valueno); |
|
if (($item eq 'usejsme') || ($item eq 'uselcmath')) { |
|
my %domdefs = &Apache::lonnet::get_domain_defaults($cdom); |
|
unless ($domdefs{$item} eq '0') { |
|
$unsetdefault = 1; |
|
} |
|
$valueyes = "1"; |
|
$valueno = "0"; |
|
} |
|
$datatable .= &yesno_radio($item,$settings,$unsetdefault,$valueyes,$valueno,$noedit); |
} elsif ($items->{$item}{input} eq 'selectbox') { |
} elsif ($items->{$item}{input} eq 'selectbox') { |
my $curr = $settings->{$item}; |
my $curr = $settings->{$item}; |
$datatable .= |
$datatable .= |
&select_from_options($item,$items->{$item}{'order'}, |
&select_from_options($item,$items->{$item}{'order'}, |
$items->{$item}{'options'},$curr, |
$items->{$item}{'options'},$curr, |
$items->{$item}{'nullval'}); |
$items->{$item}{'nullval'}, |
|
undef,undef,undef,$noedit); |
} elsif ($items->{$item}{input} eq 'textbox') { |
} elsif ($items->{$item}{input} eq 'textbox') { |
|
my $disabled; |
|
if ($noedit) { |
|
$disabled = ' disabled=disabled"'; |
|
} |
$datatable .= |
$datatable .= |
&Apache::lonhtmlcommon::textbox($item,$settings->{$item}, |
&Apache::lonhtmlcommon::textbox($item,$settings->{$item}, |
$items->{$item}{size}); |
$items->{$item}{size}, |
|
$disabled); |
} |
} |
$datatable .= &item_table_row_end(); |
$datatable .= &item_table_row_end(); |
} |
} |
Line 3933 sub make_item_rows {
|
Line 4554 sub make_item_rows {
|
} |
} |
|
|
sub nothidepriv_row { |
sub nothidepriv_row { |
my ($cdom,$item,$settings,$crstype) = @_; |
my ($cdom,$item,$settings,$crstype,$noedit) = @_; |
my ($cnum) = &get_course(); |
my ($cnum) = &get_course(); |
my ($datatable,%nothide,@checkdoms); |
my ($datatable,%nothide,@checkdoms); |
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
Line 3947 sub nothidepriv_row {
|
Line 4568 sub nothidepriv_row {
|
} |
} |
} |
} |
if ($settings->{'checkforpriv'}) { |
if ($settings->{'checkforpriv'}) { |
@checkdoms = split(/,/,$settings->{'checkforpriv'}); |
@checkdoms = split(/,/,$settings->{'checkforpriv'}); |
} |
} |
} |
} |
push(@checkdoms,$cdom); |
push(@checkdoms,$cdom); |
Line 3961 sub nothidepriv_row {
|
Line 4582 sub nothidepriv_row {
|
if ($end == -1 || $start == -1) { |
if ($end == -1 || $start == -1) { |
next; |
next; |
} |
} |
foreach my $dom (@checkdoms) { |
foreach my $dom (@checkdoms) { |
if (&Apache::lonnet::privileged($uname,$udom,\@checkdoms,['dc','su'])) { |
if (&Apache::lonnet::privileged($uname,$udom,\@checkdoms,['dc','su'])) { |
unless (grep(/^\Q$user\E$/,@privusers)) { |
unless (grep(/^\Q$user\E$/,@privusers)) { |
push(@privusers,$user); |
push(@privusers,$user); |
Line 3970 sub nothidepriv_row {
|
Line 4591 sub nothidepriv_row {
|
} |
} |
} |
} |
if (@privusers > 0) { |
if (@privusers > 0) { |
|
my $disabled; |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
$datatable .= '<table align="right">'; |
$datatable .= '<table align="right">'; |
foreach my $user (sort(@privusers)) { |
foreach my $user (sort(@privusers)) { |
my $hideon = ' checked="checked" '; |
my $hideon = ' checked="checked" '; |
Line 3986 sub nothidepriv_row {
|
Line 4611 sub nothidepriv_row {
|
'</td><td align="left">'. |
'</td><td align="left">'. |
'<span class="LC_nobreak"><label>'. |
'<span class="LC_nobreak"><label>'. |
'<input type="radio" name="'.$item.'_'.$user.'"'. |
'<input type="radio" name="'.$item.'_'.$user.'"'. |
$hideon.' value="" />'.&mt('Hidden').'</label> '. |
$hideon.' value=""'.$disabled.' />'.&mt('Hidden').'</label> '. |
'<label><input type="radio" name="'.$item.'_'.$user.'"'. $hideoff.' value="yes" />'.&mt('Shown').'</label></span></td>'. |
'<label><input type="radio" name="'.$item.'_'.$user.'"'. |
|
$hideoff.' value="yes"'.$disabled.' />'.&mt('Shown').'</label></span></td>'. |
'</tr>'; |
'</tr>'; |
} |
} |
$datatable .= '</table>'; |
$datatable .= '</table>'; |
Line 4002 sub nothidepriv_row {
|
Line 4628 sub nothidepriv_row {
|
} |
} |
|
|
sub checkforpriv_row { |
sub checkforpriv_row { |
my ($cdom,$item,$settings,$crstype) = @_; |
my ($cdom,$item,$settings,$crstype,$noedit) = @_; |
my $datatable; |
my $datatable; |
my %domains=map { $_ => 1; } &Apache::lonnet::all_domains(); |
my %domains=map { $_ => 1; } &Apache::lonnet::all_domains(); |
if (keys(%domains) == 1) { |
if (keys(%domains) == 1) { |
Line 4015 sub checkforpriv_row {
|
Line 4641 sub checkforpriv_row {
|
if ($settings->{$item} eq '') { |
if ($settings->{$item} eq '') { |
$datatable = '</td><td align="right">'. |
$datatable = '</td><td align="right">'. |
&Apache::loncommon::select_dom_form('','checkforpriv_'.$num, |
&Apache::loncommon::select_dom_form('','checkforpriv_'.$num, |
1,1,undef,undef,\@excdoms); |
1,1,undef,undef,\@excdoms, |
|
$noedit); |
} else { |
} else { |
my @privdoms = split(/,/,$settings->{$item}); |
my @privdoms = split(/,/,$settings->{$item}); |
my %domains=map { $_ => 1; } &Apache::lonnet::all_domains(); |
my %domains=map { $_ => 1; } &Apache::lonnet::all_domains(); |
$datatable = '</td><td align="right"><br />'. |
$datatable = '</td><td align="right"><br />'. |
&Apache::loncommon::start_data_table(); |
&Apache::loncommon::start_data_table(); |
|
my $disabled; |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
if (@privdoms > 0) { |
if (@privdoms > 0) { |
foreach my $currdom (@privdoms) { |
foreach my $currdom (@privdoms) { |
next unless ($domains{$currdom}); |
next unless ($domains{$currdom}); |
my $domdesc = &Apache::lonnet::domain($currdom,'description'); |
my $domdesc = &Apache::lonnet::domain($currdom,'description'); |
if ($domdesc eq '') { |
if ($domdesc eq '') { |
$domdesc = $currdom; |
$domdesc = $currdom; |
} |
} |
$datatable .= |
$datatable .= |
&Apache::loncommon::start_data_table_row(). |
&Apache::loncommon::start_data_table_row(). |
'<td align="left"><span class="LC_nobreak">'. |
'<td align="left"><span class="LC_nobreak">'. |
Line 4035 sub checkforpriv_row {
|
Line 4666 sub checkforpriv_row {
|
'</b><input type="hidden" name="checkforpriv_'.$num. |
'</b><input type="hidden" name="checkforpriv_'.$num. |
'" value="'.$currdom.'" /></span><br />'. |
'" value="'.$currdom.'" /></span><br />'. |
'<span class="LC_nobreak"><label><input type="checkbox" '. |
'<span class="LC_nobreak"><label><input type="checkbox" '. |
'name="checkforpriv_delete" value="'.$num.'" />'. |
'name="checkforpriv_delete" value="'.$num.'"'.$disabled.' />'. |
&mt('Delete').'</label></span></td>'. |
&mt('Delete').'</label></span></td>'. |
&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table_row(); |
$num ++; |
$num ++; |
unless (grep(/^\Q$currdom\E$/,@excdoms)) { |
unless (grep(/^\Q$currdom\E$/,@excdoms)) { |
push(@excdoms,$currdom); |
push(@excdoms,$currdom); |
} |
} |
} |
} |
} |
} |
if ((scalar(keys(%domains)) - scalar(@excdoms)) > 0) { |
if ((scalar(keys(%domains)) - scalar(@excdoms)) > 0) { |
$datatable .= |
$datatable .= |
&Apache::loncommon::start_data_table_row(). |
&Apache::loncommon::start_data_table_row(). |
'<td align="left"><span class="LC_nobreak">'. |
'<td align="left"><span class="LC_nobreak">'. |
&mt('Additional domain:'). '</span><br />'. |
&mt('Additional domain:'). '</span><br />'. |
&Apache::loncommon::select_dom_form('','checkforpriv_'.$num,1, |
&Apache::loncommon::select_dom_form('','checkforpriv_'.$num,1, |
1,undef,undef,\@excdoms). |
1,undef,undef,\@excdoms,$noedit). |
'</td>'.&Apache::loncommon::end_data_table_row(); |
'</td>'.&Apache::loncommon::end_data_table_row(); |
} |
} |
$datatable .= &Apache::loncommon::end_data_table(). |
$datatable .= &Apache::loncommon::end_data_table(). |
Line 4061 sub checkforpriv_row {
|
Line 4692 sub checkforpriv_row {
|
} |
} |
|
|
sub print_hdrfmt_row { |
sub print_hdrfmt_row { |
my ($item,$settings) = @_; |
my ($item,$settings,$noedit) = @_; |
my @curr; |
my @curr; |
my $currnum = 0; |
my $currnum = 0; |
my $maxnum = 2; |
my $maxnum = 2; |
Line 4134 function getIndexByName(item) {
|
Line 4765 function getIndexByName(item) {
|
ENDJS |
ENDJS |
$output .= '</td><td align="right"><br />'. |
$output .= '</td><td align="right"><br />'. |
$currstr.'<table class="LC_data_table">'; |
$currstr.'<table class="LC_data_table">'; |
|
my $disabled; |
|
if ($noedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
if (@curr > 0) { |
if (@curr > 0) { |
for (my $i=0; $i<@curr; $i++) { |
for (my $i=0; $i<@curr; $i++) { |
my $pos = $i+1; |
my $pos = $i+1; |
$output .= '<tr>'. |
$output .= '<tr>'. |
'<td align="left"><span class="LC_nobreak">'. |
'<td align="left"><span class="LC_nobreak">'. |
&position_selector($pos,$i,$maxnum).&mt('Delete:'). |
&position_selector($pos,$i,$maxnum,$disabled).&mt('Delete:'). |
'<input type="checkbox" name="printfmthdr_del_'.$i. |
'<input type="checkbox" name="printfmthdr_del_'.$i. |
'" /></span></td>'; |
'"'.$disabled.' /></span></td>'; |
if ($curr[$i] =~ /^%\d*[nca]$/) { |
if ($curr[$i] =~ /^%\d*[nca]$/) { |
my ($limit,$subst) = ($curr[$i] =~ /^%(\d*)([nca])$/); |
my ($limit,$subst) = ($curr[$i] =~ /^%(\d*)([nca])$/); |
$output .= '<td align="left">'. |
$output .= '<td align="left">'. |
&substitution_selector($i,$subst,$limit).'</td>'; |
&substitution_selector($i,$subst,$limit,$disabled).'</td>'; |
} else { |
} else { |
$output .= '<td colspan="2" align="left">'.&mt('Text').'<br />'. |
$output .= '<td colspan="2" align="left">'.&mt('Text').'<br />'. |
'<input type="textbox" name="printfmthdr_text_'.$i.'"'. |
'<input type="textbox" name="printfmthdr_text_'.$i.'"'. |
' value="'.$curr[$i].'" size="25" /></td>'; |
' value="'.$curr[$i].'" size="25"'.$disabled.' /></td>'; |
} |
} |
$output .= '</tr>'; |
$output .= '</tr>'; |
} |
} |
} |
} |
my $pos = $currnum+1; |
my $pos = $currnum+1; |
$output .= '<tr>'. |
unless ($noedit) { |
|
$output .= |
|
'<tr>'. |
'<td align="left"><span class="LC_nobreak">'. |
'<td align="left"><span class="LC_nobreak">'. |
&position_selector($pos,$currnum,$maxnum). |
&position_selector($pos,$currnum,$maxnum). |
'<b>'.&mt('New').'</b></span></td><td align="left">'. |
'<b>'.&mt('New').'</b></span></td><td align="left">'. |
&substitution_selector($currnum).'</td>'. |
&substitution_selector($currnum).'</td>'. |
'</tr>'; |
'</tr>'; |
$pos ++; |
$pos ++; |
$currnum ++; |
$currnum ++; |
$output .= '<tr>'. |
$output .= |
|
'<tr>'. |
'<td align="left"><span class="LC_nobreak">'. |
'<td align="left"><span class="LC_nobreak">'. |
&position_selector($pos,$currnum,$maxnum). |
&position_selector($pos,$currnum,$maxnum). |
'<b>'.&mt('New').'</b></span></td>'. |
'<b>'.&mt('New').'</b></span></td>'. |
Line 4172 ENDJS
|
Line 4810 ENDJS
|
'" value="" size ="25" />'. |
'" value="" size ="25" />'. |
'<input type="hidden" name="printfmthdr_maxnum" value="'. |
'<input type="hidden" name="printfmthdr_maxnum" value="'. |
$maxnum.'" /></td>'. |
$maxnum.'" /></td>'. |
'</tr>'. |
'</tr>'; |
'</table><br />'; |
} |
|
$output .= '</table><br />'; |
return $output; |
return $output; |
} |
} |
|
|
sub position_selector { |
sub position_selector { |
my ($pos,$num,$maxnum) = @_; |
my ($pos,$num,$maxnum,$disabled) = @_; |
my $output = '<select name="printfmthdr_pos_'.$num.'" onchange="reOrder('."'$num'".');">'; |
my $output = '<select name="printfmthdr_pos_'.$num.'" onchange="reOrder('."'$num'".');"'.$disabled.'>'; |
for (my $j=1; $j<=$maxnum; $j++) { |
for (my $j=1; $j<=$maxnum; $j++) { |
my $sel = ''; |
my $sel = ''; |
if ($pos == $j) { |
if ($pos == $j) { |
Line 4193 sub position_selector {
|
Line 4832 sub position_selector {
|
} |
} |
|
|
sub substitution_selector { |
sub substitution_selector { |
my ($num,$subst,$limit,$crstype) = @_; |
my ($num,$subst,$limit,$crstype,$disabled) = @_; |
my ($stunametxt,$crsidtxt); |
my ($stunametxt,$crsidtxt); |
if ($crstype eq 'Community') { |
if ($crstype eq 'Community') { |
$stunametxt = 'member name'; |
$stunametxt = 'member name'; |
Line 4208 sub substitution_selector {
|
Line 4847 sub substitution_selector {
|
a => 'assignment note', |
a => 'assignment note', |
); |
); |
my $output .= &mt('Substitution').'<br />'. |
my $output .= &mt('Substitution').'<br />'. |
'<select name="printfmthdr_sub_'.$num.'">'; |
'<select name="printfmthdr_sub_'.$num.'"'.$disabled.'>'; |
if ($subst eq '') { |
if ($subst eq '') { |
$output .= '<option value="" selected="selected"> </option>'; |
$output .= '<option value="" selected="selected"> </option>'; |
} |
} |
Line 4222 sub substitution_selector {
|
Line 4861 sub substitution_selector {
|
} |
} |
$output .= '</select></td><td align="left">'.&mt('Size limit').'<br />'. |
$output .= '</select></td><td align="left">'.&mt('Size limit').'<br />'. |
'<input type="textbox" name="printfmthdr_limit_'.$num. |
'<input type="textbox" name="printfmthdr_limit_'.$num. |
'" value="'.$limit.'" size="5" /></span>'; |
'" value="'.$limit.'" size="5"'.$disabled.' /></span>'; |
return $output; |
return $output; |
} |
} |
|
|
Line 4240 sub change_clone {
|
Line 4879 sub change_clone {
|
foreach my $currclone (@allowclone) { |
foreach my $currclone (@allowclone) { |
if (!grep(/^$currclone$/,@$oldcloner)) { |
if (!grep(/^$currclone$/,@$oldcloner)) { |
if ($currclone ne '*') { |
if ($currclone ne '*') { |
my ($uname,$udom) = split(/:/,$currclone); |
if ($currclone =~ /:/) { |
if ($uname && $udom && $uname ne '*') { |
my ($uname,$udom) = split(/:/,$currclone); |
if (&Apache::lonnet::homeserver($uname,$udom) ne 'no_host') { |
if ($uname && $udom && $uname ne '*') { |
my %currclonecrs = &Apache::lonnet::dump('environment',$udom,$uname,'cloneable'); |
if (&Apache::lonnet::homeserver($uname,$udom) ne 'no_host') { |
if ($currclonecrs{'cloneable'} !~ /\Q$clone_crs\E/) { |
my %currclonecrs = &Apache::lonnet::dump('environment',$udom,$uname,'cloneable'); |
if ($currclonecrs{'cloneable'} eq '') { |
if ($currclonecrs{'cloneable'} !~ /\Q$clone_crs\E/) { |
$currclonecrs{'cloneable'} = $clone_crs; |
if ($currclonecrs{'cloneable'} eq '') { |
} else { |
$currclonecrs{'cloneable'} = $clone_crs; |
$currclonecrs{'cloneable'} .= ','.$clone_crs; |
} else { |
|
$currclonecrs{'cloneable'} .= ','.$clone_crs; |
|
} |
|
&Apache::lonnet::put('environment',\%currclonecrs,$udom,$uname); |
} |
} |
&Apache::lonnet::put('environment',\%currclonecrs,$udom,$uname); |
|
} |
} |
} |
} |
} |
} |
Line 4260 sub change_clone {
|
Line 4901 sub change_clone {
|
foreach my $oldclone (@$oldcloner) { |
foreach my $oldclone (@$oldcloner) { |
if (!grep(/^\Q$oldclone\E$/,@allowclone)) { |
if (!grep(/^\Q$oldclone\E$/,@allowclone)) { |
if ($oldclone ne '*') { |
if ($oldclone ne '*') { |
my ($uname,$udom) = split(/:/,$oldclone); |
if ($oldclone =~ /:/) { |
if ($uname && $udom && $uname ne '*' ) { |
my ($uname,$udom) = split(/:/,$oldclone); |
if (&Apache::lonnet::homeserver($uname,$udom) ne 'no_host') { |
if ($uname && $udom && $uname ne '*' ) { |
my %currclonecrs = &Apache::lonnet::dump('environment',$udom,$uname,'cloneable'); |
if (&Apache::lonnet::homeserver($uname,$udom) ne 'no_host') { |
my %newclonecrs = (); |
my %currclonecrs = &Apache::lonnet::dump('environment',$udom,$uname,'cloneable'); |
if ($currclonecrs{'cloneable'} =~ /\Q$clone_crs\E/) { |
my %newclonecrs = (); |
if ($currclonecrs{'cloneable'} =~ /,/) { |
if ($currclonecrs{'cloneable'} =~ /\Q$clone_crs\E/) { |
my @currclonecrs = split/,/,$currclonecrs{'cloneable'}; |
if ($currclonecrs{'cloneable'} =~ /,/) { |
foreach my $crs (@currclonecrs) { |
my @currclonecrs = split/,/,$currclonecrs{'cloneable'}; |
if ($crs ne $clone_crs) { |
foreach my $crs (@currclonecrs) { |
$newclonecrs{'cloneable'} .= $crs.','; |
if ($crs ne $clone_crs) { |
|
$newclonecrs{'cloneable'} .= $crs.','; |
|
} |
} |
} |
|
$newclonecrs{'cloneable'} =~ s/,$//; |
|
} else { |
|
$newclonecrs{'cloneable'} = ''; |
} |
} |
$newclonecrs{'cloneable'} =~ s/,$//; |
&Apache::lonnet::put('environment',\%newclonecrs,$udom,$uname); |
} else { |
|
$newclonecrs{'cloneable'} = ''; |
|
} |
} |
&Apache::lonnet::put('environment',\%newclonecrs,$udom,$uname); |
|
} |
} |
} |
} |
} |
} |