From 62f218da95ac407c69cc0956c257ddc2ae9293c3 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 8 Jun 2016 13:00:39 +0200 Subject: [location] Move getLocationRootChain to heler class --- modules-available/locations/baseconfig/getconfig.inc.php | 8 +------- 1 file changed, 1 insertion(+), 7 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 2643ced6..d4a4f40b 100644 --- a/modules-available/locations/baseconfig/getconfig.inc.php +++ b/modules-available/locations/baseconfig/getconfig.inc.php @@ -9,13 +9,7 @@ if ($locationId === false) { $matchingLocations = array(); if ($locationId !== false) { // Get all parents - settype($locationId, 'integer'); - $locations = Location::getLocationsAssoc(); - $find = $locationId; - while (isset($locations[$find]) && !in_array($find, $matchingLocations)) { - $matchingLocations[] = $find; - $find = (int)$locations[$find]['parentlocationid']; - } + $matchingLocations = Location::getLocationRootChain($locationId); $configVars["SLX_LOCATIONS"] = implode(' ', $matchingLocations); } -- cgit v1.2.3-55-g7522