version 1.25, 2010/03/08 14:41:01
|
version 1.49.2.6, 2013/05/12 01:03:11
|
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::lonparmset; |
use Apache::lonlocal; |
use Apache::lonlocal; |
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
|
|
Line 267 sub handler {
|
Line 268 sub handler {
|
my %lt; |
my %lt; |
if ($crstype eq 'Community') { |
if ($crstype eq 'Community') { |
%lt = ( |
%lt = ( |
conf => 'Community Configuration', |
conf => 'Community Settings', |
edit => 'Edit Community Configuration', |
edit => 'Edit Community Settings', |
gens => 'General community settings', |
gens => 'General community settings', |
idnu => 'Community ID or number', |
idnu => 'Community ID or number', |
desc => 'Community Description', |
desc => 'Community Description', |
Line 286 sub handler {
|
Line 287 sub handler {
|
defd => 'Default dates for member access', |
defd => 'Default dates for member access', |
stuv => 'Member-viewable membership list options', |
stuv => 'Member-viewable membership list options', |
stul => 'Member agreement needed to be listed', |
stul => 'Member agreement needed to be listed', |
clas => 'Membership and Facilitator Listing', |
clas => 'Membership and facilitator listing', |
priv => 'Privileged users (Domain Coordinators) in facilitator listing', |
priv => 'Privileged users (Domain Coordinators) in facilitator listing', |
defc => 'Default Community Spreadsheet', |
defc => 'Default Community Spreadsheet', |
defs => 'Default User Spreadsheet', |
defs => 'Default User Spreadsheet', |
Line 294 sub handler {
|
Line 295 sub handler {
|
); |
); |
} else { |
} else { |
%lt = ( |
%lt = ( |
conf => 'Course Configuration', |
conf => 'Course Settings', |
edit => 'Edit Course Configuration', |
edit => 'Edit Course Settings', |
gens => 'General course settings', |
gens => 'General course settings', |
idnu => 'Course ID or number', |
idnu => 'Course ID or number', |
desc => 'Course Description', |
desc => 'Course Description', |
|
cred => 'Student credits', |
ownr => 'Course Owner', |
ownr => 'Course Owner', |
cown => 'Course Co-owners', |
cown => 'Course Co-owners', |
catg => 'Categorize course', |
catg => 'Categorize course', |
Line 313 sub handler {
|
Line 315 sub handler {
|
defd => 'Default dates for student access', |
defd => 'Default dates for student access', |
stuv => 'Student-viewable classlist options', |
stuv => 'Student-viewable classlist options', |
stul => 'Student agreement needed to be listed', |
stul => 'Student agreement needed to be listed', |
clas => 'Classlists and Staff Listing', |
clas => 'Classlists and staff listing', |
priv => 'Privileged users (Domain Coordinators) in staff listing', |
priv => 'Privileged users (Domain Coordinators) in staff listing', |
defc => 'Default Course Spreadsheet', |
defc => 'Default Course Spreadsheet', |
defs => 'Default Student Spreadsheet', |
defs => 'Default Student Spreadsheet', |
seme => 'Send message to student when clicking Done on Tasks', |
seme => 'Send message to student when clicking Done on Tasks', |
); |
); |
} |
} |
|
$lt{'lcrv'} = 'Required LON-CAPA version'; |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/courseprefs', |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/courseprefs', |
text=>$lt{'conf'}}); |
text=>$lt{'conf'}}); |
my $breadcrumbs = |
my $breadcrumbs = |
Line 335 sub handler {
|
Line 338 sub handler {
|
return OK; |
return OK; |
} |
} |
|
|
|
if ($phase eq 'releaseinfo') { |
|
my $loncaparev = $env{'course.'.$cid.'.internal.releaserequired'}; |
|
if ($loncaparev) { |
|
&display_loncaparev_constraints($r,$navmap,$loncaparev,$crstype); |
|
return OK; |
|
} |
|
} |
|
|
my %values=&Apache::lonnet::dump('environment',$cdom,$cnum); |
my %values=&Apache::lonnet::dump('environment',$cdom,$cnum); |
my @prefs_order = ('courseinfo','localization','feedback','discussion', |
my @prefs_order = ('courseinfo','localization','feedback','discussion', |
'classlists','appearance','grading','printouts', |
'classlists','appearance','grading','printouts', |
Line 343 sub handler {
|
Line 354 sub handler {
|
my %prefs = ( |
my %prefs = ( |
'courseinfo' => |
'courseinfo' => |
{ text => $lt{'gens'}, |
{ text => $lt{'gens'}, |
help => 'Course_Environment', |
help => 'Course_Prefs_General', |
ordered => ['owner','co-owners','description','courseid', |
ordered => ['owner','co-owners','loncaparev','description', |
'categories','hidefromcat','externalsyllabus', |
'courseid','categories','hidefromcat', |
'cloners','url','rolenames'], |
'externalsyllabus','cloners','url','rolenames'], |
itemtext => { |
itemtext => { |
'owner' => $lt{'ownr'}, |
'owner' => $lt{'ownr'}, |
'co-owners' => $lt{'cown'}, |
'co-owners' => $lt{'cown'}, |
Line 358 sub handler {
|
Line 369 sub handler {
|
'externalsyllabus' => 'URL of Syllabus', |
'externalsyllabus' => 'URL of Syllabus', |
'url' => 'Top Level Map', |
'url' => 'Top Level Map', |
'rolenames' => $lt{'rept'}, |
'rolenames' => $lt{'rept'}, |
|
'loncaparev' => $lt{'lcrv'}, |
}, |
}, |
}, |
}, |
'localization' => |
'localization' => |
{ text => 'Language & Time Localization', |
{ text => 'Language and time localization', |
help => 'Course_Environment', |
help => 'Course_Prefs_Language', |
ordered => ['languages','timezone','datelocale'], |
ordered => ['languages','timezone','datelocale'], |
itemtext => { |
itemtext => { |
languages => 'Languages used', |
languages => 'Languages used', |
Line 372 sub handler {
|
Line 384 sub handler {
|
}, |
}, |
'feedback' => |
'feedback' => |
{ text => 'Feedback messages', |
{ text => 'Feedback messages', |
help => 'Course_Environment', |
help => 'Course_Prefs_Feedback', |
header => [{col1 => 'Questions about:', |
header => [{col1 => 'Questions about:', |
col2 => 'Recipients'}], |
col2 => 'Recipients'}], |
ordered => ['question.email','comment.email','policy.email'], |
ordered => ['question.email','comment.email','policy.email'], |
Line 384 sub handler {
|
Line 396 sub handler {
|
}, |
}, |
'discussion' => |
'discussion' => |
{ text => 'Discussion and Chat', |
{ text => 'Discussion and Chat', |
help => 'Course_Environment', |
help => 'Course_Prefs_Discussions', |
ordered => ['plc.roles.denied','plc.users.denied', |
ordered => ['pch.roles.denied','pch.users.denied', |
'pch.roles.denied','pch.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', |
|
'discussion_post_fonts'], |
itemtext => { |
itemtext => { |
'plc.roles.denied' => 'No Resource Discussion', |
'pch.roles.denied' => 'No Resource Discussion', |
'plc.users.denied' => 'No Resource Discussion', |
'pch.users.denied' => 'No Resource Discussion', |
'pch.roles.denied' => 'No Chat room use', |
'plc.roles.denied' => 'No Chat room use', |
'pch.users.denied' => 'No Chat room use', |
'plc.users.denied' => 'No Chat room use', |
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', |
}, |
}, |
}, |
}, |
'classlists' => |
'classlists' => |
{ text => $lt{'clas'}, |
{ text => $lt{'clas'}, |
help => 'Course_Environment', |
help => 'Course_Prefs_Classlists', |
header => [{col1 => 'Type', |
header => [{col1 => 'Type', |
col2 => $lt{'defd'}}, |
col2 => $lt{'defd'}}, |
{col1 => 'Setting', |
{col1 => 'Setting', |
Line 409 sub handler {
|
Line 423 sub handler {
|
col2 => $lt{'stuv'}}], |
col2 => $lt{'stuv'}}], |
ordered => ['default_enrollment_start_date', |
ordered => ['default_enrollment_start_date', |
'default_enrollment_end_date', |
'default_enrollment_end_date', |
|
'defaultcredits', |
'nothideprivileged','student_classlist_view', |
'nothideprivileged','student_classlist_view', |
'student_opt_in','student_classlist_portfiles'], |
'student_classlist_opt_in','student_classlist_portfiles'], |
itemtext => { |
itemtext => { |
default_enrollment_start_date => 'Start date', |
default_enrollment_start_date => 'Start date', |
default_enrollment_end_date => 'End date', |
default_enrollment_end_date => 'End date', |
nothideprivileged => $lt{'priv'}, |
nothideprivileged => $lt{'priv'}, |
student_classlist_view => $lt{'stuv'}, |
student_classlist_view => $lt{'stuv'}, |
student_opt_in => $lt{'stul'}, |
student_classlist_opt_in => $lt{'stul'}, |
student_classlist_portfiles => 'Include link to accessible portfolio files', |
student_classlist_portfiles => 'Include link to accessible portfolio files', |
|
defaultcredits => $lt{'cred'}, |
}, |
}, |
}, |
}, |
'appearance' => |
'appearance' => |
{ text => 'Display of resources ', |
{ text => 'Display of resources ', |
help => 'Course_Environment', |
help => 'Course_Prefs_Display', |
ordered => ['default_xml_style','pageseparators', |
ordered => ['default_xml_style','pageseparators', |
'disable_receipt_display','texengine', |
'disable_receipt_display','texengine', |
'tthoptions'], |
'tthoptions'], |
Line 436 sub handler {
|
Line 452 sub handler {
|
}, |
}, |
'grading' => |
'grading' => |
{ text => 'Grading', |
{ text => 'Grading', |
help => 'Course_Environment', |
help => 'Course_Prefs_Grading', |
ordered => ['grading','rndseed', |
ordered => ['grading','rndseed', |
'receiptalg','disablesigfigs'], |
'receiptalg','disablesigfigs'], |
itemtext => { |
itemtext => { |
Line 449 sub handler {
|
Line 465 sub handler {
|
}, |
}, |
'printouts' => |
'printouts' => |
{ text => 'Printout generation', |
{ text => 'Printout generation', |
help => 'Course_Environment', |
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','canuse_pdfforms'], |
'disableexampointprint'], |
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', |
default_paper_size => 'Default paper type', |
default_paper_size => 'Default paper type', |
print_header_format => 'Print header format', |
print_header_format => 'Print header format', |
disableexampointprint => 'Disable automatically printing point values on exams', |
disableexampointprint => 'Disable automatically printing point values on bubblesheet exams', |
canuse_pdfforms => 'Users can print problems as PDF forms and upload later for grading', |
canuse_pdfforms => 'Users can print problems as PDF forms and upload later for grading', |
}, |
}, |
}, |
}, |
'spreadsheet' => |
'spreadsheet' => |
{ text => 'Spreadsheets', |
{ text => 'Spreadsheets', |
help => 'Course_Environment', |
help => 'Course_Prefs_Spreadsheet', |
ordered => ['spreadsheet_default_classcalc', |
ordered => ['spreadsheet_default_classcalc', |
'spreadsheet_default_studentcalc', |
'spreadsheet_default_studentcalc', |
'spreadsheet_default_assesscalc','hideemptyrows'], |
'spreadsheet_default_assesscalc','hideemptyrows'], |
Line 477 sub handler {
|
Line 493 sub handler {
|
}, |
}, |
'bridgetasks' => |
'bridgetasks' => |
{ text => 'Bridge tasks', |
{ text => 'Bridge tasks', |
help => 'Course_Environment', |
help => 'Course_Prefs_Bridgetasks', |
ordered => ['task_messages','task_grading', |
ordered => ['task_messages','task_grading', |
'suppress_embed_prompt'], |
'suppress_embed_prompt'], |
itemtext => { |
itemtext => { |
Line 488 sub handler {
|
Line 504 sub handler {
|
}, |
}, |
'other' => |
'other' => |
{ text => 'Other settings', |
{ text => 'Other settings', |
help => 'Course_Environment', |
help => 'Course_Prefs_Other', |
header => [ {col1 => 'Item', |
header => [ {col1 => 'Item', |
col2 => 'Value', |
col2 => 'Value', |
}], |
}], |
Line 498 sub handler {
|
Line 514 sub handler {
|
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); |
$cnum,undef,\@allitems,'coursepref'); |
} elsif ($phase eq 'display') { |
} elsif ($phase eq 'display') { |
my $jscript = &get_jscript($cdom,$phase,$crstype); |
my $jscript = &get_jscript($cid,$cdom,$phase,$crstype); |
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); |
\@prefs_order,\%prefs,\%values,undef,$jscript,\@allitems,$crstype,'coursepref'); |
} else { |
} else { |
&Apache::lonconfigsettings::display_choices($r,$phase,$context, |
&Apache::lonconfigsettings::display_choices($r,$phase,$context, |
\@prefs_order,\%prefs); |
\@prefs_order,\%prefs,'coursepref'); |
} |
} |
return OK; |
return OK; |
} |
} |
Line 533 sub print_config_box {
|
Line 549 sub print_config_box {
|
my $itemtext = $item->{'itemtext'}; |
my $itemtext = $item->{'itemtext'}; |
my $rowtotal = 0; |
my $rowtotal = 0; |
my $output = |
my $output = |
'<h3><a href="#">'.&mt($item->{text}).'</a></h3> |
'<table class="LC_nested_outer"> |
<div> <span style="float:right">'. |
<tr> |
&Apache::loncommon::help_open_topic($item->{'help'}).'</span>'; |
<th align="left" valign="middle"><span class="LC_nobreak" style="font-size: larger;" >'. |
|
&mt($item->{text}); |
|
if ($item->{'help'}) { |
|
$output .= ' '. |
|
&Apache::loncommon::help_open_topic($item->{'help'}); |
|
} |
|
$output .= '</span></th>'."\n". |
|
'</tr>'; |
if (($action eq 'feedback') || ($action eq 'classlists')) { |
if (($action eq 'feedback') || ($action eq 'classlists')) { |
$output .= ' |
$output .= ' |
|
<tr> |
|
<td> |
<table class="LC_nested">'; |
<table class="LC_nested">'; |
if (exists $item->{'header'}->[0]->{'col1'} || |
if (exists $item->{'header'}->[0]->{'col1'} || |
exists $item->{'header'}->[0]->{'col2'}) { |
exists $item->{'header'}->[0]->{'col2'}) { |
Line 555 sub print_config_box {
|
Line 580 sub print_config_box {
|
} |
} |
$output .= ' |
$output .= ' |
</table> |
</table> |
|
</td> |
|
</tr> |
|
<tr> |
|
<td> |
<table class="LC_nested"> |
<table class="LC_nested"> |
<tr class="LC_info_row"> |
<tr class="LC_info_row"> |
<td class="LC_left_item">'.&mt($item->{'header'}->[1]->{'col1'}).'</td>'; |
<td class="LC_left_item">'.&mt($item->{'header'}->[1]->{'col1'}).'</td>'; |
Line 565 sub print_config_box {
|
Line 594 sub print_config_box {
|
$output .= &print_classlists('middle',$cdom,$settings,$itemtext,\$rowtotal,$crstype). |
$output .= &print_classlists('middle',$cdom,$settings,$itemtext,\$rowtotal,$crstype). |
' |
' |
</table> |
</table> |
|
</td> |
|
</tr> |
|
<tr> |
|
<td> |
<table class="LC_nested">'; |
<table class="LC_nested">'; |
if (exists $item->{'header'}->[0]->{'col1'} || |
if (exists $item->{'header'}->[2]->{'col1'} || |
exists $item->{'header'}->[0]->{'col2'}) { |
exists $item->{'header'}->[2]->{'col2'}) { |
$output .= ' |
$output .= ' |
<tr class="LC_info_row"> |
<tr class="LC_info_row"> |
<td class="LC_left_item">'.&mt($item->{'header'}->[0]->{'col1'}).'</td> |
<td class="LC_left_item">'.&mt($item->{'header'}->[2]->{'col1'}).'</td> |
<td class="LC_right_item">'.&mt($item->{'header'}->[0]->{'col2'}).'</td> |
<td class="LC_right_item">'.&mt($item->{'header'}->[2]->{'col2'}).'</td> |
</tr>'; |
</tr>'; |
} |
} |
} |
} |
} else { |
} else { |
$output .= ' |
$output .= ' |
|
<tr> |
|
<td> |
<table class="LC_nested">'; |
<table class="LC_nested">'; |
if (exists $item->{'header'}->[0]->{'col1'} || |
if (exists $item->{'header'}->[0]->{'col1'} || |
exists $item->{'header'}->[0]->{'col2'}) { |
exists $item->{'header'}->[0]->{'col2'}) { |
Line 596 sub print_config_box {
|
Line 631 sub print_config_box {
|
$output .= &print_feedback('bottom',$cdom,$settings,$ordered,$itemtext,\$rowtotal); |
$output .= &print_feedback('bottom',$cdom,$settings,$ordered,$itemtext,\$rowtotal); |
} elsif ($action eq 'discussion') { |
} elsif ($action eq 'discussion') { |
$output .= &print_discussion($cdom,$settings,$ordered,$itemtext,\$rowtotal); |
$output .= &print_discussion($cdom,$settings,$ordered,$itemtext,\$rowtotal); |
} elsif ($action eq 'classlists') { |
} 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); |
} 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); |
Line 613 sub print_config_box {
|
Line 648 sub print_config_box {
|
} |
} |
$output .= ' |
$output .= ' |
</table> |
</table> |
</div>'; |
</td> |
|
</tr> |
|
</table><br />'; |
return ($output,$rowtotal); |
return ($output,$rowtotal); |
} |
} |
|
|
Line 637 sub process_changes {
|
Line 674 sub process_changes {
|
} |
} |
} |
} |
} elsif (ref($item->{'ordered'}) eq 'ARRAY') { |
} elsif (ref($item->{'ordered'}) eq 'ARRAY') { |
@ordered = @{$item->{'ordered'}}; |
if ($action eq 'courseinfo') { |
|
my ($can_toggle_cat,$can_categorize) = |
|
&can_modify_catsettings($cdom,$crstype); |
|
foreach my $entry (@{$item->{'ordered'}}) { |
|
next if (($entry eq 'hidefromcat') && |
|
(!$can_toggle_cat)); |
|
next if (($entry eq 'categories') && |
|
(!$can_categorize)); |
|
next if (($entry eq 'loncaparev') || |
|
($entry eq 'owner')); |
|
push(@ordered,$entry); |
|
} |
|
} elsif ($action eq 'classlists') { |
|
foreach my $entry (@{$item->{'ordered'}}) { |
|
next if ($entry eq 'defaultcredits'); |
|
push(@ordered,$entry); |
|
} |
|
} else { |
|
@ordered = @{$item->{'ordered'}}; |
|
} |
} |
} |
if (@ordered > 0) { |
if (@ordered > 0) { |
if ($action eq 'feedback') { |
if ($action eq 'feedback') { |
Line 687 sub process_changes {
|
Line 743 sub process_changes {
|
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 '') { |
if ($env{'form.clonersdom_'.$actnum} ne '') { |
if ($env{'form.cloners_dom_'.$actnum} ne '') { |
my $clonedom = $env{'form.clonersdom_'.$actnum}; |
my $clonedom = $env{'form.cloners_dom_'.$actnum}; |
if (&check_clone($clonedom,$disallowed) eq 'ok') { |
if (&check_clone($clonedom,$disallowed) eq 'ok') { |
$newvalues{$entry} = '*:'.$clonedom; |
$newvalues{$entry} = '*:'.$clonedom; |
push(@clonedoms,$newvalues{$entry}); |
push(@clonedoms,$newvalues{$entry}); |
Line 945 sub process_changes {
|
Line 1001 sub process_changes {
|
} |
} |
} |
} |
$newvalues{$entry} =~ s/,$//; |
$newvalues{$entry} =~ s/,$//; |
|
} elsif ($entry eq 'discussion_post_fonts') { |
|
my ($classorder,$classtitles) = &discussion_vote_classes(); |
|
my $fontchange = 0; |
|
foreach my $class (@{$classorder}) { |
|
my $ext_entry = $entry.'_'.$class; |
|
my $size = $env{'form.'.$ext_entry.'_size'}; |
|
my $unit = $env{'form.'.$ext_entry.'_unit'}; |
|
my $weight = $env{'form.'.$ext_entry.'_weight'}; |
|
my $style = $env{'form.'.$ext_entry.'_style'}; |
|
my $other = $env{'form.'.$ext_entry.'_other'}; |
|
$size =~ s/,//g; |
|
$unit =~ s/,//g; |
|
$weight =~ s/,//g; |
|
$style =~ s/,//g; |
|
$other =~ s/[^\w;:\s\-\%.]//g; |
|
$other =~ s/(^\s+|\s+$)//g; |
|
$newvalues{$ext_entry} = join(',',($size.$unit,$weight,$style,$other)); |
|
my $current = $values->{$ext_entry}; |
|
if ($values->{$ext_entry} eq '') { |
|
$current = ',,,'; |
|
} |
|
if ($newvalues{$ext_entry} ne $current) { |
|
$changes->{$ext_entry} = $newvalues{$ext_entry}; |
|
$fontchange ++; |
|
} |
|
} |
|
if ($fontchange) { |
|
$changes->{$entry} = 1; |
|
} |
} elsif ($entry eq 'nothideprivileged') { |
} elsif ($entry eq 'nothideprivileged') { |
my @curr_nothide; |
my @curr_nothide; |
my @new_nothide; |
my @new_nothide; |
Line 1000 sub process_changes {
|
Line 1085 sub process_changes {
|
$hdr .= $env{'form.printfmthdr_limit_'.$i}; |
$hdr .= $env{'form.printfmthdr_limit_'.$i}; |
} |
} |
$hdr .= $env{'form.printfmthdr_sub_'.$i}; |
$hdr .= $env{'form.printfmthdr_sub_'.$i}; |
} elsif ($env{'form.printfmthdr_sub_'.$i} ne '') { |
} elsif ($env{'form.printfmthdr_text_'.$i} ne '') { |
$hdr = $env{'form.printfmthdr_sub_'.$i}; |
$hdr = $env{'form.printfmthdr_text_'.$i}; |
} |
} |
$newhdr[$env{'form.printfmthdr_pos_'.$i}] = $hdr; |
$newhdr[$env{'form.printfmthdr_pos_'.$i}] = $hdr; |
} |
} |
Line 1048 sub process_changes {
|
Line 1133 sub process_changes {
|
} else { |
} else { |
$newvalues{$entry} = $env{'form.'.$entry}; |
$newvalues{$entry} = $env{'form.'.$entry}; |
} |
} |
unless ($entry eq 'co-owners') { |
unless (($entry eq 'co-owners') || ($entry eq 'discussion_post_fonts')) { |
if ($newvalues{$entry} ne $values->{$entry}) { |
if ($newvalues{$entry} ne $values->{$entry}) { |
$changes->{$entry} = $newvalues{$entry}; |
$changes->{$entry} = $newvalues{$entry}; |
} |
} |
Line 1175 sub store_changes {
|
Line 1260 sub store_changes {
|
my ($displayname,$text); |
my ($displayname,$text); |
$text = $prefs->{$item}->{'itemtext'}{$key}; |
$text = $prefs->{$item}->{'itemtext'}{$key}; |
my $displayval; |
my $displayval; |
unless ($key eq 'co-owners') { |
unless (($key eq 'co-owners') || ($key eq 'discussion_post_fonts')) { |
$displayval = $changes->{$item}{$key}; |
$displayval = $changes->{$item}{$key}; |
} |
} |
if ($item eq 'feedback') { |
if ($item eq 'feedback') { |
Line 1211 sub store_changes {
|
Line 1296 sub store_changes {
|
} |
} |
$displayval = join(', ',@longroles); |
$displayval = join(', ',@longroles); |
} |
} |
|
} elsif ($key eq 'discussion_post_fonts') { |
|
my ($classorder,$classtitles)=&discussion_vote_classes(); |
|
my ($styleorder,$styleitems)=&discussion_vote_styles(); |
|
my $count = 1; |
|
my $total = scalar(keys(%{$changes->{$item}})); |
|
foreach my $class (@{$classorder}) { |
|
$count ++; |
|
next unless ($changes->{$item}{$key.'_'.$class}); |
|
my @vals = split(/,/,$changes->{$item}{$key.'_'.$class}); |
|
my $showval = ''; |
|
for (my $i=0; $i<@{$styleorder}; $i++) { |
|
if ($vals[$i] ne '') { |
|
$showval .= 'font-'.$styleorder->[$i].': '.$vals[$i].'; '; |
|
} |
|
} |
|
if ($vals[3] ne '') { |
|
$showval .= $vals[3]; |
|
} |
|
if ($showval ne '') { |
|
$displayval .= $classtitles->{$class}.':{ '. |
|
$showval.'}'; |
|
$storehash{$key.'_'.$class} = $changes->{$item}{$key.'_'.$class}; |
|
} else { |
|
$displayval .= $classtitles->{$class}.': '.&mt('None'); |
|
push(@delkeys,$key.'_'.$class); |
|
} |
|
unless ($count == $total) { |
|
$displayval .= (' 'x2); |
|
} |
|
} |
} |
} |
$displayname = &mt($text); |
$displayname = &mt($text); |
} |
} |
Line 1296 sub store_changes {
|
Line 1411 sub store_changes {
|
if ($key eq 'url') { |
if ($key eq 'url') { |
my $bkuptime=time; |
my $bkuptime=time; |
$output .= (' 'x2).&mt('(Previous URL backed up)').': '. |
$output .= (' 'x2).&mt('(Previous URL backed up)').': '. |
$storehash{'top level map backup '.$bkuptime} => $values->{$key}; |
$storehash{'top level map backup '.$bkuptime} = $values->{$key}; |
} |
} |
$output .= '</li>'; |
$output .= '</li>'; |
} |
} |
Line 1310 sub store_changes {
|
Line 1425 sub store_changes {
|
} |
} |
} |
} |
} else { |
} else { |
$storehash{$key} = $changes->{$item}{$key}; |
unless ($key eq 'discussion_post_fonts') { |
|
$storehash{$key} = $changes->{$item}{$key}; |
|
} |
} |
} |
} |
} |
if ($key eq 'cloners') { |
if ($key eq 'cloners') { |
Line 1334 sub store_changes {
|
Line 1451 sub store_changes {
|
$output .= '</ul>'; |
$output .= '</ul>'; |
} else { |
} else { |
if ($crstype eq 'Community') { |
if ($crstype eq 'Community') { |
$output = &mt('No changes made to community settings.'); |
$output .= &mt('No changes made to community settings.'); |
} else { |
} else { |
$output = &mt('No changes made to course settings.'); |
$output .= &mt('No changes made to course settings.'); |
} |
} |
} |
} |
} |
} |
Line 1511 sub get_course {
|
Line 1628 sub get_course {
|
} |
} |
|
|
sub get_jscript { |
sub get_jscript { |
my ($cdom,$phase,$crstype) = @_; |
my ($cid,$cdom,$phase,$crstype) = @_; |
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); |
my ($jscript,$categorize_js,$loncaparev_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); |
Line 1530 function catsbrowser() {
|
Line 1647 function catsbrowser() {
|
} |
} |
ENDSCRIPT |
ENDSCRIPT |
} |
} |
|
my $loncaparev = $env{'course.'.$cid.'.internal.releaserequired'}; |
|
if ($loncaparev) { |
|
$loncaparev_js = <<ENDSCRIPT; |
|
function loncaparevinfo() { |
|
var lcrevwin = null; |
|
var url = '/adm/courseprefs?phase=releaseinfo'; |
|
if (!lcrevwin || lcrevwin.closed) { |
|
lcrevwin=window.open(url,'releasewin','height=480,width=600,resizable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no'); |
|
} else { |
|
lcrevwin.focus(); |
|
} |
|
} |
|
ENDSCRIPT |
|
} |
$jscript = '<script type="text/javascript" language="Javascript">'."\n". |
$jscript = '<script type="text/javascript" language="Javascript">'."\n". |
$browse_js."\n".$categorize_js."\n".$cloners_js."\n".'</script>'. |
$browse_js."\n".$categorize_js."\n".$loncaparev_js."\n". |
"\n".$stubrowse_js."\n"; |
$cloners_js."\n".'</script>'."\n".$stubrowse_js."\n"; |
return $jscript; |
return $jscript; |
} |
} |
|
|
Line 1658 sub print_courseinfo {
|
Line 1789 sub print_courseinfo {
|
&mt('Modification may make assessment data inaccessible!'). |
&mt('Modification may make assessment data inaccessible!'). |
'</span>', |
'</span>', |
input => 'textbox', |
input => 'textbox', |
size => '40', |
size => '55', |
advanced => 1 |
advanced => 1 |
}, |
}, |
'description' => { |
'description' => { |
text => '<b>'.&mt($itemtext->{'description'}).'</b>', |
text => '<b>'.&mt($itemtext->{'description'}).'</b>', |
input => 'textbox', |
input => 'textbox', |
size => '25', |
size => '55', |
}, |
}, |
'owner' => { |
'owner' => { |
text => '<b>'.&mt($itemtext->{'owner'}).'</b>', |
text => '<b>'.&mt($itemtext->{'owner'}).'</b>', |
Line 1682 sub print_courseinfo {
|
Line 1813 sub print_courseinfo {
|
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'), |
input => 'textbox', |
input => 'textbox', |
size => '40', |
size => '40' |
advanced => 1 |
|
}, |
}, |
'rolenames' => { |
'rolenames' => { |
text => '<b>'.&mt($itemtext->{'rolenames'}).'</b><br />'. |
text => '<b>'.&mt($itemtext->{'rolenames'}).'</b><br />'. |
Line 1709 sub print_courseinfo {
|
Line 1839 sub print_courseinfo {
|
input => 'textbox', |
input => 'textbox', |
size => '25', |
size => '25', |
}, |
}, |
|
'loncaparev' => { |
|
text => '<b>'.&mt($itemtext->{'loncaparev'}).'</b>', |
|
}, |
|
'defaultcredits' => { |
|
text => '<b>'.&mt($itemtext->{'defaultcredits'}).'</b>', |
|
}, |
); |
); |
my $datatable; |
my $datatable; |
my $count = 0; |
my $count = 0; |
Line 1846 sub print_courseinfo {
|
Line 1982 sub print_courseinfo {
|
} else { |
} else { |
$owner = &mt('None specified'); |
$owner = &mt('None specified'); |
} |
} |
my $domdesc = &Apache::lonnet::domain($cdom,'description'); |
|
$datatable .= $owner; |
$datatable .= $owner; |
} elsif ($item eq 'co-owners') { |
} elsif ($item eq 'co-owners') { |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
Line 1868 sub print_courseinfo {
|
Line 2003 sub print_courseinfo {
|
$datatable .= &manage_coownership($cnum,$cdom,@currcoown); |
$datatable .= &manage_coownership($cnum,$cdom,@currcoown); |
} |
} |
} |
} |
|
} elsif ($item eq 'loncaparev') { |
|
my $loncaparev = $env{'course.'.$env{'request.course.id'}.'.internal.releaserequired'}; |
|
my $showreqd; |
|
if ($loncaparev) { |
|
$showreqd = &mt('[_1] or newer',$loncaparev).' <a href="javascript:loncaparevinfo()">'. |
|
&mt('Details').'</a>'; |
|
} else { |
|
$showreqd = &mt('No specific version required'); |
|
} |
|
$datatable .= $showreqd; |
} else { |
} else { |
$datatable .= &Apache::lonhtmlcommon::textbox($item,$settings->{$item},$items{$item}{size}); |
$datatable .= &Apache::lonhtmlcommon::textbox($item,$settings->{$item},$items{$item}{size}); |
} |
} |
Line 2025 ENDSCRIPT
|
Line 2170 ENDSCRIPT
|
return; |
return; |
} |
} |
|
|
|
sub display_loncaparev_constraints { |
|
my ($r,$navmap,$loncaparev,$crstype) = @_; |
|
my $cid = $env{'request.course.id'}; |
|
my $cdom = $env{'course.'.$cid.'.domain'}; |
|
my $cnum = $env{'course.'.$cid.'.num'}; |
|
my $output; |
|
my %lt = &Apache::lonlocal::texthash ( |
|
'all' => 'all', |
|
'section/group' => 'section/group', |
|
'user' => 'user', |
|
); |
|
my (%checkparms,%checkresponsetypes,%checkcrstypes,%anonsurvey,%randomizetry); |
|
&Apache::loncommon::build_release_hashes(\%checkparms,\%checkresponsetypes, |
|
\%checkcrstypes,\%anonsurvey,\%randomizetry); |
|
if (defined($checkcrstypes{$crstype})) { |
|
$output .= '<h4>'.&mt('Course type: [_1] requires [_2] or newer',$crstype, |
|
$checkcrstypes{$crstype}).'</h4>'; |
|
} |
|
my (%fromparam,%rowspan,%bymap,%byresource,@scopeorder,%toshow,%allmaps, |
|
%byresponsetype,%bysubmission); |
|
@scopeorder = ('all','section/group','user'); |
|
my $resourcedata = &Apache::lonparmset::readdata($cnum,$cdom); |
|
if (ref($resourcedata) eq 'HASH') { |
|
foreach my $key (keys(%{$resourcedata})) { |
|
foreach my $item (keys(%checkparms)) { |
|
if ($key =~ /(\Q$item\E)$/) { |
|
if (ref($checkparms{$item}) eq 'ARRAY') { |
|
my $value = $resourcedata->{$key}; |
|
my ($middle,$scope,$which,$level,$map,$resource); |
|
if (grep(/^\Q$value\E$/,@{$checkparms{$item}})) { |
|
my $stdtype = &Apache::lonparmset::standard_parameter_types($item); |
|
my $stdname = &Apache::lonparmset::standard_parameter_names($item); |
|
my $valname = &get_param_description($stdtype,$value); |
|
my $rev = $Apache::lonnet::needsrelease{'parameter:'.$item.':'.$value}; |
|
my $start = $cid.'.'; |
|
if ($key =~ /^\Q$start\E(\[useropt\:($match_username\:$match_domain)\]\.)/) { |
|
$middle = $1; |
|
$which = $2; |
|
$scope = 'user'; |
|
} elsif ($key =~ /^\Q$start\E(\[(\w+)\]\.)/) { |
|
$middle = $1; |
|
$which = $2; |
|
$scope = 'section/group'; |
|
} else { |
|
$scope = 'all'; |
|
} |
|
my $what="$stdname=$valname"; |
|
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\).\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); |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
if (keys(%fromparam)) { |
|
$output .= '<h4>'.&mt('Requirements from general settings').'</h4>'. |
|
&Apache::loncommon::start_data_table(). |
|
&Apache::loncommon::start_data_table_header_row(). |
|
'<th>'.&mt('Release').'</th><th>'.&mt('Scope').'</th>'. |
|
'<th>'.&mt('Extent').'</th><th>'.&mt('Setting').'</th>'. |
|
&Apache::loncommon::end_data_table_header_row(); |
|
foreach my $rev (keys(%fromparam)) { |
|
$output .= &Apache::loncommon::start_data_table_row(). |
|
'<td rowspan="'.$rowspan{$rev}.'">'.$rev.'</td>'; |
|
my $newrow; |
|
foreach my $scope (@scopeorder) { |
|
if (ref($fromparam{$rev}{$scope}) eq 'HASH') { |
|
if ($newrow) { |
|
$output .= &Apache::loncommon::continue_data_table_row(); |
|
} |
|
$output .= '<td>'.$lt{$scope}.'</td>'; |
|
foreach my $which (sort(keys(%{$fromparam{$rev}{$scope}}))) { |
|
$output .= '<td>'.$which.'</td><td>'. |
|
join('<br />',@{$fromparam{$rev}{$scope}{$which}}).'</td>'; |
|
} |
|
$output .= &Apache::loncommon::end_data_table_row(); |
|
$newrow = 1; |
|
} elsif (ref($fromparam{$rev}{$scope}) eq 'ARRAY') { |
|
if ($newrow) { |
|
$output .= &Apache::loncommon::continue_data_table_row(); |
|
} |
|
$output .= '<td>'.$lt{$scope}.'</td><td> </td><td>'. |
|
join('<br />',@{$fromparam{$rev}{$scope}}).'</td>'. |
|
&Apache::loncommon::end_data_table_row(); |
|
$newrow = 1; |
|
} |
|
} |
|
} |
|
$output .= &Apache::loncommon::end_data_table().'<br />'; |
|
} |
|
} |
|
|
|
if (defined($navmap)) { |
|
my %anonsubms=&Apache::lonnet::dump('nohist_anonsurveys',$cdom,$cnum); |
|
my $rev_anonsurv=$Apache::lonnet::needsrelease{'parameter:type:anonsurvey'}; |
|
my %randtrysubms=&Apache::lonnet::dump('nohist_randomizetry',$cdom,$cnum); |
|
my $rev_randtry=$Apache::lonnet::needsrelease{'parameter:type:randomizetry'}; |
|
my $stdtype=&Apache::lonparmset::standard_parameter_types('type'); |
|
my $stdname=&Apache::lonparmset::standard_parameter_names('type'); |
|
my $valanon=&get_param_description($stdtype,'anonsurvey'); |
|
my $valrandtry=&get_param_description($stdtype,'randomizetry'); |
|
|
|
foreach my $res ($navmap->retrieveResources(undef,sub { $_[0]->is_problem() },1,0)) { |
|
my @parts = @{$res->parts()}; |
|
my $symb = $res->symb(); |
|
my $enclosing_map = &Apache::lonnet::declutter($res->enclosing_map_src()); |
|
foreach my $part (@parts) { |
|
if (exists($anonsubms{$symb."\0".$part})) { |
|
my $rev = $rev_anonsurv; |
|
my $what="$stdname=$valanon"; |
|
if (ref($bysubmission{$symb}{$rev}) eq 'ARRAY') { |
|
unless (grep(/^\Q$what\E/,@{$bysubmission{$symb}{$rev}})) { |
|
push(@{$bysubmission{$symb}{$rev}},$what); |
|
} |
|
} else { |
|
push(@{$bysubmission{$symb}{$rev}},$what); |
|
} |
|
$allmaps{$enclosing_map} = 1; |
|
} |
|
if (exists($randtrysubms{$symb."\0".$part})) { |
|
my $rev = $rev_randtry; |
|
my $what="$stdname=$valrandtry"; |
|
if (ref($bysubmission{$symb}{$rev}) eq 'ARRAY') { |
|
unless (grep(/^\Q$what\E/,@{$bysubmission{$symb}{$rev}})) { |
|
push(@{$bysubmission{$symb}{$rev}},$what); |
|
} |
|
} else { |
|
push(@{$bysubmission{$symb}{$rev}},$what); |
|
} |
|
$allmaps{$enclosing_map} = 1; |
|
} |
|
} |
|
my %responses = $res->responseTypes(); |
|
foreach my $key (keys(%responses)) { |
|
if (exists($checkresponsetypes{$key})) { |
|
push(@{$byresponsetype{$symb}{$checkresponsetypes{$key}}},$key); |
|
$allmaps{$enclosing_map} = 1; |
|
} |
|
} |
|
} |
|
if (keys(%byresource) > 0) { |
|
foreach my $symb (keys(%byresource)) { |
|
my ($map,$resid,$resurl)=&Apache::lonnet::decode_symb($symb); |
|
$allmaps{$map} = 1; |
|
} |
|
} |
|
if (keys(%bymap) > 0) { |
|
foreach my $map (keys(%bymap)) { |
|
$allmaps{$map} = 1; |
|
} |
|
} |
|
foreach my $map (keys(%allmaps)) { |
|
my $mapres = $navmap->getResourceByUrl($map); |
|
my $mapsymb = $mapres->symb(); |
|
$toshow{$mapsymb} = 1; |
|
if (ref($mapres)) { |
|
my $pcslist = $mapres->map_hierarchy(); |
|
if ($pcslist ne '') { |
|
foreach my $pc (split(/,/,$pcslist)) { |
|
my $res = $navmap->getByMapPc($pc); |
|
if (ref($res)) { |
|
my $symb = $res->symb(); |
|
unless ($symb eq '______') { |
|
$toshow{$symb} = 1; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
my $mapres_header = '<h4>'. |
|
&mt('Requirements for specific folders or resources'). |
|
'</h4>'; |
|
if ((keys(%toshow) > 0) || (keys(%byresource) > 0) || |
|
(keys(%bysubmission) > 0) || (keys(%byresponsetype))) { |
|
$output .= $mapres_header; |
|
} |
|
my $top_header = '<h3>'.&mt('LON-CAPA version dependencies').'</h3>'; |
|
my $title = 'Version Constraints'; |
|
my $start_page = |
|
&Apache::loncommon::start_page($title,undef,{'only_body' => 1,}); |
|
$r->print($start_page.$top_header); |
|
if ($output) { |
|
$r->print($output); |
|
if (defined($navmap)) { |
|
&show_contents_view($r,$navmap,$cid,\%toshow,\%bymap,\%byresource,\%bysubmission, |
|
\%byresponsetype,\@scopeorder,\%lt); |
|
} |
|
$r->print('<br /><br />'); |
|
} else { |
|
$r->print('<p class="LC_info">'. |
|
&mt('No version requirements from resource content or settings.'). |
|
'</p>'); |
|
} |
|
$r->print(&Apache::loncommon::end_page()); |
|
return; |
|
} |
|
|
|
sub show_contents_view { |
|
my ($r,$navmap,$cid,$toshow,$bymap,$byresource,$bysubmission,$byresponsetype, |
|
$scopeorder,$lt) = @_; |
|
if ((keys(%{$toshow}) > 0) || (keys(%{$byresource}) > 0) || |
|
(keys(%{$bysubmission}) > 0) || (keys(%{$byresponsetype}) > 0)) { |
|
my $location=&Apache::loncommon::lonhttpdurl("/adm/lonIcons"); |
|
my $whitespace = '<img src="'.$location.'/whitespace_21.gif" alt="" />'; |
|
my $icon = '<img src="'.$location.'/navmap.folder.open.gif" alt="" />'; |
|
my $topmap = $env{'course.'.$cid.'.url'}; |
|
$r->print(&Apache::loncommon::start_data_table(). |
|
&Apache::loncommon::start_data_table_header_row(). |
|
'<th>'.&mt('Location').'</th><th>'.&mt('Release').'</th>'. |
|
'<th>'.&mt('Attribute/Setting').'</th>'. |
|
&Apache::loncommon::end_data_table_header_row(). |
|
&Apache::loncommon::start_data_table_row(). |
|
'<td> '.$icon.' '.&mt('Main Course Documents').'</td>'); |
|
&releases_by_map($r,$bymap,$topmap,$scopeorder,$lt); |
|
$r->print(&Apache::loncommon::end_data_table_row()); |
|
my $it=$navmap->getIterator(undef,undef,undef,1,1,undef); |
|
my $curRes; |
|
my $depth = 0; |
|
my %parent = (); |
|
my $startcount = 5; |
|
my $lastcontainer = $startcount; |
|
while ($curRes = $it->next()) { |
|
if ($curRes == $it->BEGIN_MAP()) { |
|
$depth++; |
|
$parent{$depth}= $lastcontainer; |
|
} |
|
if ($curRes == $it->END_MAP()) { |
|
$depth--; |
|
$lastcontainer = $parent{$depth}; |
|
} |
|
my $indent; |
|
for (my $i=0; $i<$depth; $i++) { |
|
$indent.= $whitespace; |
|
} |
|
if (ref($curRes)) { |
|
my $symb = $curRes->symb(); |
|
my $ressymb = $symb; |
|
my $srcf = $curRes->src(); |
|
my $title = &Apache::lonnet::gettitle($srcf); |
|
if (($curRes->is_sequence()) || ($curRes->is_page())) { |
|
next unless($toshow->{$symb}); |
|
my ($parent,$ind,$url) = &Apache::lonnet::decode_symb($symb); |
|
$icon = '<img src="'.$location.'/navmap.folder.open.gif" alt="" />'; |
|
if ($curRes->is_page()) { |
|
$icon = '<img src="'.$location.'/navmap.page.open.gif" alt="" />'; |
|
} |
|
my $rowspan = 1; |
|
if (ref($bymap->{$url}) eq 'HASH') { |
|
$rowspan = scalar(keys(%{$bymap->{$url}})); |
|
} |
|
$r->print(&Apache::loncommon::start_data_table_row(). |
|
'<td rowspan="'.$rowspan.'">'.$indent.$icon.' '.$title.'</td>'); |
|
&releases_by_map($r,$bymap,$url,$scopeorder,$lt); |
|
$r->print(&Apache::loncommon::end_data_table_row()); |
|
} else { |
|
my $rowspan; |
|
if (ref($byresource->{$symb}) eq 'HASH') { |
|
$rowspan += scalar(keys(%{$byresource->{$symb}})); |
|
} |
|
if (ref($bysubmission->{$symb}) eq 'HASH') { |
|
$rowspan += scalar(keys(%{$bysubmission->{$symb}})); |
|
} |
|
if (ref($byresponsetype->{$symb}) eq 'HASH') { |
|
$rowspan += scalar(keys(%{$byresponsetype->{$symb}})); |
|
} |
|
next if (!$rowspan); |
|
$icon = '<img class="LC_contentImage" src="'.$location.'/problem.gif" alt="'. |
|
&mt('Problem').'" />'; |
|
$r->print(&Apache::loncommon::start_data_table_row(). |
|
'<td rowspan="'.$rowspan.'">'.$indent.$icon.' '.$title.'</td>'); |
|
my $newrow; |
|
if (ref($byresource->{$symb}) eq 'HASH') { |
|
foreach my $rev (sort(keys(%{$byresource->{$symb}}))) { |
|
if ($newrow) { |
|
$r->print(&Apache::loncommon::continue_data_table_row()); |
|
} |
|
$r->print('<td valign="middle">'.$rev.'</td><td>'); |
|
if (ref($byresource->{$symb}{$rev}) eq 'HASH') { |
|
$r->print('<table border="0">'); |
|
foreach my $scope (@{$scopeorder}) { |
|
if (ref($byresource->{$symb}{$rev}{$scope}) eq 'HASH') { |
|
$r->print('<tr><td>'.&mt('Setting - scope: [_1]',$lt->{$scope}).'</td>'); |
|
foreach my $which (sort(keys(%{$byresource->{$symb}{$rev}{$scope}}))) { |
|
$r->print('<td>'.$which.'</td><td>'. |
|
join('<br />',@{$byresource->{$symb}{$rev}{$scope}{$which}}). |
|
'</td>'); |
|
} |
|
$r->print('</tr>'); |
|
} elsif (ref($byresource->{$symb}{$rev}{$scope}) eq 'ARRAY') { |
|
$r->print('<tr><td>'.&mt('Setting - scope: [_1]',$lt->{$scope}).'</td>'. |
|
'<td> </td><td>'. |
|
join('<br />',@{$byresource->{$symb}{$rev}{$scope}}).'</td></tr>'); |
|
} |
|
} |
|
$r->print('</table>'); |
|
} |
|
$r->print('</td>'); |
|
$r->print(&Apache::loncommon::end_data_table_row()); |
|
$newrow = 1; |
|
} |
|
} |
|
if (ref($bysubmission->{$symb}) eq 'HASH') { |
|
foreach my $rev (sort(keys(%{$bysubmission->{$symb}}))) { |
|
if ($newrow) { |
|
$r->print(&Apache::loncommon::continue_data_table_row()); |
|
} |
|
$r->print('<td>'.$rev.'</td><td>'); |
|
if (ref($bysubmission->{$symb}{$rev}) eq 'ARRAY') { |
|
$r->print(&mt('Submissions to: ').' '. |
|
join(', ',@{$bysubmission->{$symb}{$rev}})); |
|
} |
|
$r->print('</td>'); |
|
$r->print(&Apache::loncommon::end_data_table_row()); |
|
$newrow = 1; |
|
} |
|
} |
|
if (ref($byresponsetype->{$symb}) eq 'HASH') { |
|
foreach my $rev (sort(keys(%{$byresponsetype->{$symb}}))) { |
|
if ($newrow) { |
|
$r->print(&Apache::loncommon::continue_data_table_row()); |
|
} |
|
$r->print('<td>'.$rev.'</td><td>'); |
|
if (ref($byresponsetype->{$symb}{$rev}) eq 'ARRAY') { |
|
$r->print(&mt('Response Type(s): ').' '. |
|
join('<br />',@{$byresponsetype->{$symb}{$rev}})); |
|
} |
|
$r->print('</td>'); |
|
} |
|
$r->print(&Apache::loncommon::end_data_table_row()); |
|
} |
|
} |
|
} |
|
} |
|
$r->print(&Apache::loncommon::end_data_table()); |
|
} |
|
} |
|
|
|
sub releases_by_map { |
|
my ($r,$bymap,$url,$scopeorder,$lt) = @_; |
|
return unless ((ref($bymap) eq 'HASH') && (ref($scopeorder) eq 'ARRAY')); |
|
if (ref($bymap->{$url}) eq 'HASH') { |
|
foreach my $rev (sort(keys(%{$bymap->{$url}}))) { |
|
$r->print('<td valign="middle">'.$rev.'</td><td>'); |
|
if (ref($bymap->{$url}{$rev}) eq 'HASH') { |
|
$r->print('<table border="0">'); |
|
foreach my $scope (@{$scopeorder}) { |
|
if (ref($bymap->{$url}{$rev}{$scope}) eq 'HASH') { |
|
$r->print('<tr><td>'.&mt('Setting - scope: [_1]',$lt->{$scope}).'</td>'); |
|
foreach my $which (sort(keys(%{$bymap->{$url}{$rev}{$scope}}))) { |
|
$r->print('<td>'.$which.'</td><td>'. |
|
join('<br />',@{$bymap->{$url}{$rev}{$scope}{$which}}). |
|
'</td>'); |
|
} |
|
$r->print('</tr>'); |
|
} elsif (ref($bymap->{$url}{$rev}{$scope}) eq 'ARRAY') { |
|
$r->print('<tr><td>'.&mt('Setting - scope: [_1]',$lt->{$scope}). |
|
'</td><td> </td><td>'. |
|
join('<br />',@{$bymap->{$url}{$rev}{$scope}}).'</td></tr>'); |
|
} |
|
} |
|
$r->print('</table>'); |
|
} |
|
$r->print('</td>'); |
|
} |
|
} else { |
|
$r->print('<td colspan="2"> </td>'); |
|
} |
|
return; |
|
} |
|
|
|
sub get_param_description { |
|
my ($stdtype,$value) = @_; |
|
my $name = $value; |
|
my $paramstrings = &Apache::lonparmset::standard_string_options($stdtype); |
|
unless (ref($paramstrings) eq 'ARRAY') { |
|
return $name; |
|
} |
|
foreach my $possibilities (@{$paramstrings}) { |
|
next unless (ref($possibilities) eq 'ARRAY'); |
|
my ($thing, $description) = @{ $possibilities }; |
|
if ($thing eq $value) { |
|
$name = $description; |
|
last; |
|
} |
|
} |
|
return $name; |
|
} |
|
|
sub show_autocoowners { |
sub show_autocoowners { |
my (@currcoown) = @_; |
my (@currcoown) = @_; |
my $output = '<i>'.&mt('Co-ownership is set automatically when a Course Coordinator role is assigned to official course personnel (from institutional data).').'</i>'; |
my $output = '<i>'.&mt('Co-ownership is set automatically when a Course Coordinator role is assigned to official course personnel (from institutional data).').'</i>'; |
Line 2454 sub print_discussion {
|
Line 3048 sub print_discussion {
|
text => '<b>'.&mt($itemtext->{'allow_discussion_post_editing'}).'</b>', |
text => '<b>'.&mt($itemtext->{'allow_discussion_post_editing'}).'</b>', |
input => 'checkbox', |
input => 'checkbox', |
}, |
}, |
|
'discussion_post_fonts' => { |
|
text => '<b>'.&mt($itemtext->{'discussion_post_fonts'}).'</b>', |
|
input => 'textbox', |
|
size => '20', |
|
}, |
); |
); |
my $datatable; |
my $datatable; |
my $count; |
my $count; |
Line 2493 sub print_discussion {
|
Line 3092 sub print_discussion {
|
&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). |
&Apache::loncommon::end_data_table(); |
&Apache::loncommon::end_data_table(); |
|
} elsif ($item eq 'discussion_post_fonts') { |
|
$datatable .= &Apache::loncommon::start_data_table(). |
|
&Apache::loncommon::start_data_table_row(). |
|
'<th align="center">'.&mt('Sum of likes/dislikes').'</th>'. |
|
'<th align="center">'.&mt('font-size').'</th>'. |
|
'<th align="center">'.&mt('font-weight').'</th>'. |
|
'<th align="center">'.&mt('font-style').'</th>'. |
|
'<th align="center">'.&mt('Other css').'</th>'. |
|
&Apache::loncommon::end_data_table_row(). |
|
&set_discussion_fonts($cdom,$cnum,$item,$settings). |
|
&Apache::loncommon::end_data_table(); |
} |
} |
$datatable .= &item_table_row_end(); |
$datatable .= &item_table_row_end(); |
} |
} |
Line 2556 sub role_checkboxes {
|
Line 3166 sub role_checkboxes {
|
$output .= '<tr>'; |
$output .= '<tr>'; |
} |
} |
} |
} |
$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.'/> '. |
$plrole.'</label></span></td>'; |
$plrole.'</label></span></td>'; |
if ($showsections) { |
if ($showsections) { |
Line 2588 sub role_checkboxes {
|
Line 3198 sub role_checkboxes {
|
$output .= '<tr>'; |
$output .= '<tr>'; |
} |
} |
} |
} |
$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.' /> '.$rolename. |
'</label></span></td>'; |
'</label></span></td>'; |
if ($showsections) { |
if ($showsections) { |
Line 2614 sub role_checkboxes {
|
Line 3224 sub role_checkboxes {
|
return $output; |
return $output; |
} |
} |
|
|
|
sub set_discussion_fonts { |
|
my ($cdom,$cnum,$item,$settings) = @_; |
|
my ($classorder,$classtitles) = &discussion_vote_classes(); |
|
my ($styleorder,$styleitems) = &discussion_vote_styles(); |
|
my $output; |
|
if (ref($classorder) eq 'ARRAY') { |
|
foreach my $cat (@{$classorder}) { |
|
my %curr = (); |
|
($curr{'size'},$curr{'weight'},$curr{'style'},$curr{'other'}) = |
|
split(/,/,$settings->{'discussion_post_fonts_'.$cat}); |
|
$output .= &Apache::loncommon::start_data_table_row(). |
|
'<td>'.$classtitles->{$cat}.'</td>'; |
|
if (ref($styleorder) eq 'ARRAY') { |
|
foreach my $item (@{$styleorder}) { |
|
$output .= '<td><span class="LC_nobreak">'; |
|
my $selitem = $item; |
|
if ($item eq 'size') { |
|
my ($currsize,$currunit); |
|
if ($curr{'size'} =~ /^(\d+)(px|%)$/) { |
|
($currsize,$currunit) = ($1,$2); |
|
$curr{'size'} = $currunit; |
|
} |
|
$output .= '<input type="textbox" name="discussion_post_fonts_'.$cat.'_'.$item.'" value="'.$currsize.'" size="5">'. |
|
' '; |
|
$selitem = 'unit'; |
|
} |
|
if ((ref($styleitems) eq 'HASH') && (ref($styleitems->{$item}) eq 'ARRAY')) { |
|
$output .= '<select name="discussion_post_fonts_'.$cat.'_'.$selitem.'">'; |
|
foreach my $val (@{$styleitems->{$item}}) { |
|
my $sel; |
|
if ($val eq $curr{$item}) { |
|
$sel = ' selected="selected"'; |
|
} |
|
$output .= '<option value="'.$val.'"'.$sel.'>'.$val.'</option>'; |
|
} |
|
} |
|
} |
|
} |
|
$output .= '</span></td><td><input type="textbox" size="10" name="discussion_post_fonts_'.$cat.'_other" value="'.$curr{'other'}.'" /></td>'; |
|
} |
|
$output .= &Apache::loncommon::end_data_table_row(); |
|
} |
|
return $output; |
|
} |
|
|
|
sub discussion_vote_classes { |
|
my $classorder = ['twoplus','oneplus','zero','oneminus','twominus']; |
|
my %classtitles = &Apache::lonlocal::texthash( |
|
'twoplus' => 'Two sigma above mean', |
|
'oneplus' => 'One sigma above mean', |
|
'zero' => 'Within one sigma of mean', |
|
'oneminus' => 'One sigma below mean', |
|
'twominus' => 'Two sigma below mean', |
|
); |
|
return ($classorder,\%classtitles); |
|
} |
|
|
|
sub discussion_vote_styles { |
|
my $styleorder = ['size','weight','style']; |
|
my $styleitems = { |
|
size => ['','px','%','xx-small','x-small','small','medium','large', |
|
'x-large','xx-large','smaller','larger'], |
|
weight => ['','normal','bold','bolder','lighter','100','200','300','400', |
|
'500','600','700','800','900'], |
|
style => ['','normal','italic','oblique'], |
|
}; |
|
return ($styleorder,$styleitems); |
|
} |
|
|
sub print_classlists { |
sub print_classlists { |
my ($position,$cdom,$settings,$itemtext,$rowtotal,$crstype) = @_; |
my ($position,$cdom,$settings,$itemtext,$rowtotal,$crstype) = @_; |
my @ordered; |
my @ordered; |
if ($position eq 'top') { |
if ($position eq 'top') { |
@ordered = ('default_enrollment_start_date', |
@ordered = ('default_enrollment_start_date', |
'default_enrollment_end_date'); |
'default_enrollment_end_date'); |
|
if ($crstype eq 'Course') { |
|
push(@ordered,'defaultcredits'); |
|
} |
} elsif ($position eq 'middle') { |
} elsif ($position eq 'middle') { |
@ordered = ('nothideprivileged'); |
@ordered = ('nothideprivileged'); |
} else { |
} else { |
@ordered = ('student_classlist_view', |
@ordered = ('student_classlist_view', |
'student_opt_in','student_classlist_portfiles'); |
'student_classlist_opt_in', |
|
'student_classlist_portfiles'); |
} |
} |
my %lt; |
my %lt; |
|
|
Line 2663 sub print_classlists {
|
Line 3346 sub print_classlists {
|
options => \%lt, |
options => \%lt, |
order => ['disabled','all','section'], |
order => ['disabled','all','section'], |
}, |
}, |
'student_opt_in' => { |
'student_classlist_opt_in' => { |
text => '<b>'.&mt($itemtext->{'student_opt_in'}).'</b>', |
text => '<b>'.&mt($itemtext->{'student_classlist_opt_in'}).'</b>', |
input => 'radio', |
input => 'radio', |
}, |
}, |
|
|
Line 2762 sub print_grading {
|
Line 3445 sub print_grading {
|
'64bit5' => '64bit5', |
'64bit5' => '64bit5', |
}, |
}, |
order => ['32bit','64bit','64bit2','64bit3','64bit4','64bit5'], |
order => ['32bit','64bit','64bit2','64bit3','64bit4','64bit5'], |
|
advanced => 1 |
}, |
}, |
'receiptalg' => { |
'receiptalg' => { |
text => '<b>'.&mt($itemtext->{'receiptalg'}).'</b><br />'. |
text => '<b>'.&mt($itemtext->{'receiptalg'}).'</b><br />'. |
Line 2773 sub print_grading {
|
Line 3457 sub print_grading {
|
receipt3 => 'receipt3', |
receipt3 => 'receipt3', |
}, |
}, |
order => ['receipt','receipt2','receipt3'], |
order => ['receipt','receipt2','receipt3'], |
|
advanced => 1 |
}, |
}, |
'disablesigfigs' => { |
'disablesigfigs' => { |
text => '<b>'.&mt($itemtext->{'disablesigfigs'}).'</b>', |
text => '<b>'.&mt($itemtext->{'disablesigfigs'}).'</b>', |
Line 2811 sub print_printouts {
|
Line 3496 sub print_printouts {
|
A6 => &mt('A6').' [105x148 mm]', |
A6 => &mt('A6').' [105x148 mm]', |
}, |
}, |
order => ['Letter','Legal','Tabloid','Executive','A2','A3','A4','A5','A6'], |
order => ['Letter','Legal','Tabloid','Executive','A2','A3','A4','A5','A6'], |
nullval => 'None specified', |
nullval => &mt('None specified'), |
}, |
}, |
print_header_format => { |
print_header_format => { |
text => '<b>'.&mt($itemtext->{'print_header_format'}).'</b>', |
text => '<b>'.&mt($itemtext->{'print_header_format'}).'</b>', |
Line 2829 sub print_printouts {
|
Line 3514 sub print_printouts {
|
0 => &mt('No'), |
0 => &mt('No'), |
}, |
}, |
order => ['1','0'], |
order => ['1','0'], |
nullval => 'None specified - use domain default', |
nullval => &mt('None specified - use domain default'), |
} |
} |
); |
); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype); |
return &make_item_rows($cdom,\%items,$ordered,$settings,$rowtotal,$crstype); |
Line 2952 sub get_other_items {
|
Line 3637 sub get_other_items {
|
unless (($parameter =~ m/^internal\./)||($parameter =~ m/^metadata\./) || |
unless (($parameter =~ m/^internal\./)||($parameter =~ m/^metadata\./) || |
($parameter =~ m/^selfenroll_/) || ($parameter =~ /_selfenroll$/) |
($parameter =~ m/^selfenroll_/) || ($parameter =~ /_selfenroll$/) |
|| ($parameter eq 'type') || |
|| ($parameter eq 'type') || |
($parameter =~ m/^(cc|co|in|ta|ep|ad|st)\.plaintext$/)) { |
($parameter =~ m/^(cc|co|in|ta|ep|ad|st)\.plaintext$/) |
|
|| ($parameter =~ m/^discussion_post_fonts/)) { |
push(@ordered,$parameter); |
push(@ordered,$parameter); |
} |
} |
} |
} |
Line 3044 sub make_item_rows {
|
Line 3730 sub make_item_rows {
|
my $count = 0; |
my $count = 0; |
foreach my $item (@{$ordered}) { |
foreach my $item (@{$ordered}) { |
$count ++; |
$count ++; |
$datatable .= &item_table_row_start($items->{$item}{text},$count); |
if (exists $items->{$item}{advanced} && $items->{$item}{advanced} == 1) { |
if ($item eq 'nothideprivileged') { |
$datatable .= &item_table_row_start($items->{$item}{text},$count,"advanced"); |
|
} else { |
|
$datatable .= &item_table_row_start($items->{$item}{text},$count); |
|
} |
|
if ($item eq 'defaultcredits') { |
|
my $defaultcredits = $env{'course.'.$env{'request.course.id'}.'.internal.defaultcredits'}; |
|
my $showcredits; |
|
if ($defaultcredits ne '') { |
|
$showcredits = &mt('Default is [quant,_1,credit]',$defaultcredits); |
|
} else { |
|
$showcredits = &mt('No default set'); |
|
} |
|
$datatable .= $showcredits; |
|
} elsif ($item eq 'nothideprivileged') { |
$datatable .= ¬hidepriv_row($cdom,$item,$settings,$crstype); |
$datatable .= ¬hidepriv_row($cdom,$item,$settings,$crstype); |
} elsif ($item eq 'print_header_format') { |
} elsif ($item eq 'print_header_format') { |
$datatable .= &print_hdrfmt_row($item,$settings); |
$datatable .= &print_hdrfmt_row($item,$settings); |
Line 3300 sub substitution_selector {
|
Line 3999 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.'">'; |
if ($subst eq '') { |
if ($subst eq '') { |
$output .= '<option value="" selected="selected"> </option>'; |
$output .= '<option value="" selected="selected"> </option>'; |
} |
} |