diff options
Diffstat (limited to 'modules-available')
-rw-r--r-- | modules-available/locations/inc/location.inc.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/modules-available/locations/inc/location.inc.php b/modules-available/locations/inc/location.inc.php index a29be5c3..37e6e720 100644 --- a/modules-available/locations/inc/location.inc.php +++ b/modules-available/locations/inc/location.inc.php @@ -119,9 +119,15 @@ class Location return $output; } + /** + * @param int|int[] $selected Which locationIDs to mark as selected + * @param int $excludeId Which locationID to explude + * @param bool $addNoParent Add entry for "no location" at the top + * @param bool $keepArrayKeys Keep location IDs as array index + * @return array Locations + */ public static function getLocations($selected = 0, $excludeId = 0, $addNoParent = false, $keepArrayKeys = false) { - $selected = (int)$selected; if (self::$flatLocationCache === false) { $rows = self::getTree(); $rows = self::flattenTree($rows); @@ -142,7 +148,7 @@ class Location unset($rows[$key]); continue; } - if ((is_array($selected) && in_array($row['locationid'], $selected)) || (int)$row['locationid'] === $selected) { + if ((is_array($selected) && in_array($row['locationid'], $selected)) || $row['locationid'] == $selected) { $row['selected'] = true; } $row['sortIndex'] = $index++; |