blob: c15c34aba0b1df38458d7931b477a5367d3be9ba (
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
30
31
|
<?php
class LocationHooks
{
/**
* Used for baseconfig hook
* @param $locationId
* @return bool|array ('value' => x, 'display' => y), false if no parent or unknown id
*/
public static function getBaseconfigParent($locationId)
{
$locationId = (int)$locationId;
$assoc = Location::getLocationsAssoc();
if (!isset($assoc[$locationId]))
return false;
$locationId = (int)$assoc[$locationId]['parentlocationid'];
if (!isset($assoc[$locationId]))
return false;
return array('value' => $locationId, 'display' => $assoc[$locationId]['locationname']);
}
/**
* Resolve baseconfig id to locationid -- noop in this case
*/
public static function baseconfigLocationResolver($id)
{
return $id;
}
}
|