diff options
author | Simon Rettberg | 2017-04-27 13:46:42 +0200 |
---|---|---|
committer | Simon Rettberg | 2017-04-27 13:46:42 +0200 |
commit | 8666590dd1184970bf8c93415e49f8f4be43ea5b (patch) | |
tree | e9c0f1ba79b3400e98c6249daf61f8f519105f29 /modules-available/locations/inc | |
parent | [locationinfo] Clean up translations (diff) | |
parent | Relax anti-caching headers a bit (diff) | |
download | slx-admin-8666590dd1184970bf8c93415e49f8f4be43ea5b.tar.gz slx-admin-8666590dd1184970bf8c93415e49f8f4be43ea5b.tar.xz slx-admin-8666590dd1184970bf8c93415e49f8f4be43ea5b.zip |
Merge branch 'master' into location-info-panel
Diffstat (limited to 'modules-available/locations/inc')
-rw-r--r-- | modules-available/locations/inc/location.inc.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/modules-available/locations/inc/location.inc.php b/modules-available/locations/inc/location.inc.php index 7ac76b3e..8f3447da 100644 --- a/modules-available/locations/inc/location.inc.php +++ b/modules-available/locations/inc/location.inc.php @@ -286,6 +286,22 @@ class Location } /** + * @param $locationId + * @return bool|array ('value' => x, 'display' => y), false if no parent or unknown id + */ + public static function getBaseconfigParent($locationId) + { + settype($locationId, 'integer'); + $locations = Location::getLocationsAssoc(); + if (!isset($locations[$locationId])) + return false; + $locationId = (int)$locations[$locationId]['parentlocationid']; + if (!isset($locations[$locationId])) + return false; + return array('value' => $locationId, 'display' => $locations[$locationId]['locationname']); + } + + /** * @return array list of subnets as numeric array */ public static function getSubnets() |