version 1.23, 2007/07/25 20:12:26
|
version 1.24, 2007/07/28 21:23:53
|
Line 271 sub print_config_box {
|
Line 271 sub print_config_box {
|
<td> |
<td> |
<table class="LC_nested"> |
<table class="LC_nested"> |
<tr class="LC_info_row">'); |
<tr class="LC_info_row">'); |
if ($action eq 'login') { |
if (($action eq 'login') || ($action eq 'directorysrch')) { |
$r->print(' |
$r->print(' |
<td class="LC_left_item" colspan="2">'.$item->{'header'}->[0]->{'col1'}.'</td>'); |
<td class="LC_left_item" colspan="2">'.$item->{'header'}->[0]->{'col1'}.'</td>'); |
} else { |
} else { |
Line 898 sub print_directorysrch {
|
Line 898 sub print_directorysrch {
|
my $exacton = ''; |
my $exacton = ''; |
my $containson = ' checked="checked" '; |
my $containson = ' checked="checked" '; |
my $specifyon = ''; |
my $specifyon = ''; |
|
my $localon = ' '; |
|
my $localoff = ' checked="checked" '; |
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
if ($settings->{'available'} eq '1') { |
if ($settings->{'available'} eq '1') { |
$srchon = $srchoff; |
$srchon = $srchoff; |
$srchoff = ' '; |
$srchoff = ' '; |
} |
} |
|
if ($settings->{'localonly'} eq '1') { |
|
$localon = $localoff; |
|
$localoff = ' '; |
|
} |
if ($settings->{'searchtypes'} eq 'exact') { |
if ($settings->{'searchtypes'} eq 'exact') { |
$exacton = $containson; |
$exacton = $containson; |
$containson = ' '; |
$containson = ' '; |
Line 917 sub print_directorysrch {
|
Line 923 sub print_directorysrch {
|
|
|
my $numinrow = 4; |
my $numinrow = 4; |
my $datatable='<tr class="LC_odd_row">'. |
my $datatable='<tr class="LC_odd_row">'. |
'<td>'.&mt('Directory search available?').'</td>'. |
'<td colspan="2">'.&mt('Directory search available?').'</td>'. |
'<td class="LC_right_item"><span class="LC_nobreak"><label>'. |
'<td class="LC_right_item"><span class="LC_nobreak"><label>'. |
'<input type="radio" name="dirsrch_available"'. |
'<input type="radio" name="dirsrch_available"'. |
$srchon.' value="1" />'.&mt('Yes').'</label> '. |
$srchon.' value="1" />'.&mt('Yes').'</label> '. |
'<label><input type="radio" name="dirsrch_available"'. |
'<label><input type="radio" name="dirsrch_available"'. |
$srchoff.' value="0" />'.&mt('No').'</label></span></td>'. |
$srchoff.' value="0" />'.&mt('No').'</label></span></td>'. |
'</tr><tr>'. |
'</tr><tr>'. |
'<td>'.&mt('Search latitude').'</td>'. |
'<td colspan="2">'.&mt('Search latitude').'</td>'. |
'<td class="LC_right_item"><span class="LC_nobreak"><label>'. |
'<td class="LC_right_item"><span class="LC_nobreak"><label>'. |
'<input type="radio" name="searchtypes"'. |
'<input type="radio" name="searchtypes"'. |
$exacton.' value="exact" />'.&mt('Exact match only').'</label> '. |
$exacton.' value="exact" />'.&mt('Exact match only').'</label> '. |
Line 934 sub print_directorysrch {
|
Line 940 sub print_directorysrch {
|
$specifyon.' value="specify" />'.&mt('Specifiable type'). |
$specifyon.' value="specify" />'.&mt('Specifiable type'). |
'</label></span></td></tr>'. |
'</label></span></td></tr>'. |
'<tr class="LC_odd_row">'. |
'<tr class="LC_odd_row">'. |
'<td>'.&mt('Users permitted to search'). |
'<td colspan="2">'.&mt('Other domains can search').'</td>'. |
'</td><td class="LC_left_item"><table>'; |
'<td class="LC_right_item"><span class="LC_nobreak"><label>'. |
|
'<input type="radio" name="dirsrch_localonly"'. |
|
$localoff.' value="0" />'.&mt('Yes').'</label> '. |
|
'<label><input type="radio" name="dirsrch_localonly"'. |
|
$localon.' value="1" />'.&mt('No').'</label></span></td>'. |
|
'</tr><tr>'. |
|
'<td>'.&mt('Users allowed to search').' ('.$dom.')'. |
|
'</td><td class="LC_left_item" colspan="2"><table>'; |
for (my $i=0; $i<@{$types}; $i++) { |
for (my $i=0; $i<@{$types}; $i++) { |
if (defined($usertypes->{$types->[$i]})) { |
if (defined($usertypes->{$types->[$i]})) { |
my $rem = $i%($numinrow); |
my $rem = $i%($numinrow); |
Line 978 sub print_directorysrch {
|
Line 991 sub print_directorysrch {
|
$othertitle.'</label></span></td>'. |
$othertitle.'</label></span></td>'. |
'</tr></table></td></tr>'; |
'</tr></table></td></tr>'; |
|
|
$datatable .= '<tr>'. |
$datatable .= '<tr class="LC_odd_row">'. |
'<td>'.&mt('Supported search methods'). |
'<td>'.&mt('Supported search methods'). |
'</td><td class="LC_left_item"><table><tr>'; |
'</td><td class="LC_left_item" colspan="2"><table><tr>'; |
foreach my $title (@{$titleorder}) { |
foreach my $title (@{$titleorder}) { |
if (defined($searchtitles->{$title})) { |
if (defined($searchtitles->{$title})) { |
my $check = ' '; |
my $check = ' '; |
Line 1929 sub modify_directorysrch {
|
Line 1942 sub modify_directorysrch {
|
} |
} |
my %title = ( available => 'Directory search available', |
my %title = ( available => 'Directory search available', |
cansearch => 'Users permitted to search', |
cansearch => 'Users permitted to search', |
|
localonly => 'Other domains can search', |
searchby => 'Search types', |
searchby => 'Search types', |
searchtypes => 'Search latitude'); |
searchtypes => 'Search latitude'); |
|
|
my @offon = ('off','on'); |
my @offon = ('off','on'); |
|
my @otherdoms = ('Yes','No'); |
|
|
my @cansearch = &Apache::loncommon::get_env_multiple('form.cansearch'); |
my @cansearch = &Apache::loncommon::get_env_multiple('form.cansearch'); |
my @searchby = &Apache::loncommon::get_env_multiple('form.searchby'); |
my @searchby = &Apache::loncommon::get_env_multiple('form.searchby'); |
Line 1970 sub modify_directorysrch {
|
Line 1984 sub modify_directorysrch {
|
my %dirsrch_hash = ( |
my %dirsrch_hash = ( |
directorysrch => { available => $env{'form.dirsrch_available'}, |
directorysrch => { available => $env{'form.dirsrch_available'}, |
cansearch => \@cansearch, |
cansearch => \@cansearch, |
|
localonly => $env{'form.dirsrch_localonly'}, |
searchby => \@searchby, |
searchby => \@searchby, |
searchtypes => $env{'form.searchtypes'}, |
searchtypes => $env{'form.searchtypes'}, |
} |
} |
Line 1986 sub modify_directorysrch {
|
Line 2001 sub modify_directorysrch {
|
$changes{'available'} = 1; |
$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 (exists($currdirsrch{'searchtypes'})) { |
if ($currdirsrch{'searchtypes'} ne $env{'form.searchtypes'}) { |
if ($currdirsrch{'searchtypes'} ne $env{'form.searchtypes'}) { |
$changes{'searchtypes'} = 1; |
$changes{'searchtypes'} = 1; |
Line 2000 sub modify_directorysrch {
|
Line 2024 sub modify_directorysrch {
|
if ($changes{'available'}) { |
if ($changes{'available'}) { |
$resulttext .= '<li>'.&mt("$title{'available'} set to: $offon[$env{'form.dirsrch_available'}]").'</li>'; |
$resulttext .= '<li>'.&mt("$title{'available'} set to: $offon[$env{'form.dirsrch_available'}]").'</li>'; |
} |
} |
|
if ($changes{'localonly'}) { |
|
$resulttext .= '<li>'.&mt("$title{'localonly'} set to: $otherdoms[$env{'form.dirsrch_localonly'}]").'</li>'; |
|
} |
|
|
if (ref($changes{'cansearch'}) eq 'ARRAY') { |
if (ref($changes{'cansearch'}) eq 'ARRAY') { |
my ($othertitle,$usertypes,$types) = &sorted_inst_types($dom); |
my ($othertitle,$usertypes,$types) = &sorted_inst_types($dom); |
my $chgtext; |
my $chgtext; |
Line 2013 sub modify_directorysrch {
|
Line 2041 sub modify_directorysrch {
|
} else { |
} else { |
$chgtext =~ s/\; $//; |
$chgtext =~ s/\; $//; |
} |
} |
$resulttext .= '<li>'.&mt("$title{'cansearch'} set to: [_1]",$chgtext).'</li>'; |
$resulttext .= '<li>'.&mt("$title{'cansearch'} ([_1]) set to: [_2]",$dom,$chgtext).'</li>'; |
} |
} |
if (ref($changes{'searchby'}) eq 'ARRAY') { |
if (ref($changes{'searchby'}) eq 'ARRAY') { |
my ($searchtitles,$titleorder) = &sorted_searchtitles(); |
my ($searchtitles,$titleorder) = &sorted_searchtitles(); |