diff options
author | Simon Rettberg | 2019-11-05 18:01:37 +0100 |
---|---|---|
committer | Simon Rettberg | 2019-11-05 18:01:37 +0100 |
commit | 50d28a0ad8dcf5d9fe697278b6ea05aa00f8fb87 (patch) | |
tree | 0418c774e8cbda6376f2f8a699af6e67a9055235 /modules-available/statistics/inc/statisticshooks.inc.php | |
parent | [permissionmanager] Fix creating bogus negative cache entries (diff) | |
download | slx-admin-50d28a0ad8dcf5d9fe697278b6ea05aa00f8fb87.tar.gz slx-admin-50d28a0ad8dcf5d9fe697278b6ea05aa00f8fb87.tar.xz slx-admin-50d28a0ad8dcf5d9fe697278b6ea05aa00f8fb87.zip |
[baseconfig] Overhaul hook system
This enables us to finally properly show the inheritance flow
of all the config variables when editing the baseconfig for
a certain location or machine.
Diffstat (limited to 'modules-available/statistics/inc/statisticshooks.inc.php')
-rw-r--r-- | modules-available/statistics/inc/statisticshooks.inc.php | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/modules-available/statistics/inc/statisticshooks.inc.php b/modules-available/statistics/inc/statisticshooks.inc.php index ead4917b..746bdabf 100644 --- a/modules-available/statistics/inc/statisticshooks.inc.php +++ b/modules-available/statistics/inc/statisticshooks.inc.php @@ -21,11 +21,6 @@ class StatisticsHooks return self::$row['hostname'] ? self::$row['hostname'] : self::$row['clientip']; } - public static function getBaseconfigParent($machineuuid) - { - return false; // TODO - } - public static function baseconfigLocationResolver($machineuuid) { self::getRow($machineuuid); @@ -34,4 +29,19 @@ class StatisticsHooks return (int)self::$row['locationid']; } + /** + * Hook to get inheritance tree for all config vars + * @param int $machineuuid MachineUUID currently being edited + */ + public static function baseconfigInheritance($machineuuid) + { + self::getRow($machineuuid); + if (self::$row === false) + return []; + BaseConfig::prepareWithOverrides([ + 'locationid' => self::$row['locationid'] + ]); + return ConfigHolder::getRecursiveConfig(true); + } + }
\ No newline at end of file |