'.
&mt('Replace:').' ';
}
@@ -4418,7 +4379,7 @@ sub build_category_rows {
if (ref($cats->[$depth]{$parent}) eq 'ARRAY') {
my $numchildren = @{$cats->[$depth]{$parent}};
my $css_class = $itemcount%2?' class="LC_odd_row"':'';
- $text .= '
';
+ $text .= '
';
my ($idxnum,$parent_name,$parent_item);
my $higher = $depth - 1;
if ($higher == 0) {
@@ -4890,7 +4851,7 @@ sub modify_login {
} else {
my $puberror = &mt("Upload of [_1] failed because an error occurred publishing the file in RES space. Error was: [_2].",$newfile{$lang},$result);
$errors .= '
'.$puberror.'
';
- if ((grep(/^\Q$lang\E$/,@currlangs)) &&
+ if ((grep(/^\Q$lang\E$/,@currlangs)) &&
(!grep(/^\Q$lang\E$/,@delurls))) {
$loginhash{'login'}{'helpurl'}{$lang} = $domconfig{'login'}{'helpurl'}{$lang};
@@ -5007,7 +4968,7 @@ sub modify_login {
}
} elsif ($item eq 'captcha') {
if (ref($loginhash{'login'}) eq 'HASH') {
- my $chgtxt;
+ my $chgtxt;
if ($loginhash{'login'}{$item} eq 'notused') {
$chgtxt .= &mt('No CAPTCHA validation in use for helpdesk form.');
} else {
@@ -5068,7 +5029,7 @@ sub color_font_choices {
links => "Link colors",
images => "Images",
font => "Font color",
- fontmenu => "Font menu",
+ fontmenu => "Font Menu",
pgbg => "Page",
tabbg => "Header",
sidebg => "Border",
@@ -5120,45 +5081,24 @@ sub modify_colors {
my @images;
my $servadm = $r->dir_config('lonAdmEMail');
my $errors;
- my %defaults;
foreach my $role (@{$roles}) {
if ($role eq 'login') {
%choices = &login_choices();
@logintext = ('textcol','bgcol');
} else {
%choices = &color_font_choices();
+ $confhash->{$role}{'fontmenu'} = $env{'form.'.$role.'_fontmenu'};
}
if ($role eq 'login') {
@images = ('img','logo','domlogo','login');
@bgs = ('pgbg','mainbg','sidebg');
} else {
@images = ('img');
- @bgs = ('pgbg','tabbg','sidebg');
- }
- my %defaults = &role_defaults($role,\@bgs,\@links,\@images,\@logintext);
- unless ($env{'form.'.$role.'_font'} eq $defaults{'font'}) {
- $confhash->{$role}{'font'} = $env{'form.'.$role.'_font'};
- }
- if ($role eq 'login') {
- foreach my $item (@logintext) {
- unless ($env{'form.'.$role.'_'.$item} eq $defaults{'logintext'}{$item}) {
- $confhash->{$role}{$item} = $env{'form.'.$role.'_'.$item};
- }
- }
- } else {
- unless($env{'form.'.$role.'_fontmenu'} eq $defaults{'fontmenu'}) {
- $confhash->{$role}{'fontmenu'} = $env{'form.'.$role.'_fontmenu'};
- }
- }
- foreach my $item (@bgs) {
- unless ($env{'form.'.$role.'_'.$item} eq $defaults{'bgs'}{$item} ) {
- $confhash->{$role}{$item} = $env{'form.'.$role.'_'.$item};
- }
+ @bgs = ('pgbg','tabbg','sidebg');
}
- foreach my $item (@links) {
- unless ($env{'form.'.$role.'_'.$item} eq $defaults{'links'}{$item}) {
- $confhash->{$role}{$item} = $env{'form.'.$role.'_'.$item};
- }
+ $confhash->{$role}{'font'} = $env{'form.'.$role.'_font'};
+ foreach my $item (@bgs,@links,@logintext) {
+ $confhash->{$role}{$item} = $env{'form.'.$role.'_'.$item};
}
my ($configuserok,$author_ok,$switchserver) =
&config_check($dom,$confname,$servadm);
@@ -5506,7 +5446,7 @@ sub publishlogo {
# See if there is anything left
unless ($fname) { return ('error: no uploaded file'); }
$fname="$subdir/$fname";
- my $docroot=$r->dir_config('lonDocRoot');
+ my $docroot=$r->dir_config('lonDocRoot');
my $filepath="$docroot/priv";
my $relpath = "$dom/$confname";
my ($fnamepath,$file,$fetchthumb);
@@ -5514,7 +5454,7 @@ sub publishlogo {
if ($fname=~m|/|) {
($fnamepath,$file) = ($fname =~ m|^(.*)/([^/]+)$|);
}
- my @parts=split(/\//,"$filepath/$relpath/$fnamepath");
+ my @parts=split(/\//,"$filepath/$relpath/$fnamepath");
my $count;
for ($count=5;$count<=$#parts;$count++) {
$filepath.="/$parts[$count]";
@@ -5780,7 +5720,7 @@ sub modify_quotas {
%limithash,$toolregexp,%conditions,$resulttext,%changes);
if ($action eq 'quotas') {
$context = 'tools';
- } else {
+ } else {
$context = $action;
}
if ($context eq 'requestcourses') {
@@ -5998,7 +5938,7 @@ sub modify_quotas {
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime);
$resulttext = &mt('Changes made:').'
'.
- &mt('E-mail record of completed LON-CAPA updates to [_1] set to "'.
- $offon[$env{'form.reportupdates'}].'".',
- &Apache::loncommon::modal_link('http://loncapa.org/core.html',
- &mt('LON-CAPA core group - MSU'),600,500)).
- '
';
- }
$resulttext .= '
';
} else {
$resulttext = &mt('No changes made to contact information');
@@ -7110,7 +7019,7 @@ sub modify_usercreation {
if ($captchas{$cancreate{$type}}) {
$chgtext .= &mt("Validation for self-creation screen set to $captchas{$cancreate{$type}}.");
} else {
- $chgtext .= &mt('Validation for self-creation screen set to unknown type.');
+ $chgtext .= &mt('Validation for self-creation screen set to unknown type.');
}
}
} elsif ($type eq 'recaptchakeys') {
@@ -7238,7 +7147,7 @@ sub process_captcha {
$newsettings->{'captcha'} = 'original';
}
if ($current->{'captcha'} ne $newsettings->{'captcha'}) {
- if ($container eq 'cancreate') {
+ if ($container eq 'cancreate') {
if (ref($changes->{'cancreate'}) eq 'ARRAY') {
push(@{$changes->{'cancreate'}},'captcha');
} elsif (!defined($changes->{'cancreate'})) {
@@ -7277,7 +7186,7 @@ sub process_captcha {
$changes->{'cancreate'} = ['recaptchakeys'];
}
} else {
- $changes->{'recaptchakeys'} = 1;
+ $changes->{'recaptchakeys'} = 1;
}
}
return;
@@ -7404,7 +7313,7 @@ sub modify_usermodification {
}
sub modify_defaults {
- my ($dom,$r,%domconfig) = @_;
+ my ($dom,$r) = @_;
my ($resulttext,$mailmsgtxt,%newvalues,%changes,@errors);
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom);
my @items = ('auth_def','auth_arg_def','lang_def','timezone_def','datelocale_def','portal_def');
@@ -7490,17 +7399,8 @@ sub modify_defaults {
my $cachetime = 24*60*60;
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime);
if ($changes{'auth_def'} || $changes{'auth_arg_def'} || $changes{'lang_def'} || $changes{'datelocale_def'}) {
- my $notify = 1;
- if (ref($domconfig{'contacts'}) eq 'HASH') {
- if ($domconfig{'contacts'}{'reportupdates'} == 0) {
- $notify = 0;
- }
- }
- if ($notify) {
- &Apache::lonmsg::sendemail('installrecord@loncapa.org',
- "LON-CAPA Domain Settings Change - $dom",
- $mailmsgtext);
- }
+ my $sysmail = $r->dir_config('lonSysEMail');
+ &Apache::lonmsg::sendemail($sysmail,"LON-CAPA Domain Settings Change - $dom",$mailmsgtext);
}
} else {
$resulttext = &mt('No changes made to default authentication/language/timezone settings');
@@ -7970,8 +7870,8 @@ sub modify_helpsettings {
} elsif ($domconfig{'helpsettings'}{$item} ne $env{'form.'.$item}) {
$changes{$item} = 1;
}
- }
- if (($env{'form.'.$item} eq '0') || ($env{'form.'.$item} eq '1')) {
+ }
+ if (($env{'form.'.$item} eq '0') || ($env{'form.'.$item} eq '1')) {
$helphash{'helpsettings'}{$item} = $env{'form.'.$item};
}
}
@@ -8008,13 +7908,6 @@ sub modify_coursedefaults {
my ($resulttext,$errors,%changes,%defaultshash);
my %defaultchecked = ('canuse_pdfforms' => 'off');
my @toggles = ('canuse_pdfforms');
- my @numbers = ('anonsurvey_threshold','uploadquota_official','uploadquota_unofficial',
- 'uploadquota_community');
- my @types = ('official','unofficial','community');
- my %staticdefaults = (
- anonsurvey_threshold => 10,
- uploadquota => 500,
- );
$defaultshash{'coursedefaults'} = {};
@@ -8043,35 +7936,16 @@ sub modify_coursedefaults {
}
$defaultshash{'coursedefaults'}{$item} = $env{'form.'.$item};
}
- foreach my $item (@numbers) {
- my ($currdef,$newdef);
- my $newdef = $env{'form.'.$item};
- if ($item eq 'anonsurvey_threshold') {
- $currdef = $domconfig{'coursedefaults'}{$item};
- $newdef =~ s/\D//g;
- if ($newdef eq '' || $newdef < 1) {
- $newdef = 1;
- }
- $defaultshash{'coursedefaults'}{$item} = $newdef;
- } else {
- my ($type) = ($item =~ /^\Quploadquota_\E(\w+)$/);
- if (ref($domconfig{'coursedefaults'}{'uploadquota'}) eq 'HASH') {
- $currdef = $domconfig{'coursedefaults'}{'uploadquota'}{$type};
- }
- $newdef =~ s/[^\w.\-]//g;
- $defaultshash{'coursedefaults'}{'uploadquota'}{$type} = $newdef;
- }
- if ($currdef ne $newdef) {
- my $staticdef;
- if ($item eq 'anonsurvey_threshold') {
- unless (($currdef eq '') && ($newdef == $staticdefaults{$item})) {
- $changes{$item} = 1;
- }
- } else {
- unless (($currdef eq '') && ($newdef == $staticdefaults{'uploadquota'})) {
- $changes{'uploadquota'} = 1;
- }
- }
+ my $currdefresponder = $domconfig{'coursedefaults'}{'anonsurvey_threshold'};
+ my $newdefresponder = $env{'form.anonsurvey_threshold'};
+ $newdefresponder =~ s/\D//g;
+ if ($newdefresponder eq '' || $newdefresponder < 1) {
+ $newdefresponder = 1;
+ }
+ $defaultshash{'coursedefaults'}{'anonsurvey_threshold'} = $newdefresponder;
+ if ($currdefresponder ne $newdefresponder) {
+ unless ($currdefresponder eq '' && $newdefresponder == 10) {
+ $changes{'anonsurvey_threshold'} = 1;
}
}
my $officialcreds = $env{'form.official_credits'};
@@ -8097,7 +7971,7 @@ sub modify_coursedefaults {
if ($putresult eq 'ok') {
my %domdefaults;
if (keys(%changes) > 0) {
- if (($changes{'canuse_pdfforms'}) || ($changes{'coursecredits'}) || ($changes{'uploadquota'})) {
+ if (($changes{'canuse_pdfforms'}) || ($changes{'coursecredits'})) {
%domdefaults = &Apache::lonnet::get_domain_defaults($dom);
if ($changes{'canuse_pdfforms'}) {
$domdefaults{'canuse_pdfforms'}=$defaultshash{'coursedefaults'}{'canuse_pdfforms'};
@@ -8110,13 +7984,6 @@ sub modify_coursedefaults {
$defaultshash{'coursedefaults'}{'coursecredits'}{'unofficial'};
}
}
- if ($changes{'uploadquota'}) {
- if (ref($defaultshash{'coursedefaults'}{'uploadquota'}) eq 'HASH') {
- foreach my $type (@types) {
- $domdefaults{$type.'quota'}=$defaultshash{'coursedefaults'}{'uploadquota'}{$type};
- }
- }
- }
my $cachetime = 24*60*60;
&Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime);
}
@@ -8129,18 +7996,7 @@ sub modify_coursedefaults {
$resulttext .= '
'.&mt('Course/Community users can create/upload PDF forms set to "off"').'