summaryrefslogtreecommitdiffstats
path: root/modules-available/locations/inc
diff options
context:
space:
mode:
authorSimon Rettberg2017-04-26 15:34:58 +0200
committerSimon Rettberg2017-04-26 15:34:58 +0200
commit2a368cb3e597e35b467a6aebbaf35d42747681f5 (patch)
treeb62b33d104200009dbd62a8272da76337e1b2054 /modules-available/locations/inc
parent[baseconfig_bwlp] Update translations (diff)
downloadslx-admin-2a368cb3e597e35b467a6aebbaf35d42747681f5.tar.gz
slx-admin-2a368cb3e597e35b467a6aebbaf35d42747681f5.tar.xz
slx-admin-2a368cb3e597e35b467a6aebbaf35d42747681f5.zip
[baseconfig] Display inherited value and source when editing module specific settings
This optionally requires a callback to find the inheritance source in the module in question. The locations module was updated accordingly. This implements #3120
Diffstat (limited to 'modules-available/locations/inc')
-rw-r--r--modules-available/locations/inc/location.inc.php16
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 73080094..9977379f 100644
--- a/modules-available/locations/inc/location.inc.php
+++ b/modules-available/locations/inc/location.inc.php
@@ -280,6 +280,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()