'.
''.&mt('Mapping of Shibboleth environment variable names to user data fields (SSO auth)').' | '.
''."\n".
- ''."\n";
+ ''."\n";
for (my $i=0; $i<@fields; $i++) {
$rem = $i%($numperrow);
if ($rem == 0) {
@@ -6162,7 +5535,7 @@ sub print_defaults {
1 => 'Yes, allow login then update passwd file using default cost (if higher)',
2 => 'Yes, disallow login if stored cost is less than domain default',
);
- $datatable .= '';
+ $datatable .= '';
foreach my $option (@options) {
my $checked = ' ';
my $onclick;
@@ -6298,58 +5671,6 @@ sub defaults_titles {
return (\%titles);
}
-sub print_scantron {
- my ($r,$position,$dom,$confname,$settings,$rowtotal) = @_;
- if ($position eq 'top') {
- return &print_scantronformat($r,$dom,$confname,$settings,\$rowtotal);
- } else {
- return &print_scantronconfig($dom,$settings,\$rowtotal);
- }
-}
-
-sub scantron_javascript {
- return <<"ENDSCRIPT";
-
-
-
-ENDSCRIPT
-
-}
-
sub print_scantronformat {
my ($r,$dom,$confname,$settings,$rowtotal) = @_;
my $itemcount = 1;
@@ -6376,8 +5697,8 @@ sub print_scantronformat {
if ($configuserok eq 'ok') {
if ($author_ok eq 'ok') {
my %legacyfile = (
- default => $Apache::lonnet::perlvar{'lonTabDir'}.'/default_scantronformat.tab',
- custom => $Apache::lonnet::perlvar{'lonTabDir'}.'/scantronformat.tab',
+ default => $Apache::lonnet::perlvar{'lonTabDir'}.'/default_scantronformat.tab',
+ custom => $Apache::lonnet::perlvar{'lonTabDir'}.'/scantronformat.tab',
);
my %md5chk;
foreach my $type (keys(%legacyfile)) {
@@ -6386,7 +5707,7 @@ sub print_scantronformat {
}
if ($md5chk{'default'} ne $md5chk{'custom'}) {
foreach my $type (keys(%legacyfile)) {
- ($scantronurls{$type},my $error) =
+ ($scantronurls{$type},my $error) =
&legacy_scantronformat($r,$dom,$confname,
$type,$legacyfile{$type},
$scantronurls{$type},
@@ -6397,13 +5718,13 @@ sub print_scantronformat {
}
if (keys(%error) == 0) {
$is_custom = 1;
- $confhash{'scantron'}{'scantronformat'} =
+ $confhash{'scantron'}{'scantronformat'} =
$scantronurls{'custom'};
- my $putresult =
+ my $putresult =
&Apache::lonnet::put_dom('configuration',
\%confhash,$dom);
if ($putresult ne 'ok') {
- $error{'custom'} =
+ $error{'custom'} =
''.
&mt('An error occurred updating the domain configuration: [_1]',$putresult).'';
}
@@ -6523,129 +5844,6 @@ sub legacy_scantronformat {
return ($url,$error);
}
-sub print_scantronconfig {
- my ($dom,$settings,$rowtotal) = @_;
- my $itemcount = 2;
- my $is_checked = ' checked="checked"';
- my %optionson = (
- hdr => ' checked="checked"',
- pad => ' checked="checked"',
- rem => ' checked="checked"',
- );
- my %optionsoff = (
- hdr => '',
- pad => '',
- rem => '',
- );
- my $currcsvsty = 'none';
- my ($datatable,%csvfields,%checked,%onclick,%csvoptions);
- my @fields = &scantroncsv_fields();
- my %titles = &scantronconfig_titles();
- if (ref($settings) eq 'HASH') {
- if (ref($settings->{config}) eq 'HASH') {
- if ($settings->{config}->{dat}) {
- $checked{'dat'} = $is_checked;
- }
- if (ref($settings->{config}->{csv}) eq 'HASH') {
- if (ref($settings->{config}->{csv}->{fields}) eq 'HASH') {
- %csvfields = %{$settings->{config}->{csv}->{fields}};
- if (keys(%csvfields) > 0) {
- $checked{'csv'} = $is_checked;
- $currcsvsty = 'block';
- }
- }
- if (ref($settings->{config}->{csv}->{options}) eq 'HASH') {
- %csvoptions = %{$settings->{config}->{csv}->{options}};
- foreach my $option (keys(%optionson)) {
- unless ($csvoptions{$option}) {
- $optionsoff{$option} = $optionson{$option};
- $optionson{$option} = '';
- }
- }
- }
- }
- } else {
- $checked{'dat'} = $is_checked;
- }
- } else {
- $checked{'dat'} = $is_checked;
- }
- $onclick{'csv'} = ' onclick="toggleScantron(this.form);"';
- my $css_class = $itemcount%2? ' class="LC_odd_row"':'';
- $datatable = ''.&mt('Supported formats').' | '.
- '';
- foreach my $item ('dat','csv') {
- my $id;
- if ($item eq 'csv') {
- $id = 'id="scantronconfcsv" ';
- }
- $datatable .= ''.(' 'x3);
- if ($item eq 'csv') {
- $datatable .= ''.
- '';
- $itemcount ++;
- }
- }
- $datatable .= ' | ';
- $$rowtotal ++;
- return $datatable;
-}
-
-sub scantronconfig_titles {
- return &Apache::lonlocal::texthash(
- dat => 'Standard format (.dat)',
- csv => 'Comma separated values (.csv)',
- hdr => 'Remove first line in file (contains column titles)',
- pad => 'Prepend 0s to PaperID',
- rem => 'Remove leading spaces (except Question Response columns)',
- CODE => 'CODE',
- ID => 'Student ID',
- PaperID => 'Paper ID',
- FirstName => 'First Name',
- LastName => 'Last Name',
- FirstQuestion => 'First Question Response',
- Section => 'Section',
- );
-}
-
-sub scantroncsv_fields {
- return ('PaperID','LastName','FirstName','ID','Section','CODE','FirstQuestion');
-}
-
sub print_coursecategories {
my ($position,$dom,$hdritem,$settings,$rowtotal) = @_;
my $datatable;
@@ -6688,7 +5886,7 @@ sub print_coursecategories {
''.$lt{$type}.' ';
}
- $datatable .= '';
+ $datatable .= '';
$itemcount ++;
}
$$rowtotal += $itemcount;
@@ -6899,7 +6097,7 @@ sub print_coursecategories {
$datatable .= &initialize_categories($itemcount);
}
} else {
- $datatable .= ''.$hdritem->{'header'}->[1]->{'col2'}.' | '
+ $datatable .= ''.$hdritem->{'header'}->[1]->{'col2'}.' | '
.&initialize_categories($itemcount);
}
$$rowtotal += $itemcount;
@@ -6947,7 +6145,7 @@ sub print_serverstatuses {
''.
''.
- ''."\n";
+ ''."\n";
}
$$rowtotal += $rownum;
return $datatable;
@@ -7172,7 +6370,7 @@ sub initialize_categories {
my $select1 = '';
foreach my $default ('instcode','communities') {
$css_class = $itemcount%2?' class="LC_odd_row"':'';
- $chgstr = ' onchange="javascript:reorderCats(this.form,'."'',$default"."_pos','0'".');"';
+ $chgstr = ' onchange="javascript:reorderCats(this.form,'."'','$default"."_pos','0'".');"';
if ($default eq 'communities') {
$select1 = $select0;
$select0 = '';
@@ -7197,8 +6395,9 @@ sub initialize_categories {
.''
.''
.' '
- .&mt('Add category').''.&mt('Name:')
- .' | ';
+ .&mt('Add category').'>'.&mt('Name:')
+ .' '
+ .'';
return $datatable;
}
@@ -7253,7 +6452,7 @@ sub build_category_rows {
pop(@{$path});
}
} else {
- $text .= &mt('Add subcategory:').' '.&mt('Add subcategory:').'';
+ $text .= ''.&mt('Add subcategory:').' | ';
}
}
}
@@ -7419,13 +6618,11 @@ sub modifiable_userdata_row {
}
sub insttypes_row {
- my ($settings,$types,$usertypes,$dom,$numinrow,$othertitle,$context,$rowtotal,$onclick,
- $customcss,$rowstyle) = @_;
+ my ($settings,$types,$usertypes,$dom,$numinrow,$othertitle,$context,$rownum) = @_;
my %lt = &Apache::lonlocal::texthash (
cansearch => 'Users allowed to search',
statustocreate => 'Institutional affiliation(s) able to create own account (login/SSO)',
lockablenames => 'User preference to lock name',
- overrides => "Override domain's helpdesk settings based on requester's affiliation",
);
my $showdom;
if ($context eq 'cansearch') {
@@ -7435,22 +6632,9 @@ sub insttypes_row {
if ($context eq 'statustocreate') {
$class = 'LC_right_item';
}
- my $css_class;
- if ($$rowtotal%2) {
- $css_class = 'LC_odd_row';
- }
- if ($customcss) {
- $css_class .= ' '.$customcss;
- }
- $css_class =~ s/^\s+//;
- if ($css_class) {
- $css_class = ' class="'.$css_class.'"';
- }
- if ($rowstyle) {
- $css_class .= ' style="'.$rowstyle.'"';
- }
- if ($onclick) {
- $onclick = 'onclick="'.$onclick.'" ';
+ my $css_class = ' class="LC_odd_row"';
+ if ($rownum ne '') {
+ $css_class = ($rownum%2? ' class="LC_odd_row"':'');
}
my $output = ''.
''.$lt{$context}.$showdom.
@@ -7472,10 +6656,6 @@ sub insttypes_row {
if (grep(/^\Q$types->[$i]\E$/,@{$settings->{$context}})) {
$check = ' checked="checked" ';
}
- } elsif (ref($settings->{$context}) eq 'HASH') {
- if (ref($settings->{$context}->{$types->[$i]}) eq 'HASH') {
- $check = ' checked="checked" ';
- }
} elsif ($context eq 'statustocreate') {
$check = ' checked="checked" ';
}
@@ -7490,38 +6670,29 @@ sub insttypes_row {
$rem = @{$types}%($numinrow);
}
my $colsleft = $numinrow - $rem;
- if ($context eq 'overrides') {
- if ($colsleft > 1) {
- $output .= ' | ';
- } else {
- $output .= ' | ';
- }
- $output .= ' ';
+ if ($rem == 0) {
+ $output .= ' | ';
+ }
+ if ($colsleft > 1) {
+ $output .= '';
} else {
- if (($rem == 0) && (@{$types} > 0)) {
- $output .= ' | ';
- }
- if ($colsleft > 1) {
- $output .= '';
- } else {
- $output .= ' | ';
- }
- my $defcheck = ' ';
- if (ref($settings) eq 'HASH') {
- if (ref($settings->{$context}) eq 'ARRAY') {
- if (grep(/^default$/,@{$settings->{$context}})) {
- $defcheck = ' checked="checked" ';
- }
- } elsif ($context eq 'statustocreate') {
+ $output .= ' | ';
+ }
+ my $defcheck = ' ';
+ if (ref($settings) eq 'HASH') {
+ if (ref($settings->{$context}) eq 'ARRAY') {
+ if (grep(/^default$/,@{$settings->{$context}})) {
$defcheck = ' checked="checked" ';
}
+ } elsif ($context eq 'statustocreate') {
+ $defcheck = ' checked="checked" ';
}
- $output .= '';
}
- $output .= ' | ';
+ $output .= ''.
+ ' ';
return $output;
}
@@ -8964,7 +8135,7 @@ sub modify_quotas {
my ($cdom,$cnum) = split(/_/,$key);
if (&Apache::lonnet::homeserver($cnum,$cdom) eq 'no_host') {
$errors .= ''.&mt('Image not saved: could not find textbook course').'';
- } else {
+ } else {
my ($imgurl,$error) = &process_textbook_image($r,$dom,$confname,$type.'_image_'.$i,
$cdom,$cnum,$type,$configuserok,
$switchserver,$author_ok);
@@ -9010,6 +8181,8 @@ sub modify_quotas {
if ($env{'form.'.$type.'_addbook_image.filename'} ne '') {
my ($cdom,$cnum) = split(/_/,$newbook{$type});
if (&Apache::lonnet::homeserver($cnum,$cdom) eq 'no_host') {
+ $errors .= ''.&mt('Image not saved: could not find textbook course').'';
+ } else {
my ($imageurl,$error) =
&process_textbook_image($r,$dom,$confname,$type.'_addbook_image',$cdom,$cnum,$type,
$configuserok,$switchserver,$author_ok);
@@ -9526,590 +8699,6 @@ sub process_textbook_image {
return ($url,$error);
}
-sub modify_ltitools {
- my ($r,$dom,$action,$lastactref,%domconfig) = @_;
- my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1);
- my ($newid,@allpos,%changes,%confhash,%encconfig,$errors,$resulttext);
- my $confname = $dom.'-domainconfig';
- my $servadm = $r->dir_config('lonAdmEMail');
- my ($configuserok,$author_ok,$switchserver) = &config_check($dom,$confname,$servadm);
- my (%posslti,%possfield);
- my @courseroles = ('cc','in','ta','ep','st');
- my @ltiroles = qw(Instructor ContentDeveloper TeachingAssistant Learner);
- map { $posslti{$_} = 1; } @ltiroles;
- my @allfields = ('fullname','firstname','lastname','email','user','roles');
- map { $possfield{$_} = 1; } @allfields;
- my %lt = <itools_names();
- if ($env{'form.ltitools_add'}) {
- my $title = $env{'form.ltitools_add_title'};
- $title =~ s/(`)/'/g;
- ($newid,my $error) = &get_ltitools_id($dom,$title);
- if ($newid) {
- my $position = $env{'form.ltitools_add_pos'};
- $position =~ s/\D+//g;
- if ($position ne '') {
- $allpos[$position] = $newid;
- }
- $changes{$newid} = 1;
- foreach my $item ('title','url','key','secret') {
- $env{'form.ltitools_add_'.$item} =~ s/(`)/'/g;
- if ($env{'form.ltitools_add_'.$item}) {
- if (($item eq 'key') || ($item eq 'secret')) {
- $encconfig{$newid}{$item} = $env{'form.ltitools_add_'.$item};
- } else {
- $confhash{$newid}{$item} = $env{'form.ltitools_add_'.$item};
- }
- }
- }
- if ($env{'form.ltitools_add_version'} eq 'LTI-1p0') {
- $confhash{$newid}{'version'} = $env{'form.ltitools_add_version'};
- }
- if ($env{'form.ltitools_add_msgtype'} eq 'basic-lti-launch-request') {
- $confhash{$newid}{'msgtype'} = $env{'form.ltitools_add_msgtype'};
- }
- foreach my $item ('width','height','linktext','explanation') {
- $env{'form.ltitools_add_'.$item} =~ s/^\s+//;
- $env{'form.ltitools_add_'.$item} =~ s/\s+$//;
- if (($item eq 'width') || ($item eq 'height')) {
- if ($env{'form.ltitools_add_'.$item} =~ /^\d+$/) {
- $confhash{$newid}{'display'}{$item} = $env{'form.ltitools_add_'.$item};
- }
- } else {
- if ($env{'form.ltitools_add_'.$item} ne '') {
- $confhash{$newid}{'display'}{$item} = $env{'form.ltitools_add_'.$item};
- }
- }
- }
- if ($env{'form.ltitools_add_target'} eq 'window') {
- $confhash{$newid}{'display'}{'target'} = $env{'form.ltitools_add_target'};
- } elsif ($env{'form.ltitools_add_target'} eq 'tab') {
- $confhash{$newid}{'display'}{'target'} = $env{'form.ltitools_add_target'};
- } else {
- $confhash{$newid}{'display'}{'target'} = 'iframe';
- }
- foreach my $item ('passback','roster') {
- if ($env{'form.ltitools_add_'.$item}) {
- $confhash{$newid}{$item} = 1;
- }
- }
- if ($env{'form.ltitools_add_image.filename'} ne '') {
- my ($imageurl,$error) =
- &process_ltitools_image($r,$dom,$confname,'ltitools_add_image',$newid,
- $configuserok,$switchserver,$author_ok);
- if ($imageurl) {
- $confhash{$newid}{'image'} = $imageurl;
- }
- if ($error) {
- &Apache::lonnet::logthis($error);
- $errors .= ''.$error.'';
- }
- }
- my @fields = &Apache::loncommon::get_env_multiple('form.ltitools_add_fields');
- foreach my $field (@fields) {
- if ($possfield{$field}) {
- if ($field eq 'roles') {
- foreach my $role (@courseroles) {
- my $choice = $env{'form.ltitools_add_roles_'.$role};
- if (($choice ne '') && ($posslti{$choice})) {
- $confhash{$newid}{'roles'}{$role} = $choice;
- if ($role eq 'cc') {
- $confhash{$newid}{'roles'}{'co'} = $choice;
- }
- }
- }
- } else {
- $confhash{$newid}{'fields'}{$field} = 1;
- }
- }
- }
- my @courseconfig = &Apache::loncommon::get_env_multiple('form.ltitools_courseconfig');
- foreach my $item (@courseconfig) {
- $confhash{$newid}{'crsconf'}{$item} = 1;
- }
- if ($env{'form.ltitools_add_custom'}) {
- my $name = $env{'form.ltitools_add_custom_name'};
- my $value = $env{'form.ltitools_add_custom_value'};
- $value =~ s/(`)/'/g;
- $name =~ s/(`)/'/g;
- $confhash{$newid}{'custom'}{$name} = $value;
- }
- } else {
- my $error = &mt('Failed to acquire unique ID for new external tool');
- $errors .= ''.$error.'';
- }
- }
- if (ref($domconfig{$action}) eq 'HASH') {
- my %deletions;
- my @todelete = &Apache::loncommon::get_env_multiple('form.ltitools_del');
- if (@todelete) {
- map { $deletions{$_} = 1; } @todelete;
- }
- my %customadds;
- my @newcustom = &Apache::loncommon::get_env_multiple('form.ltitools_customadd');
- if (@newcustom) {
- map { $customadds{$_} = 1; } @newcustom;
- }
- my %imgdeletions;
- my @todeleteimages = &Apache::loncommon::get_env_multiple('form.ltitools_image_del');
- if (@todeleteimages) {
- map { $imgdeletions{$_} = 1; } @todeleteimages;
- }
- my $maxnum = $env{'form.ltitools_maxnum'};
- for (my $i=0; $i<=$maxnum; $i++) {
- my $itemid = $env{'form.ltitools_id_'.$i};
- $itemid =~ s/\D+//g;
- if (ref($domconfig{$action}{$itemid}) eq 'HASH') {
- if ($deletions{$itemid}) {
- if ($domconfig{$action}{$itemid}{'image'}) {
- #FIXME need to obsolete item in RES space
- }
- $changes{$itemid} = $domconfig{$action}{$itemid}{'title'};
- next;
- } else {
- my $newpos = $env{'form.ltitools_'.$itemid};
- $newpos =~ s/\D+//g;
- foreach my $item ('title','url') {
- $confhash{$itemid}{$item} = $env{'form.ltitools_'.$item.'_'.$i};
- if ($domconfig{$action}{$itemid}{$item} ne $confhash{$itemid}{$item}) {
- $changes{$itemid} = 1;
- }
- }
- foreach my $item ('key','secret') {
- $encconfig{$itemid}{$item} = $env{'form.ltitools_'.$item.'_'.$i};
- if ($domconfig{$action}{$itemid}{$item} ne $encconfig{$itemid}{$item}) {
- $changes{$itemid} = 1;
- }
- }
- if ($env{'form.ltitools_version_'.$i} eq 'LTI-1p0') {
- $confhash{$itemid}{'version'} = $env{'form.ltitools_version_'.$i};
- }
- if ($env{'form.ltitools_msgtype_'.$i} eq 'basic-lti-launch-request') {
- $confhash{$itemid}{'msgtype'} = $env{'form.ltitools_msgtype_'.$i};
- }
- foreach my $size ('width','height') {
- $env{'form.ltitools_'.$size.'_'.$i} =~ s/^\s+//;
- $env{'form.ltitools_'.$size.'_'.$i} =~ s/\s+$//;
- if ($env{'form.ltitools_'.$size.'_'.$i} =~ /^\d+$/) {
- $confhash{$itemid}{'display'}{$size} = $env{'form.ltitools_'.$size.'_'.$i};
- if (ref($domconfig{$action}{$itemid}{'display'}) eq 'HASH') {
- if ($domconfig{$action}{$itemid}{'display'}{$size} ne $confhash{$itemid}{'display'}{$size}) {
- $changes{$itemid} = 1;
- }
- } else {
- $changes{$itemid} = 1;
- }
- } elsif (ref($domconfig{$action}{$itemid}{'display'}) eq 'HASH') {
- if ($domconfig{$action}{$itemid}{'display'}{$size} ne '') {
- $changes{$itemid} = 1;
- }
- }
- }
- foreach my $item ('linktext','explanation') {
- $env{'form.ltitools_'.$item.'_'.$i} =~ s/^\s+//;
- $env{'form.ltitools_'.$item.'_'.$i} =~ s/\s+$//;
- if ($env{'form.ltitools_'.$item.'_'.$i} ne '') {
- $confhash{$itemid}{'display'}{$item} = $env{'form.ltitools_'.$item.'_'.$i};
- if (ref($domconfig{$action}{$itemid}{'display'}) eq 'HASH') {
- if ($domconfig{$action}{$itemid}{'display'}{$item} ne $confhash{$itemid}{'display'}{$item}) {
- $changes{$itemid} = 1;
- }
- } else {
- $changes{$itemid} = 1;
- }
- } elsif (ref($domconfig{$action}{$itemid}{'display'}) eq 'HASH') {
- if ($domconfig{$action}{$itemid}{'display'}{$item} ne '') {
- $changes{$itemid} = 1;
- }
- }
- }
- if ($env{'form.ltitools_target_'.$i} eq 'window') {
- $confhash{$itemid}{'display'}{'target'} = $env{'form.ltitools_target_'.$i};
- } elsif ($env{'form.ltitools_target_'.$i} eq 'tab') {
- $confhash{$itemid}{'display'}{'target'} = $env{'form.ltitools_target_'.$i};
- } else {
- $confhash{$itemid}{'display'}{'target'} = 'iframe';
- }
- if (ref($domconfig{$action}{$itemid}{'display'}) eq 'HASH') {
- if ($domconfig{$action}{$itemid}{'display'}{'target'} ne $confhash{$itemid}{'display'}{'target'}) {
- $changes{$itemid} = 1;
- }
- } else {
- $changes{$itemid} = 1;
- }
- foreach my $extra ('passback','roster') {
- if ($env{'form.ltitools_'.$extra.'_'.$i}) {
- $confhash{$itemid}{$extra} = 1;
- }
- if ($domconfig{$action}{$itemid}{$extra} ne $confhash{$itemid}{$extra}) {
- $changes{$itemid} = 1;
- }
- }
- my @courseconfig = &Apache::loncommon::get_env_multiple('form.ltitools_courseconfig_'.$i);
- foreach my $item ('label','title','target','linktext','explanation') {
- if (grep(/^\Q$item\E$/,@courseconfig)) {
- $confhash{$itemid}{'crsconf'}{$item} = 1;
- if (ref($domconfig{$action}{$itemid}{'crsconf'}) eq 'HASH') {
- if ($domconfig{$action}{$itemid}{'crsconf'}{$item} ne $confhash{$itemid}{'crsconf'}{$item}) {
- $changes{$itemid} = 1;
- }
- } else {
- $changes{$itemid} = 1;
- }
- }
- }
- my @fields = &Apache::loncommon::get_env_multiple('form.ltitools_fields_'.$i);
- foreach my $field (@fields) {
- if ($possfield{$field}) {
- if ($field eq 'roles') {
- foreach my $role (@courseroles) {
- my $choice = $env{'form.ltitools_roles_'.$role.'_'.$i};
- if (($choice ne '') && ($posslti{$choice})) {
- $confhash{$itemid}{'roles'}{$role} = $choice;
- if ($role eq 'cc') {
- $confhash{$itemid}{'roles'}{'co'} = $choice;
- }
- }
- if (ref($domconfig{$action}{$itemid}{'roles'}) eq 'HASH') {
- if ($domconfig{$action}{$itemid}{'roles'}{$role} ne $confhash{$itemid}{'roles'}{$role}) {
- $changes{$itemid} = 1;
- }
- } elsif ($confhash{$itemid}{'roles'}{$role}) {
- $changes{$itemid} = 1;
- }
- }
- } else {
- $confhash{$itemid}{'fields'}{$field} = 1;
- if (ref($domconfig{$action}{$itemid}{'fields'}) eq 'HASH') {
- if ($domconfig{$action}{$itemid}{'fields'}{$field} ne $confhash{$itemid}{'fields'}{$field}) {
- $changes{$itemid} = 1;
- }
- } else {
- $changes{$itemid} = 1;
- }
- }
- }
- }
- $allpos[$newpos] = $itemid;
- }
- if ($imgdeletions{$itemid}) {
- $changes{$itemid} = 1;
- #FIXME need to obsolete item in RES space
- } elsif ($env{'form.ltitools_image_'.$i.'.filename'}) {
- my ($imgurl,$error) = &process_ltitools_image($r,$dom,$confname,'ltitools_image_'.$i,
- $itemid,$configuserok,$switchserver,
- $author_ok);
- if ($imgurl) {
- $confhash{$itemid}{'image'} = $imgurl;
- $changes{$itemid} = 1;
- }
- if ($error) {
- &Apache::lonnet::logthis($error);
- $errors .= ''.$error.'';
- }
- } elsif ($domconfig{$action}{$itemid}{'image'}) {
- $confhash{$itemid}{'image'} =
- $domconfig{$action}{$itemid}{'image'};
- }
- if ($customadds{$i}) {
- my $name = $env{'form.ltitools_custom_name_'.$i};
- $name =~ s/(`)/'/g;
- $name =~ s/^\s+//;
- $name =~ s/\s+$//;
- my $value = $env{'form.ltitools_custom_value_'.$i};
- $value =~ s/(`)/'/g;
- $value =~ s/^\s+//;
- $value =~ s/\s+$//;
- if ($name ne '') {
- $confhash{$itemid}{'custom'}{$name} = $value;
- $changes{$itemid} = 1;
- }
- }
- my %customdels;
- my @customdeletions = &Apache::loncommon::get_env_multiple('form.ltitools_customdel_'.$i);
- if (@customdeletions) {
- $changes{$itemid} = 1;
- }
- map { $customdels{$_} = 1; } @customdeletions;
- if (ref($domconfig{$action}{$itemid}{'custom'}) eq 'HASH') {
- foreach my $key (keys(%{$domconfig{$action}{$itemid}{'custom'}})) {
- unless ($customdels{$key}) {
- if ($env{'form.ltitools_customval_'.$key.'_'.$i} ne '') {
- $confhash{$itemid}{'custom'}{$key} = $env{'form.ltitools_customval_'.$key.'_'.$i};
- }
- if ($domconfig{$action}{$itemid}{'custom'}{$key} ne $env{'form.ltitools_customval_'.$key.'_'.$i}) {
- $changes{$itemid} = 1;
- }
- }
- }
- }
- unless ($changes{$itemid}) {
- foreach my $key (keys(%{$domconfig{$action}{$itemid}})) {
- if (ref($domconfig{$action}{$itemid}{$key}) eq 'HASH') {
- if (ref($confhash{$itemid}{$key}) eq 'HASH') {
- foreach my $innerkey (keys(%{$domconfig{$action}{$itemid}{$key}})) {
- unless (exists($confhash{$itemid}{$key}{$innerkey})) {
- $changes{$itemid} = 1;
- last;
- }
- }
- } elsif (keys(%{$domconfig{$action}{$itemid}{$key}}) > 0) {
- $changes{$itemid} = 1;
- }
- }
- last if ($changes{$itemid});
- }
- }
- }
- }
- }
- if (@allpos > 0) {
- my $idx = 0;
- foreach my $itemid (@allpos) {
- if ($itemid ne '') {
- $confhash{$itemid}{'order'} = $idx;
- if (ref($domconfig{$action}) eq 'HASH') {
- if (ref($domconfig{$action}{$itemid}) eq 'HASH') {
- if ($domconfig{$action}{$itemid}{'order'} ne $idx) {
- $changes{$itemid} = 1;
- }
- }
- }
- $idx ++;
- }
- }
- }
- my %ltitoolshash = (
- $action => { %confhash }
- );
- my $putresult = &Apache::lonnet::put_dom('configuration',\%ltitoolshash,
- $dom);
- if ($putresult eq 'ok') {
- my %ltienchash = (
- $action => { %encconfig }
- );
- &Apache::lonnet::put_dom('encconfig',\%ltienchash,$dom);
- if (keys(%changes) > 0) {
- my $cachetime = 24*60*60;
- my %ltiall = %confhash;
- foreach my $id (keys(%ltiall)) {
- if (ref($encconfig{$id}) eq 'HASH') {
- foreach my $item ('key','secret') {
- $ltiall{$id}{$item} = $encconfig{$id}{$item};
- }
- }
- }
- &Apache::lonnet::do_cache_new('ltitools',$dom,\%ltiall,$cachetime);
- if (ref($lastactref) eq 'HASH') {
- $lastactref->{'ltitools'} = 1;
- }
- $resulttext = &mt('Changes made:').'';
- my %bynum;
- foreach my $itemid (sort(keys(%changes))) {
- my $position = $confhash{$itemid}{'order'};
- $bynum{$position} = $itemid;
- }
- foreach my $pos (sort { $a <=> $b } keys(%bynum)) {
- my $itemid = $bynum{$pos};
- if (ref($confhash{$itemid}) ne 'HASH') {
- $resulttext .= '- '.&mt('Deleted: [_1]',$changes{$itemid}).'
';
- } else {
- $resulttext .= '- '.$confhash{$itemid}{'title'}.'';
- if ($confhash{$itemid}{'image'}) {
- $resulttext .= ' '.
- '
';
- }
- $resulttext .= ' ';
- my $position = $pos + 1;
- $resulttext .= '- '.&mt('Order: [_1]',$position).'
';
- foreach my $item ('version','msgtype','url') {
- if ($confhash{$itemid}{$item} ne '') {
- $resulttext .= '- '.$lt{$item}.': '.$confhash{$itemid}{$item}.'
';
- }
- }
- if ($encconfig{$itemid}{'key'} ne '') {
- $resulttext .= '- '.$lt{'key'}.': '.$encconfig{$itemid}{'key'}.'
';
- }
- if ($encconfig{$itemid}{'secret'} ne '') {
- $resulttext .= '- '.$lt{'secret'}.': ';
- my $num = length($encconfig{$itemid}{'secret'});
- $resulttext .= ('*'x$num).'
';
- }
- $resulttext .= '- '.&mt('Configurable in course:');
- my @possconfig = ('label','title','target','linktext','explanation');
- my $numconfig = 0;
- if (ref($confhash{$itemid}{'crsconf'}) eq 'HASH') {
- foreach my $item (@possconfig) {
- if ($confhash{$itemid}{'crsconf'}{$item}) {
- $numconfig ++;
- $resulttext .= ' "'.$lt{'crs'.$item}.'"';
- }
- }
- }
- if (!$numconfig) {
- $resulttext .= &mt('None');
- }
- $resulttext .= '
';
- foreach my $item ('passback','roster') {
- $resulttext .= '- '.$lt{$item}.' ';
- if ($confhash{$itemid}{$item}) {
- $resulttext .= &mt('Yes');
- } else {
- $resulttext .= &mt('No');
- }
- $resulttext .= '
';
- }
- if (ref($confhash{$itemid}{'display'}) eq 'HASH') {
- my $displaylist;
- if ($confhash{$itemid}{'display'}{'target'}) {
- $displaylist = &mt('Display target').': '.
- $confhash{$itemid}{'display'}{'target'}.',';
- }
- foreach my $size ('width','height') {
- if ($confhash{$itemid}{'display'}{$size}) {
- $displaylist .= (' 'x2).$lt{$size}.': '.
- $confhash{$itemid}{'display'}{$size}.',';
- }
- }
- if ($displaylist) {
- $displaylist =~ s/,$//;
- $resulttext .= '- '.$displaylist.'
';
- }
- foreach my $item ('linktext','explanation') {
- if ($confhash{$itemid}{'display'}{$item}) {
- $resulttext .= '- '.$lt{$item}.': '.$confhash{$itemid}{'display'}{$item}.'
';
- }
- }
- }
- if (ref($confhash{$itemid}{'fields'}) eq 'HASH') {
- my $fieldlist;
- foreach my $field (@allfields) {
- if ($confhash{$itemid}{'fields'}{$field}) {
- $fieldlist .= (' 'x2).$lt{$field}.',';
- }
- }
- if ($fieldlist) {
- $fieldlist =~ s/,$//;
- $resulttext .= '- '.&mt('Data sent').':'.$fieldlist.'
';
- }
- }
- if (ref($confhash{$itemid}{'roles'}) eq 'HASH') {
- my $rolemaps;
- foreach my $role (@courseroles) {
- if ($confhash{$itemid}{'roles'}{$role}) {
- $rolemaps .= (' 'x2).&Apache::lonnet::plaintext($role,'Course').'='.
- $confhash{$itemid}{'roles'}{$role}.',';
- }
- }
- if ($rolemaps) {
- $rolemaps =~ s/,$//;
- $resulttext .= '- '.&mt('Role mapping:').$rolemaps.'
';
- }
- }
- if (ref($confhash{$itemid}{'custom'}) eq 'HASH') {
- my $customlist;
- if (keys(%{$confhash{$itemid}{'custom'}})) {
- foreach my $key (sort(keys(%{$confhash{$itemid}{'custom'}}))) {
- $customlist .= $key.':'.$confhash{$itemid}{'custom'}{$key}.(' 'x2);
- }
- }
- if ($customlist) {
- $resulttext .= '- '.&mt('Custom items').':'.$customlist.'
';
- }
- }
- $resulttext .= ' ';
- }
- }
- $resulttext .= ' ';
- } else {
- $resulttext = &mt('No changes made.');
- }
- } else {
- $errors .= ''.&mt('Failed to save changes').'';
- }
- if ($errors) {
- $resulttext .= &mt('The following errors occurred: ').'';
- }
- return $resulttext;
-}
-
-sub process_ltitools_image {
- my ($r,$dom,$confname,$caller,$itemid,$configuserok,$switchserver,$author_ok) = @_;
- my $filename = $env{'form.'.$caller.'.filename'};
- my ($error,$url);
- my ($width,$height) = (21,21);
- if ($configuserok eq 'ok') {
- if ($switchserver) {
- $error = &mt('Upload of Tool Provider (LTI) icon is not permitted to this server: [_1]',
- $switchserver);
- } elsif ($author_ok eq 'ok') {
- my ($result,$imageurl,$madethumb) =
- &publishlogo($r,'upload',$caller,$dom,$confname,
- "ltitools/$itemid/icon",$width,$height);
- if ($result eq 'ok') {
- if ($madethumb) {
- my ($path,$imagefile) = ($imageurl =~ m{^(.+)/([^/]+)$});
- my $imagethumb = "$path/tn-".$imagefile;
- $url = $imagethumb;
- } else {
- $url = $imageurl;
- }
- } else {
- $error = &mt("Upload of [_1] failed because an error occurred publishing the file in RES space. Error was: [_2].",$filename,$result);
- }
- } else {
- $error = &mt("Upload of [_1] failed because an author role could not be assigned to a Domain Configuration user ([_2]) in domain: [_3]. Error was: [_4].",$filename,$confname,$dom,$author_ok);
- }
- } else {
- $error = &mt("Upload of [_1] failed because a Domain Configuration user ([_2]) could not be created in domain: [_3]. Error was: [_4].",$filename,$confname,$dom,$configuserok);
- }
- return ($url,$error);
-}
-
-sub get_ltitools_id {
- my ($cdom,$title) = @_;
- # get lock on ltitools db
- my $lockhash = {
- lock => $env{'user.name'}.
- ':'.$env{'user.domain'},
- };
- my $tries = 0;
- my $gotlock = &Apache::lonnet::newput_dom('ltitools',$lockhash,$cdom);
- my ($id,$error);
-
- while (($gotlock ne 'ok') && ($tries<10)) {
- $tries ++;
- sleep (0.1);
- $gotlock = &Apache::lonnet::newput_dom('ltitools',$lockhash,$cdom);
- }
- if ($gotlock eq 'ok') {
- my %currids = &Apache::lonnet::dump_dom('ltitools',$cdom);
- if ($currids{'lock'}) {
- delete($currids{'lock'});
- if (keys(%currids)) {
- my @curr = sort { $a <=> $b } keys(%currids);
- if ($curr[-1] =~ /^\d+$/) {
- $id = 1 + $curr[-1];
- }
- } else {
- $id = 1;
- }
- if ($id) {
- unless (&Apache::lonnet::newput_dom('ltitools',{ $id => $title },$cdom) eq 'ok') {
- $error = 'nostore';
- }
- } else {
- $error = 'nonumber';
- }
- }
- my $dellockoutcome = &Apache::lonnet::del_dom('ltitools',['lock'],$cdom);
- } else {
- $error = 'nolock';
- }
- return ($id,$error);
-}
-
sub modify_autoenroll {
my ($dom,$lastactref,%domconfig) = @_;
my ($resulttext,%changes);
@@ -10735,57 +9324,17 @@ sub modify_contacts {
my $value = $env{'form.helpform_'.$field};
$value =~ s/^\s+|\s+$//g;
if (grep(/^\Q$value\E$/,@{$possoptions->{$field}})) {
- $contacts_hash{'contacts'}{'helpform'}{$field} = $value;
+ $contacts_hash{contacts}{'helpform'}{$field} = $value;
if ($field eq 'screenshot') {
$env{'form.helpform_maxsize'} =~ s/^\s+|\s+$//g;
if ($env{'form.helpform_maxsize'} =~ /^\d+\.?\d*$/) {
- $contacts_hash{'contacts'}{'helpform'}{'maxsize'} = $env{'form.helpform_maxsize'};
+ $contacts_hash{contacts}{'helpform'}{'maxsize'} = $env{'form.helpform_maxsize'};
}
}
}
}
}
}
- my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom);
- my (@statuses,%usertypeshash,@overrides);
- if ((ref($types) eq 'ARRAY') && (@{$types} > 0)) {
- @statuses = @{$types};
- if (ref($usertypes) eq 'HASH') {
- %usertypeshash = %{$usertypes};
- }
- }
- if (@statuses) {
- my @possoverrides = &Apache::loncommon::get_env_multiple('form.overrides');
- foreach my $type (@possoverrides) {
- if (($type ne '') && (grep(/^\Q$type\E$/,@statuses))) {
- push(@overrides,$type);
- }
- }
- if (@overrides) {
- foreach my $type (@overrides) {
- my @standard = &Apache::loncommon::get_env_multiple('form.override_'.$type);
- foreach my $item (@contacts) {
- if (grep(/^\Q$item\E$/,@standard)) {
- $contacts_hash{'contacts'}{'overrides'}{$type}{$item} = 1;
- $newsetting{'override_'.$type}{$item} = 1;
- } else {
- $contacts_hash{'contacts'}{'overrides'}{$type}{$item} = 0;
- $newsetting{'override_'.$type}{$item} = 0;
- }
- }
- $contacts_hash{'contacts'}{'overrides'}{$type}{'others'} = $env{'form.override_'.$type.'_others'};
- $contacts_hash{'contacts'}{'overrides'}{$type}{'bcc'} = $env{'form.override_'.$type.'_bcc'};
- $newsetting{'override_'.$type}{'others'} = $env{'form.override_'.$type.'_others'};
- $newsetting{'override_'.$type}{'bcc'} = $env{'form.override_'.$type.'_bcc'};
- if (($env{'form.override_'.$type.'_includestr'} ne '') && ($env{'form.override_'.$type.'_includeloc'} =~ /^s|b$/)) {
- $includestr{$type} = $env{'form.override_'.$type.'_includestr'};
- $includeloc{$type} = $env{'form.override_'.$type.'_includeloc'};
- $contacts_hash{'contacts'}{'overrides'}{$type}{'include'} = $includeloc{$type}.':'.&escape($includestr{$type});
- $newsetting{'override_'.$type}{'include'} = $contacts_hash{'contacts'}{'overrides'}{$type}{'include'};
- }
- }
- }
- }
if (keys(%currsetting) > 0) {
foreach my $item (@contacts) {
if ($to{$item} ne $currsetting{$item}) {
@@ -10840,33 +9389,6 @@ sub modify_contacts {
}
}
}
- if (@statuses) {
- if (ref($currsetting{'overrides'}) eq 'HASH') {
- foreach my $key (keys(%{$currsetting{'overrides'}})) {
- if (ref($currsetting{'overrides'}{$key}) eq 'HASH') {
- if (ref($newsetting{'override_'.$key}) eq 'HASH') {
- foreach my $item (@contacts,'bcc','others','include') {
- if ($currsetting{'overrides'}{$key}{$item} ne $newsetting{'override_'.$key}{$item}) {
- push(@{$changes{'overrides'}},$key);
- last;
- }
- }
- } else {
- push(@{$changes{'overrides'}},$key);
- }
- }
- }
- foreach my $key (@overrides) {
- unless (exists($currsetting{'overrides'}{$key})) {
- push(@{$changes{'overrides'}},$key);
- }
- }
- } else {
- foreach my $key (@overrides) {
- push(@{$changes{'overrides'}},$key);
- }
- }
- }
} else {
my %default;
$default{'supportemail'} = $Apache::lonnet::perlvar{'lonSupportEMail'};
@@ -10981,60 +9503,6 @@ sub modify_contacts {
$resulttext .= '';
}
}
- if (ref($changes{'overrides'}) eq 'ARRAY') {
- my @deletions;
- foreach my $type (@{$changes{'overrides'}}) {
- if ($usertypeshash{$type}) {
- if (grep(/^\Q$type\E/,@overrides)) {
- $resulttext .= ''.&mt("Overrides based on requester's affiliation set for [_1]",
- $usertypeshash{$type}).'- ';
- if (ref($newsetting{'override_'.$type}) eq 'HASH') {
- my @text;
- foreach my $item (@contacts) {
- if ($newsetting{'override_'.$type}{$item}) {
- push(@text,$short_titles->{$item});
- }
- }
- if ($newsetting{'override_'.$type}{'others'} ne '') {
- push(@text,$newsetting{'override_'.$type}{'others'});
- }
-
- if (@text) {
- $resulttext .= &mt('Helpdesk e-mail sent to: [_1]',
- ''.join(', ',@text).'');
- }
- if ($newsetting{'override_'.$type}{'bcc'} ne '') {
- my $bcctext;
- if (@text) {
- $bcctext = ' '.&mt('with Bcc to');
- } else {
- $bcctext = '(Bcc)';
- }
- $resulttext .= $bcctext.': '.$newsetting{'override_'.$type}{'bcc'}.'';
- } elsif (!@text) {
- $resulttext .= &mt('Helpdesk e-mail sent to no one');
- }
- $resulttext .= '
';
- if ($newsetting{'override_'.$type}{'include'} ne '') {
- my ($loc,$str) = split(/:/,$newsetting{'override_'.$type}{'include'});
- if ($loc eq 'b') {
- $resulttext .= '- '.&mt('Text automatically added to e-mail body:').' '.&unescape($str).'
';
- } elsif ($loc eq 's') {
- $resulttext .= '- '.&mt('Text automatically added to e-mail subject:').' '.&unescape($str).'
';
- }
- }
- }
- $resulttext .= ' ';
- } else {
- push(@deletions,$usertypeshash{$type});
- }
- }
- }
- if (@deletions) {
- $resulttext .= ''.&mt("Overrides based on requester's affiliation discontinued for: [_1]",
- join(', ',@deletions)).'';
- }
- }
my @offon = ('off','on');
if ($changes{'reporterrors'}) {
$resulttext .= ''.
@@ -11090,6 +9558,7 @@ sub modify_contacts {
&mt('Max size for file uploaded to help form by logged-in user set to [_1] MB.',
$contacts_hash{'contacts'}{'helpform'}{'maxsize'}).
'';
+
}
}
$resulttext .= '';
@@ -12404,7 +10873,7 @@ sub modify_scantron {
my $custom = 'custom.tab';
my $default = 'default.tab';
my $servadm = $r->dir_config('lonAdmEMail');
- my ($configuserok,$author_ok,$switchserver) =
+ my ($configuserok,$author_ok,$switchserver) =
&config_check($dom,$confname,$servadm);
if ($env{'form.scantronformat.filename'} ne '') {
my $error;
@@ -12439,67 +10908,6 @@ sub modify_scantron {
if ($env{'form.scantronformat_del'}) {
$confhash{'scantron'}{'scantronformat'} = '';
$changes{'scantronformat'} = 1;
- } else {
- $confhash{'scantron'}{'scantronformat'} = $domconfig{'scantron'}{'scantronformat'};
- }
- }
- }
- my @options = ('hdr','pad','rem');
- my @fields = &scantroncsv_fields();
- my %titles = &scantronconfig_titles();
- my @formats = &Apache::loncommon::get_env_multiple('form.scantronconfig');
- my ($newdat,$currdat,%newcol,%currcol);
- if (grep(/^dat$/,@formats)) {
- $confhash{'scantron'}{config}{dat} = 1;
- $newdat = 1;
- } else {
- $newdat = 0;
- }
- if (grep(/^csv$/,@formats)) {
- my %bynum;
- foreach my $field (@fields) {
- if ($env{'form.scantronconfig_csv_'.$field} =~ /^(\d+)$/) {
- my $posscol = $1;
- if (($posscol < 20) && (!$bynum{$posscol})) {
- $confhash{'scantron'}{config}{csv}{fields}{$field} = $posscol;
- $bynum{$posscol} = $field;
- $newcol{$field} = $posscol;
- }
- }
- }
- if (keys(%newcol)) {
- foreach my $option (@options) {
- if ($env{'form.scantroncsv_'.$option}) {
- $confhash{'scantron'}{config}{csv}{options}{$option} = 1;
- }
- }
- }
- }
- $currdat = 1;
- if (ref($domconfig{'scantron'}) eq 'HASH') {
- if (ref($domconfig{'scantron'}{'config'}) eq 'HASH') {
- unless (exists($domconfig{'scantron'}{'config'}{'dat'})) {
- $currdat = 0;
- }
- if (ref($domconfig{'scantron'}{'config'}{'csv'}) eq 'HASH') {
- if (ref($domconfig{'scantron'}{'config'}{'csv'}{'fields'}) eq 'HASH') {
- %currcol = %{$domconfig{'scantron'}{'config'}{'csv'}{'fields'}};
- }
- }
- }
- }
- if ($currdat != $newdat) {
- $changes{'config'} = 1;
- } else {
- foreach my $field (@fields) {
- if ($currcol{$field} ne '') {
- if ($currcol{$field} ne $newcol{$field}) {
- $changes{'config'} = 1;
- last;
- }
- } elsif ($newcol{$field} ne '') {
- $changes{'config'} = 1;
- last;
}
}
}
@@ -12510,64 +10918,29 @@ sub modify_scantron {
if (keys(%changes) > 0) {
if (ref($confhash{'scantron'}) eq 'HASH') {
$resulttext = &mt('Changes made:').'';
- if ($changes{'scantronformat'}) {
- if ($confhash{'scantron'}{'scantronformat'} eq '') {
- $resulttext .= '- '.&mt('[_1] bubblesheet format file removed; [_2] file will be used for courses in this domain.',$custom,$default).'
';
- } else {
- $resulttext .= '- '.&mt('Custom bubblesheet format file ([_1]) uploaded for use with courses in this domain.',$custom).'
';
- }
- }
- if ($changes{'config'}) {
- if (ref($confhash{'scantron'}{'config'}) eq 'HASH') {
- if ($confhash{'scantron'}{'config'}{'dat'}) {
- $resulttext .= '- '.&mt('Bubblesheet data upload formats includes .dat format').'
';
- }
- if (ref($confhash{'scantron'}{'config'}{'csv'}) eq 'HASH') {
- if (ref($confhash{'scantron'}{'config'}{'csv'}{'fields'}) eq 'HASH') {
- if (keys(%{$confhash{'scantron'}{'config'}{'csv'}{'fields'}})) {
- $resulttext .= '- '.&mt('Bubblesheet data upload formats includes .csv format, with following fields/column numbers supported:').'
';
- foreach my $field (@fields) {
- if ($confhash{'scantron'}{'config'}{'csv'}{'fields'}{$field} ne '') {
- my $showcol = $confhash{'scantron'}{'config'}{'csv'}{'fields'}{$field} + 1;
- $resulttext .= '- '.$titles{$field}.': '.$showcol.'
';
- }
- }
- $resulttext .= ' ';
- if (ref($confhash{'scantron'}{'config'}{'csv'}{'options'}) eq 'HASH') {
- if (keys(%{$confhash{'scantron'}{'config'}{'csv'}{'options'}})) {
- $resulttext .= '- '.&mt('Bubblesheet data upload formats includes .csv format, with following options:').'
';
- foreach my $option (@options) {
- if ($confhash{'scantron'}{'config'}{'csv'}{'options'}{$option} ne '') {
- $resulttext .= '- '.$titles{$option}.'
';
- }
- }
- $resulttext .= ' ';
- }
- }
- }
- }
- }
- } else {
- $resulttext .= '- '.&mt('No bubblesheet data upload formats set -- will default to assuming .dat format').'
';
- }
+ if ($confhash{'scantron'}{'scantronformat'} eq '') {
+ $resulttext .= '- '.&mt('[_1] bubblesheet format file removed; [_2] file will be used for courses in this domain.',$custom,$default).'
';
+ } else {
+ $resulttext .= '- '.&mt('Custom bubblesheet format file ([_1]) uploaded for use with courses in this domain.',$custom).'
';
}
$resulttext .= ' ';
} else {
$resulttext = &mt('Changes made to bubblesheet format file.');
}
+ $resulttext .= '';
&Apache::loncommon::devalidate_domconfig_cache($dom);
if (ref($lastactref) eq 'HASH') {
$lastactref->{'domainconfig'} = 1;
}
} else {
- $resulttext = &mt('No changes made to bubblesheet format settings');
+ $resulttext = &mt('No changes made to bubblesheet format file');
}
} else {
$resulttext = ''.
&mt('An error occurred: [_1]',$putresult).'';
}
} else {
- $resulttext = &mt('No changes made to bubblesheet format settings');
+ $resulttext = &mt('No changes made to bubblesheet format file');
}
if ($errors) {
$resulttext .= &mt('The following errors occurred: ').''.
@@ -15215,7 +13588,7 @@ sub devalidate_remote_domconfs {
my %servers = &Apache::lonnet::internet_dom_servers($dom);
my %thismachine;
map { $thismachine{$_} = 1; } &Apache::lonnet::current_machine_ids();
- my @posscached = ('domainconfig','domdefaults','ltitools','usersessions','directorysrch');
+ my @posscached = ('domainconfig','domdefaults','usersessions','directorysrch');
if (keys(%servers)) {
foreach my $server (keys(%servers)) {
next if ($thismachine{$server});
|
|