--- loncom/interface/coursecatalog.pm 2018/04/29 00:31:25 1.88.2.2 +++ loncom/interface/coursecatalog.pm 2021/12/12 21:47:58 1.88.2.9 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler for displaying the course catalog interface # -# $Id: coursecatalog.pm,v 1.88.2.2 2018/04/29 00:31:25 raeburn Exp $ +# $Id: coursecatalog.pm,v 1.88.2.9 2021/12/12 21:47:58 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -58,6 +58,7 @@ sub handler { ['sortby','showdom']); my $codedom = &Apache::lonnet::default_login_domain(); + my $hostname = $r->hostname(); if (($env{'user.domain'} ne '') && ($env{'user.domain'} ne 'public')) { $codedom = $env{'user.domain'}; @@ -77,24 +78,23 @@ sub handler { my $domdesc = &Apache::lonnet::domain($codedom,'description'); &Apache::lonhtmlcommon::clear_breadcrumbs(); - my %domconfig = - &Apache::lonnet::get_dom('configuration',['coursecategories'],$codedom); + my $crscats = &Apache::lonnet::get_dom_cats($codedom); + my %domdefaults = &Apache::lonnet::get_domain_defaults($codedom); my $knownuser = &user_is_known(); my $canviewall = &canview_all($knownuser,$codedom); my ($cathash,$cattype); - if (ref($domconfig{'coursecategories'}) eq 'HASH') { - $cathash = $domconfig{'coursecategories'}{'cats'}; - if ($knownuser || $canviewall) { - $cattype = $domconfig{'coursecategories'}{'auth'}; - } else { - $cattype = $domconfig{'coursecategories'}{'unauth'}; - } - if ($cattype eq '') { - $cattype = 'std'; - } + if (ref($crscats) eq 'HASH') { + %{$cathash} = %{$crscats}; } else { $cathash = {}; + } + if ($knownuser || $canviewall) { + $cattype = $domdefaults{'catauth'}; + } else { + $cattype = $domdefaults{'catunauth'}; + } + if ($cattype eq '') { $cattype = 'std'; } if ($cattype eq 'none') { @@ -106,7 +106,7 @@ sub handler { if ($knownuser || $canviewall) { $r->print('