From 1cfb2dc5e668bd82f62a5606e80ad61b56b8596c Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 11 Jul 2017 12:08:53 +0200 Subject: [*] Adapt to new baseconfig API --- modules-available/locations/baseconfig/getconfig.inc.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'modules-available/locations/baseconfig') diff --git a/modules-available/locations/baseconfig/getconfig.inc.php b/modules-available/locations/baseconfig/getconfig.inc.php index 3a0c918f..f21503f1 100644 --- a/modules-available/locations/baseconfig/getconfig.inc.php +++ b/modules-available/locations/baseconfig/getconfig.inc.php @@ -17,7 +17,7 @@ $matchingLocations = array(); if ($locationId !== false) { // Get all parents $matchingLocations = Location::getLocationRootChain($locationId); - $configVars["SLX_LOCATIONS"] = implode(' ', $matchingLocations); + ConfigHolder::add("SLX_LOCATIONS", implode(' ', $matchingLocations), 100); } // Query location specific settings (from bottom to top) @@ -31,14 +31,15 @@ if (!empty($matchingLocations)) { } // $matchingLocations contains the location ids sorted from closest to furthest, so we use it to make sure the order // in which they override is correct (closest setting wins, e.g. room setting beats department setting) + $prio = count($matchingLocations) + 1; foreach ($matchingLocations as $lid) { if (!isset($tmp[$lid])) continue; + ConfigHolder::setContext('location-' . $lid); foreach ($tmp[$lid] as $setting => $value) { - if (!isset($configVars[$setting])) { - $configVars[$setting] = $value; - } + ConfigHolder::add($setting, $value, $prio); } + $prio -= 1; } unset($tmp); } -- cgit v1.2.3-55-g7522