version 1.438, 2024/04/14 17:12:27
|
version 1.441, 2024/05/21 02:57:15
|
Line 7523 sub print_authordefaults {
|
Line 7523 sub print_authordefaults {
|
} |
} |
$datatable .= '</td></tr>'; |
$datatable .= '</td></tr>'; |
$itemcount ++; |
$itemcount ++; |
|
my %defchecked = ( |
|
'archive' => 'off', |
|
); |
|
my @toggles = ('archive'); |
|
(my $archive,$itemcount) = &radiobutton_prefs($settings,['archive'], |
|
{'archive' => 'off'}, |
|
\%titles,$itemcount); |
|
$datatable .= $archive."\n"; |
|
$itemcount ++; |
} |
} |
$$rowtotal += $itemcount; |
$$rowtotal += $itemcount; |
return $datatable; |
return $datatable; |
Line 7546 sub authordefaults_titles {
|
Line 7555 sub authordefaults_titles {
|
none => 'No override set', |
none => 'No override set', |
overon => 'Override -- webDAV on', |
overon => 'Override -- webDAV on', |
overoff => 'Override -- webDAV off', |
overoff => 'Override -- webDAV off', |
|
archive => 'Authors can download tar.gz file of Authoring Space', |
); |
); |
} |
} |
|
|
Line 13425 sub modify_authordefaults {
|
Line 13435 sub modify_authordefaults {
|
'nocodemirror' => 'off', |
'nocodemirror' => 'off', |
'daxecollapse' => 'off', |
'daxecollapse' => 'off', |
'domcoordacc' => 'on', |
'domcoordacc' => 'on', |
'editors' => ['edit','xml']. |
'editors' => ['edit','xml'], |
'authorquota' => 500, |
'authorquota' => 500, |
'webdav' => 0, |
'webdav' => 0, |
|
'archive' => 'off', |
); |
); |
my %titles = &authordefaults_titles(); |
my %titles = &authordefaults_titles(); |
foreach my $item ('nocodemirror','daxecollapse','domcoordacc') { |
foreach my $item ('nocodemirror','daxecollapse','domcoordacc','archive') { |
if ($env{'form.'.$item} =~ /^(0|1)$/) { |
if ($env{'form.'.$item} =~ /^(0|1)$/) { |
$confhash{$item} = $env{'form.'.$item}; |
$confhash{$item} = $env{'form.'.$item}; |
} |
} |
Line 13474 sub modify_authordefaults {
|
Line 13485 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','daxecollapse','domcoordacc','copyright','sourceavail') { |
foreach my $item ('nocodemirror','daxecollapse','domcoordacc','copyright','sourceavail','archive') { |
if ($domconfig{'authordefaults'}{$item} ne $confhash{$item}) { |
if ($domconfig{'authordefaults'}{$item} ne $confhash{$item}) { |
$changes{$item} = 1; |
$changes{$item} = 1; |
} |
} |
Line 13496 sub modify_authordefaults {
|
Line 13507 sub modify_authordefaults {
|
} |
} |
} else { |
} else { |
my @offon = ('off','on'); |
my @offon = ('off','on'); |
foreach my $item ('nocodemirror','daxecollapse','domcoordacc') { |
foreach my $item ('nocodemirror','daxecollapse','domcoordacc','archive') { |
if ($offon[$confhash{$item}] ne $staticdefaults{$item}) { |
if ($offon[$confhash{$item}] ne $staticdefaults{$item}) { |
$changes{$item} = 1; |
$changes{$item} = 1; |
} |
} |
Line 13506 sub modify_authordefaults {
|
Line 13517 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 13587 sub modify_authordefaults {
|
Line 13604 sub modify_authordefaults {
|
$resulttext .= '</ul></li>'; |
$resulttext .= '</ul></li>'; |
} |
} |
my $domcoordoverride; |
my $domcoordoverride; |
foreach my $key ('editors','authorquota','webdav','webdav_LC_adv') { |
foreach my $key ('editors','authorquota','webdav','webdav_LC_adv','archive') { |
if (exists($changes{$key})) { |
if (exists($changes{$key})) { |
my $shown; |
my $shown; |
unless ($domcoordoverride) { |
unless ($domcoordoverride) { |
Line 13619 sub modify_authordefaults {
|
Line 13636 sub modify_authordefaults {
|
} else { |
} else { |
$shown = $titles{'none'}; |
$shown = $titles{'none'}; |
} |
} |
|
} elsif ($key eq 'archive') { |
|
$domdefaults{$key} = $confhash{$key}; |
|
$shown = ($confhash{$key} ? &mt('Yes') : &mt('No')); |
} |
} |
$resulttext .= '<li>'.&mt('[_1] set to: [_2]',$titles{$key},$shown).'</li>'; |
$resulttext .= '<li>'.&mt('[_1] set to: [_2]',$titles{$key},$shown).'</li>'; |
} |
} |
Line 13626 sub modify_authordefaults {
|
Line 13646 sub modify_authordefaults {
|
if ($domcoordoverride) { |
if ($domcoordoverride) { |
$resulttext .= '</ul></li>'; |
$resulttext .= '</ul></li>'; |
} |
} |
|
$resulttext .= '</ul>'; |
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') { |