[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonconfigsettings.pm

raeburn raeburn at source.lon-capa.org
Wed Apr 23 06:26:38 EDT 2014


raeburn		Wed Apr 23 10:26:38 2014 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	lonconfigsettings.pm 
  Log:
  - For 2.11
    - Backport 1.29.
  
  
Index: loncom/interface/lonconfigsettings.pm
diff -u loncom/interface/lonconfigsettings.pm:1.21.4.5 loncom/interface/lonconfigsettings.pm:1.21.4.6
--- loncom/interface/lonconfigsettings.pm:1.21.4.5	Sat Feb 15 17:14:53 2014
+++ loncom/interface/lonconfigsettings.pm	Wed Apr 23 10:26:37 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: lonconfigsettings.pm,v 1.21.4.5 2014/02/15 17:14:53 raeburn Exp $
+# $Id: lonconfigsettings.pm,v 1.21.4.6 2014/04/23 10:26:37 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -258,7 +258,10 @@
                 if (grep(/^\Q$item\E$/, at actions)) {
                     push(@items,$item);
                     if ($context eq 'domain') {
-                        my $settings = $values->{$item};
+                        my $settings;
+                        if (ref($values) eq 'HASH') {
+                            $settings = $values->{$item};
+                        }
                         if ($item eq 'usersessions') {
                             $r->print('<script type="text/javascript">'."\n".
                                       '// <![CDATA['."\n".
@@ -266,7 +269,29 @@
                                       '// ]]>'."\n".
                                       '</script>'."\n");
                         } elsif ($item eq 'selfcreation') {
-                            $settings = $values->{'usercreation'};
+                            if (ref($values) eq 'HASH') {
+                                $settings = $values->{'usercreation'};
+                            }
+                        } elsif ($item eq 'defaults') {
+                            if (ref($values->{'inststatus'}) eq 'HASH') {
+                                if (ref($values->{'defaults'}) eq 'HASH') {
+                                    $settings = {%{$values->{'inststatus'}},%{$values->{'defaults'}}};
+                                } else {
+                                    $settings = $values->{'inststatus'};
+                                }
+                            } else {
+                                my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom);
+                                my $inststatus = {
+                                                   inststatustypes => $usertypes,
+                                                   inststatusorder => $types,
+                                                   inststatusguest => [],
+                                                 };
+                                if (ref($values->{defaults}) eq 'HASH') {
+                                    $settings = {%{$inststatus},%{$values->{'defaults'}}};
+                                } else {
+                                    $settings = $inststatus;
+                                }
+                            }
                         }
                         ($output{$item},$rowtotal{$item}) =
                             &Apache::domainprefs::print_config_box($r,$dom,$confname,




More information about the LON-CAPA-cvs mailing list