[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonsearchcat.pm
raeburn
raeburn at source.lon-capa.org
Wed Nov 9 14:37:39 EST 2016
raeburn Wed Nov 9 19:37:39 2016 EDT
Modified files: (Branch: version_2_11_X)
/loncom/interface lonsearchcat.pm
Log:
- For 2.11
- Backport 1.350
Index: loncom/interface/lonsearchcat.pm
diff -u loncom/interface/lonsearchcat.pm:1.331.4.12 loncom/interface/lonsearchcat.pm:1.331.4.13
--- loncom/interface/lonsearchcat.pm:1.331.4.12 Thu Aug 4 21:23:57 2016
+++ loncom/interface/lonsearchcat.pm Wed Nov 9 19:37:39 2016
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Search Catalog
#
-# $Id: lonsearchcat.pm,v 1.331.4.12 2016/08/04 21:23:57 raeburn Exp $
+# $Id: lonsearchcat.pm,v 1.331.4.13 2016/11/09 19:37:39 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -479,14 +479,31 @@
.&mt('use related words')
.'</label>';
+ my $anydom = 1;
+ if ($area eq 'res') {
+ unless (&Apache::lonnet::allowed('bre','/res/') eq 'F') {
+ $anydom = 0;
+ }
+ }
+ my $singledom;
+ my ($disabled,$checked);
+ if ($anydom) {
+ $singledom = $r->dir_config('lonDefDomain');
+ if ($env{'form.domains'} eq $singledom) {
+ $checked = 1;
+ }
+ } else {
+ $singledom = $env{'user.domain'};
+ $disabled = ' disabled="disabled"';
+ $checked = 1;
+ }
$onlysearchdomain = '<label>'
.&Apache::lonhtmlcommon::checkbox(
- 'domains',
- $env{'form.domains'},
- $r->dir_config('lonDefDomain'))
+ 'domains',$checked,
+ $singledom,$disabled)
.' '
.&mt('only search domain [_1]'
- ,'<b>'.$r->dir_config('lonDefDomain').'</b>')
+ ,'<b>'.$singledom.'</b>')
.'</label>';
$adv_search_link = '<a href="/adm/searchcat?'.
@@ -661,10 +678,22 @@
$env{'form.category'})
.&Apache::lonhtmlcommon::row_closure();
- $scrout .= &Apache::lonhtmlcommon::row_title(&titlefield(&mt('Domains')))
- .&Apache::loncommon::domain_select('domains',
- $env{'form.domains'},1)
- .&Apache::lonhtmlcommon::row_closure();
+ my $anydomain = 1;
+ if ($env{'form.area'} ne 'portfolio') {
+ unless (&Apache::lonnet::allowed('bre','/res/')) {
+ $anydomain = 0;
+ }
+ }
+
+ $scrout .= &Apache::lonhtmlcommon::row_title(&titlefield(&mt('Domains')));
+ if ($anydomain) {
+ $scrout .= &Apache::loncommon::domain_select('domains',
+ $env{'form.domains'},1);
+ } else {
+ $scrout .= &Apache::loncommon::select_dom_form($env{'user.domain'},
+ 'domains','','','',[$env{'user.domain'}],'',1);
+ }
+ $scrout .= &Apache::lonhtmlcommon::row_closure();
# Misc metadata
if ($env{'form.area'} ne 'portfolio') {
More information about the LON-CAPA-cvs
mailing list