blob: 5ce3bbfe3b2dd3571aae03e47375d136f08a04ed (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
<?php
class LocationHooks
{
/**
* Resolve baseconfig id to locationid -- noop in this case
*/
public static function baseconfigLocationResolver($id)
{
return $id;
}
/**
* Hook to get inheritance tree for all config vars
* @param int $id Locationid currently being edited
*/
public static function baseconfigInheritance($id)
{
$locs = Location::getLocationsAssoc();
if ($locs === false || !isset($locs[$id]))
return [];
BaseConfig::prepareWithOverrides([
'locationid' => $locs[$id]['parentlocationid']
]);
return ConfigHolder::getRecursiveConfig(true);
}
}
|