[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface coursecatalog.pm
raeburn
raeburn at source.lon-capa.org
Sun Oct 23 17:21:56 EDT 2016
raeburn Sun Oct 23 21:21:56 2016 EDT
Modified files: (Branch: version_2_11_X)
/loncom/interface coursecatalog.pm
Log:
- For 2.11
Backport 1.90
Index: loncom/interface/coursecatalog.pm
diff -u loncom/interface/coursecatalog.pm:1.88 loncom/interface/coursecatalog.pm:1.88.2.1
--- loncom/interface/coursecatalog.pm:1.88 Tue Jun 9 21:22:55 2015
+++ loncom/interface/coursecatalog.pm Sun Oct 23 21:21:56 2016
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler for displaying the course catalog interface
#
-# $Id: coursecatalog.pm,v 1.88 2015/06/09 21:22:55 damieng Exp $
+# $Id: coursecatalog.pm,v 1.88.2.1 2016/10/23 21:21:56 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -80,7 +80,7 @@
my %domconfig =
&Apache::lonnet::get_dom('configuration',['coursecategories'],$codedom);
my $knownuser = &user_is_known();
- my $canviewall = &canview_all();
+ my $canviewall = &canview_all($knownuser,$codedom);
my ($cathash,$cattype);
if (ref($domconfig{'coursecategories'}) eq 'HASH') {
@@ -742,7 +742,6 @@
$showhidden_status = 'checked="checked" ';
}
my @currstatuses = &Apache::loncommon::get_env_multiple('form.showcounts');
- my $dc_title = &Apache::lonnet::plaintext('dc');
my ($details_text,$hidden_text,$statusdisplay,$cellborder);
my $wasactivedisplay = 'none';
if ($env{'form.showdetails'}) {
@@ -756,11 +755,11 @@
$cellborder = 'border-left: 0px';
}
if ($env{'form.currcat_0'} eq 'communities::0') {
- $details_text = &mt('Show full details for each community ([_1] only)',$dc_title);
- $hidden_text = &mt('Include communities set to be hidden from catalog ([_1] only)',$dc_title);
+ $details_text = &mt('Show full details for each community (domain staff only)');
+ $hidden_text = &mt('Include communities set to be hidden from catalog (domain staff only)');
} else {
- $details_text = &mt('Show full details for each course ([_1] only)',$dc_title);
- $hidden_text = &mt('Include courses set to be hidden from catalog ([_1] only)',$dc_title);
+ $details_text = &mt('Show full details for each course (domain staff only)');
+ $hidden_text = &mt('Include courses set to be hidden from catalog (domain staff only)');
}
if ($is_dc) {
$output .= '<span class="LC_nobreak">'.
@@ -875,12 +874,17 @@
}
sub canview_all {
+ my ($knownuser,$codedom) = @_;
my $canviewall = 0;
my $page = 'coursecatalog';
if (&LONCAPA::lonauthcgi::can_view($page)) {
$canviewall = 1;
} elsif (&LONCAPA::lonauthcgi::check_ipbased_access($page)) {
$canviewall= 1;
+ } elsif (($knownuser) && ($codedom ne '')) {
+ if (&Apache::lonnet::allowed('dcd',$codedom)) {
+ $canviewall = 1;
+ }
}
return $canviewall;
}
More information about the LON-CAPA-cvs
mailing list