version 1.430, 2023/11/03 01:12:15
|
version 1.439, 2024/04/17 01:02:47
|
Line 386 sub handler {
|
Line 386 sub handler {
|
help => 'Domain_Configuration_Quotas', |
help => 'Domain_Configuration_Quotas', |
header => [{col1 => 'User affiliation', |
header => [{col1 => 'User affiliation', |
col2 => 'Available tools', |
col2 => 'Available tools', |
col3 => 'Portfilo quota (MB)',}], |
col3 => 'Portfolio quota (MB)',}], |
print => \&print_quotas, |
print => \&print_quotas, |
modify => \&modify_quotas, |
modify => \&modify_quotas, |
}, |
}, |
Line 669 sub handler {
|
Line 669 sub handler {
|
col2 => 'Settings'}, |
col2 => 'Settings'}, |
{col1 => 'Rules for shared secrets', |
{col1 => 'Rules for shared secrets', |
col2 => 'Settings'}, |
col2 => 'Settings'}, |
|
{col1 => 'Link Protectors in Courses', |
|
col2 => 'Values'}, |
{col1 => 'Link Protectors', |
{col1 => 'Link Protectors', |
col2 => 'Settings'}, |
col2 => 'Settings'}, |
{col1 => 'Consumers', |
{col1 => 'Consumers', |
Line 684 sub handler {
|
Line 686 sub handler {
|
print => \&print_ipaccess, |
print => \&print_ipaccess, |
modify => \&modify_ipaccess, |
modify => \&modify_ipaccess, |
}, |
}, |
'authordefaults' => |
'authordefaults' => |
{text => 'Authoring Space defaults', |
{text => 'Authoring Space defaults', |
help => 'Domain_Configuration_Author_Defaults', |
help => 'Domain_Configuration_Author_Defaults', |
header => [{col1 => 'Defaults which can be overridden by Author', |
header => [{col1 => 'Defaults which can be overridden by Author', |
Line 1037 sub print_config_box {
|
Line 1039 sub print_config_box {
|
$output .= $item->{'print'}->('shared',$dom,$settings,\$rowtotal); |
$output .= $item->{'print'}->('shared',$dom,$settings,\$rowtotal); |
} elsif ($action eq 'passwords') { |
} elsif ($action eq 'passwords') { |
$output .= $item->{'print'}->('middle',$dom,$confname,$settings,\$rowtotal); |
$output .= $item->{'print'}->('middle',$dom,$confname,$settings,\$rowtotal); |
|
} elsif ($action eq 'lti') { |
|
$output .= $item->{'print'}->('upper',$dom,$settings,\$rowtotal).' |
|
</table> |
|
</td> |
|
</tr> |
|
<tr> |
|
<td> |
|
<table class="LC_nested"> |
|
<tr class="LC_info_row"> |
|
<td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col1'}).'</td> |
|
<td class="LC_right_item">'.&mt($item->{'header'}->[2]->{'col2'}).'</td> |
|
</tr>'."\n". |
|
$item->{'print'}->('middle',$dom,$settings,\$rowtotal); |
} else { |
} else { |
$output .= $item->{'print'}->('middle',$dom,$settings,\$rowtotal); |
$output .= $item->{'print'}->('middle',$dom,$settings,\$rowtotal); |
} |
} |
Line 1069 sub print_config_box {
|
Line 1084 sub print_config_box {
|
<td class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[8]->{'col2'}).'</td></tr>'. |
<td class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[8]->{'col2'}).'</td></tr>'. |
$item->{'print'}->('bottom',$dom,$settings,\$rowtotal); |
$item->{'print'}->('bottom',$dom,$settings,\$rowtotal); |
} else { |
} else { |
|
my $hdridx = 2; |
|
if ($action eq 'lti') { |
|
$hdridx = 3; |
|
} |
$output .= ' |
$output .= ' |
</table> |
</table> |
</td> |
</td> |
Line 1077 sub print_config_box {
|
Line 1096 sub print_config_box {
|
<td> |
<td> |
<table class="LC_nested"> |
<table class="LC_nested"> |
<tr class="LC_info_row"> |
<tr class="LC_info_row"> |
<td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col1'}).'</td> |
<td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[$hdridx]->{'col1'}).'</td> |
<td class="LC_right_item">'.&mt($item->{'header'}->[2]->{'col2'}).'</td> |
<td class="LC_right_item">'.&mt($item->{'header'}->[$hdridx]->{'col2'}).'</td> |
</tr>'."\n"; |
</tr>'."\n"; |
if ($action eq 'coursecategories') { |
if ($action eq 'coursecategories') { |
$output .= &print_coursecategories('bottom',$dom,$item,$settings,\$rowtotal); |
$output .= &print_coursecategories('bottom',$dom,$item,$settings,\$rowtotal); |
Line 1089 sub print_config_box {
|
Line 1108 sub print_config_box {
|
} else { |
} else { |
$output .= $item->{'print'}->('lower',$dom,$settings,\$rowtotal); |
$output .= $item->{'print'}->('lower',$dom,$settings,\$rowtotal); |
} |
} |
|
$hdridx ++; |
$output .= ' |
$output .= ' |
</tr> |
</tr> |
</table> |
</table> |
Line 1098 sub print_config_box {
|
Line 1118 sub print_config_box {
|
<td> |
<td> |
<table class="LC_nested"> |
<table class="LC_nested"> |
<tr class="LC_info_row"> |
<tr class="LC_info_row"> |
<td class="LC_left_item'.$leftnobr.'"'.$colspan.'>'.&mt($item->{'header'}->[3]->{'col1'}).'</td> |
<td class="LC_left_item'.$leftnobr.'"'.$colspan.'>'.&mt($item->{'header'}->[$hdridx]->{'col1'}).'</td> |
<td class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[3]->{'col2'}).'</td></tr>'."\n"; |
<td class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[$hdridx]->{'col2'}).'</td></tr>'."\n"; |
if ($action eq 'passwords') { |
if ($action eq 'passwords') { |
$output .= $item->{'print'}->('bottom',$dom,$confname,$settings,\$rowtotal); |
$output .= $item->{'print'}->('bottom',$dom,$confname,$settings,\$rowtotal); |
} else { |
} else { |
Line 6176 sub print_lti {
|
Line 6196 sub print_lti {
|
my ($position,$dom,$settings,$rowtotal) = @_; |
my ($position,$dom,$settings,$rowtotal) = @_; |
my $itemcount = 1; |
my $itemcount = 1; |
my ($datatable,$css_class); |
my ($datatable,$css_class); |
my (%rules,%encrypt,%privkeys,%linkprot); |
my (%rules,%encrypt,%privkeys,%linkprot,%suggestions); |
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
if ($position eq 'top') { |
if ($position eq 'top') { |
if (exists($settings->{'encrypt'})) { |
if (exists($settings->{'encrypt'})) { |
Line 6199 sub print_lti {
|
Line 6219 sub print_lti {
|
} |
} |
} |
} |
} |
} |
} elsif ($position eq 'middle') { |
} elsif ($position eq 'upper') { |
if (exists($settings->{'rules'})) { |
if (exists($settings->{'rules'})) { |
if (ref($settings->{'rules'}) eq 'HASH') { |
if (ref($settings->{'rules'}) eq 'HASH') { |
%rules = %{$settings->{'rules'}}; |
%rules = %{$settings->{'rules'}}; |
} |
} |
} |
} |
|
} elsif ($position eq 'middle') { |
|
if (exists($settings->{'suggested'})) { |
|
if (ref($settings->{'suggested'}) eq 'HASH') { |
|
%suggestions = %{$settings->{'suggested'}}; |
|
} |
|
} |
} elsif ($position eq 'lower') { |
} elsif ($position eq 'lower') { |
if (exists($settings->{'linkprot'})) { |
if (exists($settings->{'linkprot'})) { |
if (ref($settings->{'linkprot'}) eq 'HASH') { |
if (ref($settings->{'linkprot'}) eq 'HASH') { |
Line 6215 sub print_lti {
|
Line 6241 sub print_lti {
|
} |
} |
} |
} |
} else { |
} else { |
foreach my $key ('encrypt','private','rules','linkprot') { |
foreach my $key ('encrypt','private','rules','linkprot','suggestions') { |
if (exists($settings->{$key})) { |
if (exists($settings->{$key})) { |
delete($settings->{$key}); |
delete($settings->{$key}); |
} |
} |
Line 6224 sub print_lti {
|
Line 6250 sub print_lti {
|
} |
} |
if ($position eq 'top') { |
if ($position eq 'top') { |
$datatable = &secrets_form($dom,'ltisec',\%encrypt,\%privkeys,$rowtotal); |
$datatable = &secrets_form($dom,'ltisec',\%encrypt,\%privkeys,$rowtotal); |
} elsif ($position eq 'middle') { |
} elsif ($position eq 'upper') { |
$datatable = &password_rules('ltisecrets',\$itemcount,\%rules); |
$datatable = &password_rules('ltisecrets',\$itemcount,\%rules); |
$$rowtotal += $itemcount; |
$$rowtotal += $itemcount; |
|
} elsif ($position eq 'middle') { |
|
$datatable = &linkprot_suggestions(\%suggestions,\$itemcount); |
|
$$rowtotal += $itemcount; |
} elsif ($position eq 'lower') { |
} elsif ($position eq 'lower') { |
$datatable .= &Apache::courseprefs::print_linkprotection($dom,'',$settings,$rowtotal,'','','domain'); |
$datatable .= &Apache::courseprefs::print_linkprotection($dom,'',$settings,$rowtotal,'','','domain'); |
} else { |
} else { |
my ($switchserver,$switchmessage); |
my ($switchserver,$switchmessage); |
$switchserver = &check_switchserver($dom); |
$switchserver = &check_switchserver($dom); |
Line 6815 sub ltimenu_titles {
|
Line 6844 sub ltimenu_titles {
|
); |
); |
} |
} |
|
|
|
sub linkprot_suggestions { |
|
my ($suggested,$itemcount) = @_; |
|
my $count = 0; |
|
my $next = 1; |
|
my %lt = &Apache::lonlocal::texthash( |
|
'name' => 'Suggested Launcher', |
|
'info' => 'Recommendations', |
|
); |
|
my ($datatable,$css_class,$dest); |
|
if (ref($suggested) eq 'HASH') { |
|
my @current = sort { $a <=> $b } keys(%{$suggested}); |
|
$next += $current[-1]; |
|
for (my $i=0; $i<@current; $i++) { |
|
my $num = $current[$i]; |
|
my %values; |
|
if (ref($suggested->{$num}) eq 'HASH') { |
|
%values = %{$suggested->{$num}}; |
|
} else { |
|
next; |
|
} |
|
$css_class = $$itemcount%2?' class="LC_odd_row"':''; |
|
$datatable .= |
|
'<tr '.$css_class.'><td><span class="LC_nobreak">'."\n". |
|
'<label><input type="checkbox" name="linkprot_suggested_del" value="'.$i.'" />'."\n". |
|
&mt('Delete?').'</label></span></td><td>'."\n". |
|
'<div class="LC_floatleft"><fieldset><legend>'.$lt{'name'}.'</legend>'."\n". |
|
'<input type="text" size="15" name="linkprot_suggested_name_'.$i.'" value="'.$values{'name'}.'" autocomplete="off" />'."\n". |
|
'</fieldset></div>'. |
|
'<div class="LC_floatleft"><fieldset><legend>'.$lt{'info'}.'</legend>'."\n". |
|
'<textarea cols="55" rows="5" name="linkprot_suggested_info_'.$i.'">'.$values{'info'}.'</textarea>'. |
|
'</fieldset></div>'. |
|
'<div style="padding:0;clear:both;margin:0;border:0"></div>'."\n". |
|
'<input type="hidden" name="linkprot_suggested_id_'.$i.'" value="'.$num.'" /></td></tr>'."\n"; |
|
$$itemcount ++; |
|
} |
|
} |
|
$css_class = $$itemcount%2?' class="LC_odd_row"':''; |
|
$datatable .= '<tr '.$css_class.'><td><span class="LC_nobreak">'."\n". |
|
'<input type="hidden" name="linkprot_suggested_maxnum" value="'.$next.'" />'."\n". |
|
'<input type="checkbox" name="linkprot_suggested_add" value="1" />'.&mt('Add').'</span></td>'."\n". |
|
'<td>'."\n". |
|
'<div class="LC_floatleft"><fieldset><legend>'.$lt{'name'}.'</legend>'."\n". |
|
'<input type="text" size="15" name="linkprot_suggested_name_add" value="" autocomplete="off" />'."\n". |
|
'</fieldset></div>'. |
|
'<div class="LC_floatleft"><fieldset><legend>'.$lt{'info'}.'</legend>'."\n". |
|
'<textarea cols="55" rows="5" name="linkprot_suggested_info_add"></textarea>'. |
|
'</fieldset></div>'. |
|
'<div style="padding:0;clear:both;margin:0;border:0"></div>'."\n". |
|
'</td></tr>'."\n"; |
|
return $datatable; |
|
} |
|
|
sub print_coursedefaults { |
sub print_coursedefaults { |
my ($position,$dom,$settings,$rowtotal) = @_; |
my ($position,$dom,$settings,$rowtotal) = @_; |
my ($css_class,$datatable,%checkedon,%checkedoff,%defaultchecked,@toggles); |
my ($css_class,$datatable,%checkedon,%checkedoff,%defaultchecked,@toggles); |
Line 6822 sub print_coursedefaults {
|
Line 6903 sub print_coursedefaults {
|
my %choices = &Apache::lonlocal::texthash ( |
my %choices = &Apache::lonlocal::texthash ( |
canuse_pdfforms => 'Course/Community users can create/upload PDF forms', |
canuse_pdfforms => 'Course/Community users can create/upload PDF forms', |
uploadquota => 'Default quota for files uploaded directly to course/community using Course Editor (MB)', |
uploadquota => 'Default quota for files uploaded directly to course/community using Course Editor (MB)', |
coursequota => 'Default cumulative quota for all group portfolio spaces in course', |
coursequota => 'Default cumulative quota for all group portfolio spaces in course (MB)', |
anonsurvey_threshold => 'Responder count needed before showing submissions for anonymous surveys', |
anonsurvey_threshold => 'Responder count needed before showing submissions for anonymous surveys', |
coursecredits => 'Credits can be specified for courses', |
coursecredits => 'Credits can be specified for courses', |
uselcmath => 'Math preview uses LON-CAPA previewer (javascript) in place of DragMath (Java)', |
uselcmath => 'Math preview uses LON-CAPA previewer (javascript) in place of DragMath (Java)', |
Line 6835 sub print_coursedefaults {
|
Line 6916 sub print_coursedefaults {
|
ltiauth => 'Student username in LTI launch of deep-linked URL can be accepted without re-authentication', |
ltiauth => 'Student username in LTI launch of deep-linked URL can be accepted without re-authentication', |
domexttool => 'External Tools defined in the domain may be used in courses/communities (by type)', |
domexttool => 'External Tools defined in the domain may be used in courses/communities (by type)', |
exttool => 'External Tools can be defined and configured in courses/communities (by type)', |
exttool => 'External Tools can be defined and configured in courses/communities (by type)', |
|
crsauthor => 'Standard LON-CAPA problems can be created within a course/community (by type)', |
|
crseditors => 'Available editors for web pages and/or problems created in a course/community', |
); |
); |
my %staticdefaults = ( |
my %staticdefaults = ( |
anonsurvey_threshold => 10, |
anonsurvey_threshold => 10, |
Line 6844 sub print_coursedefaults {
|
Line 6927 sub print_coursedefaults {
|
mysqltables => 172800, |
mysqltables => 172800, |
domexttool => 1, |
domexttool => 1, |
exttool => 0, |
exttool => 0, |
|
crsauthor => 1, |
|
crseditors => ['edit','xml'], |
); |
); |
if ($position eq 'top') { |
if ($position eq 'top') { |
%defaultchecked = ( |
%defaultchecked = ( |
Line 6964 sub print_coursedefaults {
|
Line 7049 sub print_coursedefaults {
|
my $ltiauth = 0; |
my $ltiauth = 0; |
my %domexttool; |
my %domexttool; |
my %exttool; |
my %exttool; |
|
my %crsauthor; |
|
my %crseditors; |
my @types = ('official','unofficial','community','textbook','placement'); |
my @types = ('official','unofficial','community','textbook','placement'); |
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
if ($settings->{'ltiauth'}) { |
if ($settings->{'ltiauth'}) { |
Line 6989 sub print_coursedefaults {
|
Line 7076 sub print_coursedefaults {
|
} |
} |
} |
} |
} |
} |
|
if (ref($settings->{'crsauthor'}) eq 'HASH') { |
|
foreach my $type (@types) { |
|
if ($settings->{'crsauthor'}->{$type}) { |
|
$crsauthor{$type} = ' checked="checked"'; |
|
} |
|
} |
|
} else { |
|
foreach my $type (@types) { |
|
if ($staticdefaults{'crsauthor'}) { |
|
$crsauthor{$type} = ' checked="checked"'; |
|
} |
|
} |
|
} |
|
if (ref($settings->{'crseditors'}) eq 'ARRAY') { |
|
foreach my $editor (@{$settings->{'crseditors'}}) { |
|
$crseditors{$editor} = ' checked="checked"'; |
|
} |
|
} else { |
|
foreach my $editor (@{$staticdefaults{'crseditors'}}) { |
|
$crseditors{$editor} = ' checked="checked"'; |
|
} |
|
} |
$currdefresponder = $settings->{'anonsurvey_threshold'}; |
$currdefresponder = $settings->{'anonsurvey_threshold'}; |
if (ref($settings->{'uploadquota'}) eq 'HASH') { |
if (ref($settings->{'uploadquota'}) eq 'HASH') { |
foreach my $type (keys(%{$settings->{'uploadquota'}})) { |
foreach my $type (keys(%{$settings->{'uploadquota'}})) { |
Line 7048 sub print_coursedefaults {
|
Line 7157 sub print_coursedefaults {
|
if ($staticdefaults{'domexttool'}) { |
if ($staticdefaults{'domexttool'}) { |
$domexttool{$type} = ' checked="checked"'; |
$domexttool{$type} = ' checked="checked"'; |
} |
} |
|
if ($staticdefaults{'crsauthor'}) { |
|
$crsauthor{$type} = ' checked="checked"'; |
|
} |
|
} |
|
foreach my $editor (@{$staticdefaults{'crseditors'}}) { |
|
$crseditors{$editor} = ' checked="checked"'; |
} |
} |
} |
} |
if (!$currdefresponder) { |
if (!$currdefresponder) { |
Line 7176 sub print_coursedefaults {
|
Line 7291 sub print_coursedefaults {
|
foreach my $type (@types) { |
foreach my $type (@types) { |
$datatable .= '<td style="text-align: left">'. |
$datatable .= '<td style="text-align: left">'. |
'<span class="LC_nobreak">'. |
'<span class="LC_nobreak">'. |
'<input type="checkbox" name="domexttool"'. |
'<label><input type="checkbox" name="domexttool"'. |
' value="'.$type.'"'.$domexttool{$type}.' />'. |
' value="'.$type.'"'.$domexttool{$type}.' />'. |
&mt($type).'</span></td>'."\n"; |
&mt($type).'</label></span></td>'."\n"; |
} |
} |
$datatable .= '</tr></table></td></tr>'."\n"; |
$datatable .= '</tr></table></td></tr>'."\n"; |
$itemcount ++; |
$itemcount ++; |
Line 7191 sub print_coursedefaults {
|
Line 7306 sub print_coursedefaults {
|
foreach my $type (@types) { |
foreach my $type (@types) { |
$datatable .= '<td style="text-align: left">'. |
$datatable .= '<td style="text-align: left">'. |
'<span class="LC_nobreak">'. |
'<span class="LC_nobreak">'. |
'<input type="checkbox" name="exttool"'. |
'<label><input type="checkbox" name="exttool"'. |
' value="'.$type.'"'.$exttool{$type}.' />'. |
' value="'.$type.'"'.$exttool{$type}.' />'. |
&mt($type).'</span></td>'."\n"; |
&mt($type).'</label></span></td>'."\n"; |
|
} |
|
$datatable .= '</tr></table></td></tr>'."\n"; |
|
$itemcount ++; |
|
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : ''; |
|
$datatable .= '<tr'.$css_class.'><td><span class="LC_nobreak">'. |
|
$choices{'crsauthor'}. |
|
'</span></td>'. |
|
'<td style="text-align: right" class="LC_right_item">'. |
|
'<table><tr>'; |
|
foreach my $type (@types) { |
|
$datatable .= '<td style="text-align: left">'. |
|
'<span class="LC_nobreak">'. |
|
'<label><input type="checkbox" name="crsauthor"'. |
|
' value="'.$type.'"'.$crsauthor{$type}.' />'. |
|
&mt($type).'</label></span></td>'."\n"; |
|
} |
|
$datatable .= '</tr></table></td></tr>'."\n"; |
|
$itemcount ++; |
|
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : ''; |
|
$datatable .= '<tr'.$css_class.'><td><span class="LC_nobreak">'. |
|
$choices{'crseditors'}. |
|
'</span></td>'. |
|
'<td style="text-align: right" class="LC_right_item">'. |
|
'<table><tr>'; |
|
my @editors = ('edit','xml','daxe'); |
|
my %editornames = &crseditor_titles(); |
|
foreach my $editor (@editors) { |
|
$datatable .= '<td style="text-align: left">'. |
|
'<span class="LC_nobreak">'. |
|
'<label><input type="checkbox" name="crseditors"'. |
|
' value="'.$editor.'"'.$crseditors{$editor}.' />'. |
|
$editornames{$editor}.'</label></span></td>'."\n"; |
} |
} |
$datatable .= '</tr></table></td></tr>'."\n"; |
$datatable .= '</tr></table></td></tr>'."\n"; |
} |
} |
Line 7201 sub print_coursedefaults {
|
Line 7348 sub print_coursedefaults {
|
return $datatable; |
return $datatable; |
} |
} |
|
|
|
sub crseditor_titles { |
|
return &Apache::lonlocal::texthash( |
|
edit => 'Standard editor (Edit)', |
|
xml => 'Text editor (EditXML)', |
|
daxe => 'Daxe editor (Daxe)', |
|
); |
|
} |
|
|
sub print_authordefaults { |
sub print_authordefaults { |
my ($position,$dom,$settings,$rowtotal) = @_; |
my ($position,$dom,$settings,$rowtotal) = @_; |
my ($css_class,$datatable,%checkedon,%checkedoff); |
my ($css_class,$datatable,%checkedon,%checkedoff); |
Line 7209 sub print_authordefaults {
|
Line 7364 sub print_authordefaults {
|
if ($position eq 'top') { |
if ($position eq 'top') { |
my %defaultchecked = ( |
my %defaultchecked = ( |
'nocodemirror' => 'off', |
'nocodemirror' => 'off', |
|
'daxecollapse' => 'off', |
'domcoordacc' => 'on', |
'domcoordacc' => 'on', |
); |
); |
my @toggles = ('nocodemirror','domcoordacc'); |
my @toggles = ('nocodemirror','daxecollapse','domcoordacc'); |
($datatable,$itemcount) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked, |
($datatable,$itemcount) = &radiobutton_prefs($settings,\@toggles,\%defaultchecked, |
\%titles,$itemcount); |
\%titles,$itemcount); |
my %staticdefaults = ( |
my %staticdefaults = ( |
Line 7330 sub print_authordefaults {
|
Line 7486 sub print_authordefaults {
|
my $checkedno = ' checked="checked"'; |
my $checkedno = ' checked="checked"'; |
my ($checkedon,$checkedoff); |
my ($checkedon,$checkedoff); |
if (ref($quotas{'webdav'}) eq 'HASH') { |
if (ref($quotas{'webdav'}) eq 'HASH') { |
if ($quotas{'webdav'}{'_LC_adv'} =~ /^0|1$/) { |
if ($quotas{'webdav'}{'_LC_adv'} =~ /^0|1$/) { |
if ($quotas{'webdav'}{'_LC_adv'}) { |
if ($quotas{'webdav'}{'_LC_adv'}) { |
$checkedon = $checkedno; |
$checkedon = $checkedno; |
} else { |
} else { |
Line 7359 sub print_authordefaults {
|
Line 7515 sub print_authordefaults {
|
$text = $titles{'overon'}; |
$text = $titles{'overon'}; |
$val = 1; |
$val = 1; |
$checked = $checkedon; |
$checked = $checkedon; |
} |
} |
$datatable .= '<span class="LC_nobreak"><label>'. |
$datatable .= '<span class="LC_nobreak"><label>'. |
'<input type="radio" name="webdav_LC_adv"'. |
'<input type="radio" name="webdav_LC_adv"'. |
' value="'.$val.'"'.$checked.' />'. |
' value="'.$val.'"'.$checked.' />'. |
Line 7380 sub authordefaults_titles {
|
Line 7536 sub authordefaults_titles {
|
webdav => 'WebDAV', |
webdav => 'WebDAV', |
authorquota => 'Authoring Space quotas (MB)', |
authorquota => 'Authoring Space quotas (MB)', |
nocodemirror => 'Deactivate CodeMirror for EditXML editor', |
nocodemirror => 'Deactivate CodeMirror for EditXML editor', |
|
daxecollapse => 'Daxe editor: LON-CAPA standard menus start collapsed', |
domcoordacc => 'Dom. Coords. can enter Authoring Spaces in domain', |
domcoordacc => 'Dom. Coords. can enter Authoring Spaces in domain', |
edit => 'Standard editor (Edit)', |
edit => 'Standard editor (Edit)', |
xml => 'Text editor (EditXML)', |
xml => 'Text editor (EditXML)', |
Line 7388 sub authordefaults_titles {
|
Line 7545 sub authordefaults_titles {
|
webdav_LC_adv_over => '(overrides access based on affiliation, if set)', |
webdav_LC_adv_over => '(overrides access based on affiliation, if set)', |
none => 'No override set', |
none => 'No override set', |
overon => 'Override -- webDAV on', |
overon => 'Override -- webDAV on', |
overoff => 'Override -- webDAV off', |
overoff => 'Override -- webDAV off', |
); |
); |
} |
} |
|
|
Line 8335 sub print_wafproxy {
|
Line 8492 sub print_wafproxy {
|
my $dom_in_effect; |
my $dom_in_effect; |
my $aliasrows = '<tr>'. |
my $aliasrows = '<tr>'. |
'<td class="LC_left_item" style="vertical-align: baseline;">'. |
'<td class="LC_left_item" style="vertical-align: baseline;">'. |
&mt('Hostname').': '. |
&mt('Hostname').': '. |
'<i>'.&Apache::lonnet::hostname($server).'</i></td><td> </td>'; |
'<span class="LC_nobreak LC_cusr_emph">'. |
|
&Apache::lonnet::hostname($server). |
|
'</span></td><td> </td>'; |
if ($othercontrol{$server}) { |
if ($othercontrol{$server}) { |
$dom_in_effect = $othercontrol{$server}; |
$dom_in_effect = $othercontrol{$server}; |
my ($current,$forsaml); |
my ($current,$forsaml); |
Line 13264 sub modify_authordefaults {
|
Line 13423 sub modify_authordefaults {
|
'copyright' => 'default', |
'copyright' => 'default', |
'sourceavail' => 'closed', |
'sourceavail' => 'closed', |
'nocodemirror' => 'off', |
'nocodemirror' => 'off', |
|
'daxecollapse' => 'off', |
'domcoordacc' => 'on', |
'domcoordacc' => 'on', |
'editors' => ['edit','xml']. |
'editors' => ['edit','xml'], |
'authorquota' => 500, |
'authorquota' => 500, |
'webdav' => 0, |
'webdav' => 0, |
); |
); |
my %titles = &authordefaults_titles(); |
my %titles = &authordefaults_titles(); |
foreach my $item ('nocodemirror','domcoordacc') { |
foreach my $item ('nocodemirror','daxecollapse','domcoordacc') { |
if ($env{'form.'.$item} =~ /^(0|1)$/) { |
if ($env{'form.'.$item} =~ /^(0|1)$/) { |
$confhash{$item} = $env{'form.'.$item}; |
$confhash{$item} = $env{'form.'.$item}; |
} |
} |
Line 13290 sub modify_authordefaults {
|
Line 13450 sub modify_authordefaults {
|
} |
} |
} |
} |
$confhash{'editors'} = \@editors; |
$confhash{'editors'} = \@editors; |
|
|
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); |
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); |
my @insttypes; |
my @insttypes; |
if (ref($types) eq 'ARRAY') { |
if (ref($types) eq 'ARRAY') { |
Line 13314 sub modify_authordefaults {
|
Line 13474 sub modify_authordefaults {
|
$save_quotas{'webdav'}{'_LC_adv'} = $env{'form.webdav_LC_adv'}; |
$save_quotas{'webdav'}{'_LC_adv'} = $env{'form.webdav_LC_adv'}; |
} |
} |
if (ref($domconfig{'authordefaults'}) eq 'HASH') { |
if (ref($domconfig{'authordefaults'}) eq 'HASH') { |
foreach my $item ('nocodemirror','domcoordacc','copyright','sourceavail') { |
foreach my $item ('nocodemirror','daxecollapse','domcoordacc','copyright','sourceavail') { |
if ($domconfig{'authordefaults'}{$item} ne $confhash{$item}) { |
if ($domconfig{'authordefaults'}{$item} ne $confhash{$item}) { |
$changes{$item} = 1; |
$changes{$item} = 1; |
} |
} |
} |
} |
if (ref($domconfig{'authordefaults'}{'editors'}) eq 'ARRAY') { |
if (ref($domconfig{'authordefaults'}{'editors'}) eq 'ARRAY') { |
my @diffs = |
my @diffs = |
&Apache::loncommon::compare_arrays($confhash{'editors'}, |
&Apache::loncommon::compare_arrays($confhash{'editors'}, |
$domconfig{'authordefaults'}{'editors'}); |
$domconfig{'authordefaults'}{'editors'}); |
unless (@diffs == 0) { |
unless (@diffs == 0) { |
Line 13336 sub modify_authordefaults {
|
Line 13496 sub modify_authordefaults {
|
} |
} |
} else { |
} else { |
my @offon = ('off','on'); |
my @offon = ('off','on'); |
foreach my $item ('nocodemirror','domcoordacc') { |
foreach my $item ('nocodemirror','daxecollapse','domcoordacc') { |
if ($offon[$confhash{$item}] ne $staticdefaults{$item}) { |
if ($offon[$confhash{$item}] ne $staticdefaults{$item}) { |
$changes{$item} = 1; |
$changes{$item} = 1; |
} |
} |
} |
} |
Line 13346 sub modify_authordefaults {
|
Line 13506 sub modify_authordefaults {
|
$changes{$item} = 1; |
$changes{$item} = 1; |
} |
} |
} |
} |
|
my @diffs = |
|
&Apache::loncommon::compare_arrays($confhash{'editors'}, |
|
$staticdefaults{'editors'}); |
|
unless (@diffs == 0) { |
|
$changes{'editors'} = 1; |
|
} |
} |
} |
foreach my $key ('authorquota','webdav') { |
foreach my $key ('authorquota','webdav') { |
if (ref($curr_quotas{$key}) eq 'HASH') { |
if (ref($curr_quotas{$key}) eq 'HASH') { |
Line 13374 sub modify_authordefaults {
|
Line 13540 sub modify_authordefaults {
|
} |
} |
if (ref($curr_quotas{'webdav'}) eq 'HASH') { |
if (ref($curr_quotas{'webdav'}) eq 'HASH') { |
if (exists($save_quotas{'webdav'}{'_LC_adv'})) { |
if (exists($save_quotas{'webdav'}{'_LC_adv'})) { |
if ($save_quotas{'webdav'}{'_LC_adv'} ne $curr_quotas{'webdav'}{'_LC_adv'}) { |
if ($save_quotas{'webdav'}{'_LC_adv'} ne $curr_quotas{'webdav'}{'_LC_adv'}) { |
$changes{'webdav_LC_adv'} = 1; |
$changes{'webdav_LC_adv'} = 1; |
} |
} |
} elsif (exists($curr_quotas{'webdav'}{'_LC_adv'})) { |
} elsif (exists($curr_quotas{'webdav'}{'_LC_adv'})) { |
Line 13392 sub modify_authordefaults {
|
Line 13558 sub modify_authordefaults {
|
my $resulttext; |
my $resulttext; |
if ($putresult eq 'ok') { |
if ($putresult eq 'ok') { |
if (keys(%changes)) { |
if (keys(%changes)) { |
|
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); |
if ((exists($changes{'authorquota'})) || (exists($changes{'webdav'})) || |
if ((exists($changes{'authorquota'})) || (exists($changes{'webdav'})) || |
($changes{'webdav_LC_adv'})) { |
($changes{'webdav_LC_adv'})) { |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1); |
|
if ((exists($changes{'authorquota'})) && (ref($save_quotas{'authorquota'}) eq 'HASH')) { |
if ((exists($changes{'authorquota'})) && (ref($save_quotas{'authorquota'}) eq 'HASH')) { |
$domdefaults{'authorquota'} = $save_quotas{'authorquota'}; |
$domdefaults{'authorquota'} = $save_quotas{'authorquota'}; |
} |
} |
Line 13402 sub modify_authordefaults {
|
Line 13568 sub modify_authordefaults {
|
(ref($save_quotas{'webdav'}) eq 'HASH')) { |
(ref($save_quotas{'webdav'}) eq 'HASH')) { |
$domdefaults{'webdav'} = $save_quotas{'webdav'}; |
$domdefaults{'webdav'} = $save_quotas{'webdav'}; |
} |
} |
my $cachetime = 24*60*60; |
|
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime); |
|
if (ref($lastactref) eq 'HASH') { |
|
$lastactref->{'domdefaults'} = 1; |
|
} |
|
} |
} |
$resulttext = &mt('Changes made:').'<ul>'; |
$resulttext = &mt('Changes made:').'<ul>'; |
my $authoroverride; |
my $authoroverride; |
foreach my $key ('nocodemirror','domcoordacc','copyright','sourceavail') { |
foreach my $key ('nocodemirror','daxecollapse','domcoordacc','copyright','sourceavail') { |
if (exists($changes{$key})) { |
if (exists($changes{$key})) { |
|
$domdefaults{$key} = $confhash{$key}; |
my $shown; |
my $shown; |
unless ($authoroverride) { |
unless ($authoroverride) { |
$resulttext .= '<li>'.&mt('Defaults which can be overridden by Author').'<ul>'; |
$resulttext .= '<li>'.&mt('Defaults which can be overridden by Author').'<ul>'; |
$authoroverride = 1; |
$authoroverride = 1; |
} |
} |
if (($key eq 'nocodemirror') || ($key eq 'domcoordacc')) { |
if (($key eq 'nocodemirror') || ($key eq 'daxecollapse') || ($key eq 'domcoordacc')) { |
$shown = ($confhash{$key} ? &mt('Yes') : &mt('No')); |
$shown = ($confhash{$key} ? &mt('Yes') : &mt('No')); |
} elsif ($key eq 'copyright') { |
} elsif ($key eq 'copyright') { |
$shown = &Apache::loncommon::copyrightdescription($confhash{$key}); |
$shown = &Apache::loncommon::copyrightdescription($confhash{$key}); |
} elsif ($key eq 'sourceavail') { |
} elsif ($key eq 'sourceavail') { |
$shown = &Apache::loncommon::source_copyrightdescription($confhash{$key}); |
$shown = &Apache::loncommon::source_copyrightdescription($confhash{$key}); |
} |
} |
$resulttext .= '<li>'.&mt('[_1] set to: [_2]',$titles{$key},$shown).'</li>'; |
$resulttext .= '<li>'.&mt('[_1] set to: [_2]',$titles{$key},$shown).'</li>'; |
} |
} |
} |
} |
if ($authoroverride) { |
if ($authoroverride) { |
Line 13439 sub modify_authordefaults {
|
Line 13601 sub modify_authordefaults {
|
$domcoordoverride = 1; |
$domcoordoverride = 1; |
} |
} |
if ($key eq 'editors') { |
if ($key eq 'editors') { |
if (@{$confhash{'editors'}}) { |
if (ref($confhash{'editors'}) eq 'ARRAY') { |
$shown = join(', ', map { $titles{$_} } @{$confhash{'editors'}}); |
$domdefaults{'editors'} = join(',',@{$confhash{'editors'}}); |
} else { |
if (@{$confhash{'editors'}}) { |
$shown = &mt('None'); |
$shown = join(', ', map { $titles{$_} } @{$confhash{'editors'}}); |
|
} else { |
|
$shown = &mt('None'); |
|
} |
} |
} |
} elsif ($key eq 'authorquota') { |
} elsif ($key eq 'authorquota') { |
foreach my $type (@insttypes) { |
foreach my $type (@insttypes) { |
Line 13462 sub modify_authordefaults {
|
Line 13627 sub modify_authordefaults {
|
} |
} |
} |
} |
$resulttext .= '<li>'.&mt('[_1] set to: [_2]',$titles{$key},$shown).'</li>'; |
$resulttext .= '<li>'.&mt('[_1] set to: [_2]',$titles{$key},$shown).'</li>'; |
} |
} |
} |
} |
if ($domcoordoverride) { |
if ($domcoordoverride) { |
$resulttext .= '</ul></li>'; |
$resulttext .= '</ul></li>'; |
} |
} |
|
$resulttext .= '</ul>'; |
|
my $cachetime = 24*60*60; |
|
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime); |
|
if (ref($lastactref) eq 'HASH') { |
|
$lastactref->{'domdefaults'} = 1; |
|
} |
} else { |
} else { |
$resulttext = &mt('No changes made to Authoring Space defaults'); |
$resulttext = &mt('No changes made to Authoring Space defaults'); |
} |
} |
Line 14976 sub lti_security_results {
|
Line 15147 sub lti_security_results {
|
off => &mt('Encryption of stored external tool secrets defined in domain disabled'), |
off => &mt('Encryption of stored external tool secrets defined in domain disabled'), |
}, |
}, |
); |
); |
|
|
} |
} |
my @types= ('crs','dom'); |
my @types= ('crs','dom'); |
if ($context eq 'lti') { |
if ($context eq 'lti') { |
Line 15072 sub lti_security_results {
|
Line 15242 sub lti_security_results {
|
} |
} |
} elsif ($item eq 'linkprot') { |
} elsif ($item eq 'linkprot') { |
next; |
next; |
|
} elsif ($item eq 'suggested') { |
|
if ((ref($secchanges->{'suggested'}) eq 'HASH') && |
|
(ref($newsec->{'suggested'}) eq 'HASH')) { |
|
my $suggestions; |
|
foreach my $id (sort { $a <=> $b } keys(%{$secchanges->{'suggested'}})) { |
|
if (ref($newsec->{'suggested'}->{$id}) eq 'HASH') { |
|
my $name = $newsec->{'suggested'}->{$id}->{'name'}; |
|
my $info = $newsec->{'suggested'}->{$id}->{'info'}; |
|
$suggestions .= '<li>'.&mt('Launcher: [_1]',$name).'<br />'. |
|
&mt('Recommend: [_1]','<pre>'.$info.'</pre>'). |
|
'</li>'; |
|
} else { |
|
$suggestions .= '<li>'.&mt('Recommendations deleted for Launcher: [_1]', |
|
$newsec->{'suggested'}->{$id}).'</li>'; |
|
} |
|
} |
|
if ($suggestions) { |
|
$output .= '<li>'.&mt('Hints in Courses for Link Protector Configuration'). |
|
'<ul>'.$suggestions.'</ul>'. |
|
'</li>'; |
|
} |
|
} |
} |
} |
} |
} |
if ($needs_update) { |
if ($needs_update) { |
Line 15676 sub modify_lti {
|
Line 15868 sub modify_lti {
|
} |
} |
} |
} |
if (ref($currltisec{'linkprot'}) eq 'HASH') { |
if (ref($currltisec{'linkprot'}) eq 'HASH') { |
foreach my $id (%{$currltisec{'linkprot'}}) { |
foreach my $id (keys(%{$currltisec{'linkprot'}})) { |
next if ($id !~ /^\d+$/); |
next if ($id !~ /^\d+$/); |
unless (exists($linkprotchg{$id})) { |
unless (exists($linkprotchg{$id})) { |
if (ref($currltisec{'linkprot'}{$id}) eq 'HASH') { |
if (ref($currltisec{'linkprot'}{$id}) eq 'HASH') { |
Line 15698 sub modify_lti {
|
Line 15890 sub modify_lti {
|
if ($proterror) { |
if ($proterror) { |
$errors .= '<li>'.$proterror.'</li>'; |
$errors .= '<li>'.$proterror.'</li>'; |
} |
} |
|
|
|
my (%delsuggested,%suggids,@suggested);; |
|
if (ref($currltisec{'suggested'}) eq 'HASH') { |
|
my $maxnum = $env{'form.linkprot_suggested_maxnum'}; |
|
my @todelete = &Apache::loncommon::get_env_multiple('form.linkprot_suggested_del'); |
|
for (my $i=0; $i<$maxnum; $i++) { |
|
my $itemid = $env{'form.linkprot_suggested_id_'.$i}; |
|
$itemid =~ s/\D+//g; |
|
if ($itemid) { |
|
if (ref($currltisec{'suggested'}->{$itemid}) eq 'HASH') { |
|
push(@suggested,$i); |
|
$suggids{$i} = $itemid; |
|
if ((@todelete > 0) && (grep(/^$i$/,@todelete))) { |
|
if (ref($currltisec{'suggested'}{$itemid}) eq 'HASH') { |
|
$delsuggested{$itemid} = $currltisec{'suggested'}{$itemid}{'name'}; |
|
} |
|
} else { |
|
if ($env{'form.linkprot_suggested_name_'.$i} eq '') { |
|
$delsuggested{$itemid} = $currltisec{'suggested'}{$itemid}{'name'}; |
|
} else { |
|
$env{'form.linkprot_suggested_name_'.$i} =~ s/(`)/'/g; |
|
$env{'form.linkprot_suggested_info_'.$i} =~ s/(`)/'/g; |
|
$newltisec{'suggested'}{$itemid}{'name'} = $env{'form.linkprot_suggested_name_'.$i}; |
|
$newltisec{'suggested'}{$itemid}{'info'} = $env{'form.linkprot_suggested_info_'.$i}; |
|
if (($currltisec{'suggested'}{$itemid}{'name'} ne $newltisec{'suggested'}{$itemid}{'name'}) || |
|
($currltisec{'suggested'}{$itemid}{'info'} ne $newltisec{'suggested'}{$itemid}{'info'})) { |
|
$secchanges{'suggested'}{$itemid} = 1; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
foreach my $key (keys(%delsuggested)) { |
|
$newltisec{'suggested'}{$key} = $delsuggested{$key}; |
|
$secchanges{'suggested'}{$key} = 1; |
|
} |
|
if (($env{'form.linkprot_suggested_add'}) && |
|
($env{'form.linkprot_suggested_name_add'} ne '')) { |
|
$env{'form.linkprot_suggested_name_add'} =~ s/(`)/'/g; |
|
$env{'form.linkprot_suggested_info_add'} =~ s/(`)/'/g; |
|
my ($newsuggid,$errormsg) = &get_lti_id($dom,$env{'form.linkprot_suggested_name_add'},'suggested'); |
|
if ($newsuggid) { |
|
$newltisec{'suggested'}{$newsuggid}{'name'} = $env{'form.linkprot_suggested_name_add'}; |
|
$newltisec{'suggested'}{$newsuggid}{'info'} = $env{'form.linkprot_suggested_info_add'}; |
|
$secchanges{'suggested'}{$newsuggid} = 1; |
|
} else { |
|
my $error = &mt('Failed to acquire unique ID for new Link Protectors in Courses Suggestion'); |
|
if ($errormsg) { |
|
$error .= ' ('.$errormsg.')'; |
|
} |
|
$errors .= '<li><span class="LC_error">'.$error.'</span></li>'; |
|
} |
|
} |
my (@items,%deletions,%itemids); |
my (@items,%deletions,%itemids); |
if ($env{'form.lti_add'}) { |
if ($env{'form.lti_add'}) { |
my $consumer = $env{'form.lti_consumer_add'}; |
my $consumer = $env{'form.lti_consumer_add'}; |
$consumer =~ s/(`)/'/g; |
$consumer =~ s/(`)/'/g; |
($newid,my $error) = &get_lti_id($dom,$consumer); |
($newid,my $errormsg) = &get_lti_id($dom,$consumer,'lti'); |
if ($newid) { |
if ($newid) { |
$itemids{'add'} = $newid; |
$itemids{'add'} = $newid; |
push(@items,'add'); |
push(@items,'add'); |
$changes{$newid} = 1; |
$changes{$newid} = 1; |
} else { |
} else { |
my $error = &mt('Failed to acquire unique ID for new LTI configuration'); |
my $error = &mt('Failed to acquire unique ID for new LTI configuration'); |
|
if ($errormsg) { |
|
$error .= ' ('.$errormsg.')'; |
|
} |
$errors .= '<li><span class="LC_error">'.$error.'</span></li>'; |
$errors .= '<li><span class="LC_error">'.$error.'</span></li>'; |
} |
} |
} |
} |
Line 16302 sub modify_lti {
|
Line 16552 sub modify_lti {
|
} |
} |
$resulttext .= '</ul>'; |
$resulttext .= '</ul>'; |
if (ref($lastactref) eq 'HASH') { |
if (ref($lastactref) eq 'HASH') { |
if (($secchanges{'encrypt'}) || ($secchanges{'private'})) { |
if (($secchanges{'encrypt'}) || ($secchanges{'private'}) || (exists($secchanges{'suggested'}))) { |
|
&Apache::lonnet::get_domain_defaults($dom,1); |
$lastactref->{'domdefaults'} = 1; |
$lastactref->{'domdefaults'} = 1; |
} |
} |
} |
} |
Line 16341 sub get_priv_creds {
|
Line 16592 sub get_priv_creds {
|
} |
} |
|
|
sub get_lti_id { |
sub get_lti_id { |
my ($domain,$consumer) = @_; |
my ($domain,$consumer,$dbname) = @_; |
# get lock on lti db |
unless (($dbname eq 'lti') || ($dbname eq 'suggested')) { |
|
return ('','invalid db'); |
|
} |
|
# get lock on db |
my $lockhash = { |
my $lockhash = { |
lock => $env{'user.name'}. |
lock => $env{'user.name'}. |
':'.$env{'user.domain'}, |
':'.$env{'user.domain'}, |
}; |
}; |
my $tries = 0; |
my $tries = 0; |
my $gotlock = &Apache::lonnet::newput_dom('lti',$lockhash,$domain); |
my $gotlock = &Apache::lonnet::newput_dom($dbname,$lockhash,$domain); |
my ($id,$error); |
my ($id,$error); |
|
|
while (($gotlock ne 'ok') && ($tries<10)) { |
while (($gotlock ne 'ok') && ($tries<10)) { |
$tries ++; |
$tries ++; |
sleep (0.1); |
sleep (0.1); |
$gotlock = &Apache::lonnet::newput_dom('lti',$lockhash,$domain); |
$gotlock = &Apache::lonnet::newput_dom($dbname,$lockhash,$domain); |
} |
} |
if ($gotlock eq 'ok') { |
if ($gotlock eq 'ok') { |
my %currids = &Apache::lonnet::dump_dom('lti',$domain); |
my %currids = &Apache::lonnet::dump_dom($dbname,$domain); |
if ($currids{'lock'}) { |
if ($currids{'lock'}) { |
delete($currids{'lock'}); |
delete($currids{'lock'}); |
if (keys(%currids)) { |
if (keys(%currids)) { |
Line 16369 sub get_lti_id {
|
Line 16623 sub get_lti_id {
|
$id = 1; |
$id = 1; |
} |
} |
if ($id) { |
if ($id) { |
unless (&Apache::lonnet::newput_dom('lti',{ $id => $consumer },$domain) eq 'ok') { |
unless (&Apache::lonnet::newput_dom($dbname,{ $id => $consumer },$domain) eq 'ok') { |
$error = 'nostore'; |
$error = 'nostore'; |
} |
} |
} else { |
} else { |
$error = 'nonumber'; |
$error = 'nonumber'; |
} |
} |
} |
} |
my $dellockoutcome = &Apache::lonnet::del_dom('lti',['lock'],$domain); |
my $dellockoutcome = &Apache::lonnet::del_dom($dbname,['lock'],$domain); |
} else { |
} else { |
$error = 'nolock'; |
$error = 'nolock'; |
} |
} |
Line 21005 sub modify_coursedefaults {
|
Line 21259 sub modify_coursedefaults {
|
postsubmit => 60, |
postsubmit => 60, |
mysqltables => 172800, |
mysqltables => 172800, |
domexttool => 1, |
domexttool => 1, |
|
crsauthor => 1, |
|
crseditors => ['edit','xml'], |
); |
); |
my %texoptions = ( |
my %texoptions = ( |
MathJax => 'MathJax', |
MathJax => 'MathJax', |
mimetex => &mt('Convert to Images'), |
mimetex => &mt('Convert to Images'), |
tth => &mt('TeX to HTML'), |
tth => &mt('TeX to HTML'), |
); |
); |
|
|
|
my @editors = ('edit','xml','daxe'); |
|
my %editornames = &crseditor_titles(); |
|
|
$defaultshash{'coursedefaults'} = {}; |
$defaultshash{'coursedefaults'} = {}; |
|
|
if (ref($domconfig{'coursedefaults'}) ne 'HASH') { |
if (ref($domconfig{'coursedefaults'}) ne 'HASH') { |
Line 21196 sub modify_coursedefaults {
|
Line 21456 sub modify_coursedefaults {
|
$changes{'postsubmit'} = 1; |
$changes{'postsubmit'} = 1; |
} |
} |
} |
} |
my (%newdomexttool,%newexttool,%olddomexttool,%oldexttool); |
my (%newdomexttool,%newexttool,%newcrsauthor,%olddomexttool,%oldexttool,%oldcrsauthor, |
|
%posscrseditors); |
map { $newdomexttool{$_} = 1; } &Apache::loncommon::get_env_multiple('form.domexttool'); |
map { $newdomexttool{$_} = 1; } &Apache::loncommon::get_env_multiple('form.domexttool'); |
map { $newexttool{$_} = 1; } &Apache::loncommon::get_env_multiple('form.exttool'); |
map { $newexttool{$_} = 1; } &Apache::loncommon::get_env_multiple('form.exttool'); |
|
map { $newcrsauthor{$_} = 1; } &Apache::loncommon::get_env_multiple('form.crsauthor'); |
|
map { $posscrseditors{$_} = 1; } &Apache::loncommon::get_env_multiple('form.crseditors'); |
if (ref($domconfig{'coursedefaults'}{'domexttool'}) eq 'HASH') { |
if (ref($domconfig{'coursedefaults'}{'domexttool'}) eq 'HASH') { |
%olddomexttool = %{$domconfig{'coursedefaults'}{'domexttool'}}; |
%olddomexttool = %{$domconfig{'coursedefaults'}{'domexttool'}}; |
} else { |
} else { |
Line 21221 sub modify_coursedefaults {
|
Line 21484 sub modify_coursedefaults {
|
} |
} |
} |
} |
} |
} |
|
if (ref($domconfig{'coursedefaults'}{'crsauthor'}) eq 'HASH') { |
|
%oldcrsauthor = %{$domconfig{'coursedefaults'}{'crsauthor'}}; |
|
} else { |
|
foreach my $type (@types) { |
|
if ($staticdefaults{'crsauthor'}) { |
|
$oldcrsauthor{$type} = 1; |
|
} else { |
|
$oldcrsauthor{$type} = 0; |
|
} |
|
} |
|
} |
|
my @newcrseditors = (); |
|
foreach my $editor (@editors) { |
|
if ($posscrseditors{$editor}) { |
|
push(@newcrseditors,$editor); |
|
} |
|
} |
|
if (ref($domconfig{'coursedefaults'}{'crseditors'}) eq 'ARRAY') { |
|
my @diffs = |
|
&Apache::loncommon::compare_arrays($domconfig{'coursedefaults'}{'crseditors'}, |
|
\@newcrseditors); |
|
if (@diffs) { |
|
$changes{'crseditors'} = 1; |
|
} |
|
} else { |
|
my @diffs = |
|
&Apache::loncommon::compare_arrays($staticdefaults{'crseditors'}, |
|
\@newcrseditors); |
|
unless (@diffs == 0) { |
|
$changes{'crseditors'} = 1; |
|
} |
|
} |
foreach my $type (@types) { |
foreach my $type (@types) { |
unless ($newdomexttool{$type}) { |
unless ($newdomexttool{$type}) { |
$newdomexttool{$type} = 0; |
$newdomexttool{$type} = 0; |
Line 21228 sub modify_coursedefaults {
|
Line 21523 sub modify_coursedefaults {
|
unless ($newexttool{$type}) { |
unless ($newexttool{$type}) { |
$newexttool{$type} = 0; |
$newexttool{$type} = 0; |
} |
} |
|
unless ($newcrsauthor{$type}) { |
|
$newcrsauthor{$type} = 0; |
|
} |
if ($newdomexttool{$type} != $olddomexttool{$type}) { |
if ($newdomexttool{$type} != $olddomexttool{$type}) { |
$changes{'domexttool'} = 1; |
$changes{'domexttool'} = 1; |
} |
} |
if ($newexttool{$type} != $oldexttool{$type}) { |
if ($newexttool{$type} != $oldexttool{$type}) { |
$changes{'exttool'} = 1; |
$changes{'exttool'} = 1; |
} |
} |
|
if ($newcrsauthor{$type} != $oldcrsauthor{$type}) { |
|
$changes{'crsauthor'} = 1; |
|
} |
} |
} |
$defaultshash{'coursedefaults'}{'domexttool'} = \%newdomexttool; |
$defaultshash{'coursedefaults'}{'domexttool'} = \%newdomexttool; |
$defaultshash{'coursedefaults'}{'exttool'} = \%newexttool; |
$defaultshash{'coursedefaults'}{'exttool'} = \%newexttool; |
|
$defaultshash{'coursedefaults'}{'crsauthor'} = \%newcrsauthor; |
|
$defaultshash{'coursedefaults'}{'crseditors'} = \@newcrseditors; |
} |
} |
my $putresult = &Apache::lonnet::put_dom('configuration',\%defaultshash, |
my $putresult = &Apache::lonnet::put_dom('configuration',\%defaultshash, |
$dom); |
$dom); |
Line 21247 sub modify_coursedefaults {
|
Line 21550 sub modify_coursedefaults {
|
($changes{'coursecredits'}) || ($changes{'uselcmath'}) || ($changes{'usejsme'}) || |
($changes{'coursecredits'}) || ($changes{'uselcmath'}) || ($changes{'usejsme'}) || |
($changes{'canclone'}) || ($changes{'mysqltables'}) || ($changes{'texengine'}) || |
($changes{'canclone'}) || ($changes{'mysqltables'}) || ($changes{'texengine'}) || |
($changes{'inline_chem'}) || ($changes{'ltiauth'}) || ($changes{'domexttool'}) || |
($changes{'inline_chem'}) || ($changes{'ltiauth'}) || ($changes{'domexttool'}) || |
($changes{'exttool'}) || ($changes{'coursequota'})) { |
($changes{'exttool'}) || ($changes{'coursequota'}) || ($changes{'crsauthor'})) { |
foreach my $item ('canuse_pdfforms','uselcmath','usejsme','inline_chem','texengine', |
foreach my $item ('canuse_pdfforms','uselcmath','usejsme','inline_chem','texengine', |
'ltiauth') { |
'ltiauth') { |
if ($changes{$item}) { |
if ($changes{$item}) { |
Line 21313 sub modify_coursedefaults {
|
Line 21616 sub modify_coursedefaults {
|
} |
} |
} |
} |
} |
} |
|
if ($changes{'crsauthor'}) { |
|
if (ref($defaultshash{'coursedefaults'}{'crsauthor'}) eq 'HASH') { |
|
foreach my $type (@types) { |
|
$domdefaults{$type.'crsauthor'}=$defaultshash{'coursedefaults'}{'crsauthor'}{$type}; |
|
} |
|
} |
|
} |
|
if ($changes{'crseditors'}) { |
|
if (ref($defaultshash{'coursedefaults'}{'crseditors'}) eq 'ARRAY') { |
|
$domdefaults{'crseditors'}=join(',',@{$defaultshash{'coursedefaults'}{'crseditors'}}); |
|
} |
|
} |
my $cachetime = 24*60*60; |
my $cachetime = 24*60*60; |
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime); |
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime); |
if (ref($lastactref) eq 'HASH') { |
if (ref($lastactref) eq 'HASH') { |
Line 21463 sub modify_coursedefaults {
|
Line 21778 sub modify_coursedefaults {
|
} else { |
} else { |
$resulttext .= '<li>'.&mt('LTI launch of deep-linked URL will require re-authentication').'</li>'; |
$resulttext .= '<li>'.&mt('LTI launch of deep-linked URL will require re-authentication').'</li>'; |
} |
} |
} elsif ($item eq 'domexttool') { |
} elsif (($item eq 'domexttool') || ($item eq 'exttool') || ($item eq 'crsauthor')) { |
my @noyes = (&mt('no'),&mt('yes')); |
my @noyes = (&mt('no'),&mt('yes')); |
if (ref($defaultshash{'coursedefaults'}{'domexttool'}) eq 'HASH') { |
my %status = ( |
$resulttext .= '<li>'.&mt('External Tools defined in the domain may be used as follows:').'<ul>'. |
domexttool => { |
'<li>'.&mt('Official courses: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'domexttool'}{'official'}].'</b>').'</li>'. |
ishash => &mt('External Tools defined in the domain may be used as follows:'), |
'<li>'.&mt('Unofficial courses: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'domexttool'}{'unofficial'}].'</b>').'</li>'. |
default => &mt('External Tools defined in the domain may be used in all course types, by default'), |
'<li>'.&mt('Textbook courses: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'domexttool'}{'textbook'}].'</b>').'</li>'. |
}, |
'<li>'.&mt('Placement tests: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'domexttool'}{'placement'}].'</b>').'</li>'. |
exttool => { |
'<li>'.&mt('Communities: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'domexttool'}{'community'}].'</b>').'</li>'. |
ishash => &mt('External Tools can be defined and configured in course containers as follows:'), |
|
default => &mt('External Tools can not be defined in any course types, by default'), |
|
}, |
|
crsauthor => { |
|
ishash => &mt('Standard Problems can be created within course containers as follows:'), |
|
default => &mt('Standard Problems can be created within any course type, by default'), |
|
}, |
|
); |
|
|
|
if (ref($defaultshash{'coursedefaults'}{$item}) eq 'HASH') { |
|
$resulttext .= '<li>'.$status{$item}{'ishash'}.'<ul>'. |
|
'<li>'.&mt('Official courses: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{$item}{'official'}].'</b>').'</li>'. |
|
'<li>'.&mt('Unofficial courses: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{$item}{'unofficial'}].'</b>').'</li>'. |
|
'<li>'.&mt('Textbook courses: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{$item}{'textbook'}].'</b>').'</li>'. |
|
'<li>'.&mt('Placement tests: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{$item}{'placement'}].'</b>').'</li>'. |
|
'<li>'.&mt('Communities: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{$item}{'community'}].'</b>').'</li>'. |
'</ul>'. |
'</ul>'. |
'</li>'; |
'</li>'; |
} else { |
} else { |
$resulttext .= '<li>'.&mt('External Tools defined in the domain may be used in all course types, by default').'</li>'; |
$resulttext .= '<li>'.$status{$item}{'default'}.'</li>'; |
} |
} |
} elsif ($item eq 'exttool') { |
} elsif ($item eq 'crseditors') { |
my @noyes = (&mt('no'),&mt('yes')); |
if (ref($defaultshash{'coursedefaults'}{$item}) eq 'ARRAY') { |
if (ref($defaultshash{'coursedefaults'}{'exttool'}) eq 'HASH') { |
my $shown; |
$resulttext .= '<li>'.&mt('External Tools can be defined and configured in course containers as follows:').'<ul>'. |
if (@{$defaultshash{'coursedefaults'}{$item}}) { |
'<li>'.&mt('Official courses: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'exttool'}{'official'}].'</b>').'</li>'. |
$shown = join(', ', map { $editornames{$_} } @{$defaultshash{'coursedefaults'}{$item}}); |
'<li>'.&mt('Unofficial courses: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'exttool'}{'unofficial'}].'</b>').'</li>'. |
} else { |
'<li>'.&mt('Textbook courses: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'exttool'}{'textbook'}].'</b>').'</li>'. |
$shown = &mt('None'); |
'<li>'.&mt('Placement tests: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'exttool'}{'placement'}].'</b>').'</li>'. |
} |
'<li>'.&mt('Communities: [_1]','<b>'.$noyes[$defaultshash{'coursedefaults'}{'exttool'}{'community'}].'</b>').'</li>'. |
$resulttext .= '<li>'.&mt('Available editors for course/community resources: [_1]',$shown).'</li>'; |
'</ul>'. |
|
'</li>'; |
|
} else { |
|
$resulttext .= '<li>'.&mt('External Tools can not be defined in any course types, by default').'</li>'; |
|
} |
} |
} |
} |
} |
} |