--- loncom/interface/domainprefs.pm 2007/07/25 20:12:26 1.23
+++ loncom/interface/domainprefs.pm 2007/07/28 21:23:53 1.24
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.23 2007/07/25 20:12:26 raeburn Exp $
+# $Id: domainprefs.pm,v 1.24 2007/07/28 21:23:53 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -271,7 +271,7 @@ sub print_config_box {
');
- if ($action eq 'login') {
+ if (($action eq 'login') || ($action eq 'directorysrch')) {
$r->print('
'.$item->{'header'}->[0]->{'col1'}.' | ');
} else {
@@ -898,11 +898,17 @@ sub print_directorysrch {
my $exacton = '';
my $containson = ' checked="checked" ';
my $specifyon = '';
+ my $localon = ' ';
+ my $localoff = ' checked="checked" ';
if (ref($settings) eq 'HASH') {
if ($settings->{'available'} eq '1') {
$srchon = $srchoff;
$srchoff = ' ';
}
+ if ($settings->{'localonly'} eq '1') {
+ $localon = $localoff;
+ $localoff = ' ';
+ }
if ($settings->{'searchtypes'} eq 'exact') {
$exacton = $containson;
$containson = ' ';
@@ -917,14 +923,14 @@ sub print_directorysrch {
my $numinrow = 4;
my $datatable=' '.
- ''.&mt('Directory search available?').' | '.
+ ''.&mt('Directory search available?').' | '.
' '.
' | '.
' '.
- ''.&mt('Search latitude').' | '.
+ ''.&mt('Search latitude').' | '.
' '.
@@ -934,8 +940,15 @@ sub print_directorysrch {
$specifyon.' value="specify" />'.&mt('Specifiable type').
' | '.
''.
- ''.&mt('Users permitted to search').
- ' | ';
+ ''.&mt('Other domains can search').' | '.
+ ' '.
+ ' | '.
+ ''.
+ ''.&mt('Users allowed to search').' ('.$dom.')'.
+ ' | ';
for (my $i=0; $i<@{$types}; $i++) {
if (defined($usertypes->{$types->[$i]})) {
my $rem = $i%($numinrow);
@@ -978,9 +991,9 @@ sub print_directorysrch {
$othertitle.''.
' | ';
- $datatable .= ''.
+ $datatable .= ' '.
''.&mt('Supported search methods').
- ' | ';
+ '';
foreach my $title (@{$titleorder}) {
if (defined($searchtitles->{$title})) {
my $check = ' ';
@@ -1929,10 +1942,11 @@ sub modify_directorysrch {
}
my %title = ( available => 'Directory search available',
cansearch => 'Users permitted to search',
+ localonly => 'Other domains can search',
searchby => 'Search types',
searchtypes => 'Search latitude');
-
my @offon = ('off','on');
+ my @otherdoms = ('Yes','No');
my @cansearch = &Apache::loncommon::get_env_multiple('form.cansearch');
my @searchby = &Apache::loncommon::get_env_multiple('form.searchby');
@@ -1970,6 +1984,7 @@ sub modify_directorysrch {
my %dirsrch_hash = (
directorysrch => { available => $env{'form.dirsrch_available'},
cansearch => \@cansearch,
+ localonly => $env{'form.dirsrch_localonly'},
searchby => \@searchby,
searchtypes => $env{'form.searchtypes'},
}
@@ -1986,6 +2001,15 @@ sub modify_directorysrch {
$changes{'available'} = 1;
}
}
+ if (exists($currdirsrch{'localonly'})) {
+ if ($currdirsrch{'localonly'} ne $env{'form.dirsrch_localonly'}) {
+ $changes{'localonly'} = 1;
+ }
+ } else {
+ if ($env{'form.dirsrch_localonly'} eq '1') {
+ $changes{'localonly'} = 1;
+ }
+ }
if (exists($currdirsrch{'searchtypes'})) {
if ($currdirsrch{'searchtypes'} ne $env{'form.searchtypes'}) {
$changes{'searchtypes'} = 1;
@@ -2000,6 +2024,10 @@ sub modify_directorysrch {
if ($changes{'available'}) {
$resulttext .= ''.&mt("$title{'available'} set to: $offon[$env{'form.dirsrch_available'}]").'';
}
+ if ($changes{'localonly'}) {
+ $resulttext .= ''.&mt("$title{'localonly'} set to: $otherdoms[$env{'form.dirsrch_localonly'}]").'';
+ }
+
if (ref($changes{'cansearch'}) eq 'ARRAY') {
my ($othertitle,$usertypes,$types) = &sorted_inst_types($dom);
my $chgtext;
@@ -2013,7 +2041,7 @@ sub modify_directorysrch {
} else {
$chgtext =~ s/\; $//;
}
- $resulttext .= ''.&mt("$title{'cansearch'} set to: [_1]",$chgtext).'';
+ $resulttext .= ''.&mt("$title{'cansearch'} ([_1]) set to: [_2]",$dom,$chgtext).'';
}
if (ref($changes{'searchby'}) eq 'ARRAY') {
my ($searchtitles,$titleorder) = &sorted_searchtitles();
|
| | |