X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=lib%2Ffunctions.php;h=86c81400e58706238ac2cdd424f498c9ff52c21d;hb=cf4cf65ff0e729c6ba52cede471b7c5ae2b837ba;hp=b019e93f62caf3b058034aa5907387a01ceac65e;hpb=6fdbfe32798452ec1c0fdbda57edabb892518409;p=readifood.git diff --git a/lib/functions.php b/lib/functions.php index b019e93..86c8140 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -285,10 +285,8 @@ return get_city_contacts($city_id, $GLOBALS['ROLE_DRIVER']); } - function get_contact_role_string($contact) { - global $roles; - - $role = $contact->getRole(); + function get_role_string($object, $roles) { + $role = $object->getRole(); $selected = array(); @@ -299,6 +297,22 @@ return implode(", ", $selected); } + function get_contact_role_string($contact) { + return get_role_string($contact, $GLOBALS['contact_roles']); + } + + function get_hub_role_string($hub) { + return get_role_string($hub, $GLOBALS['hub_roles']); + } + + function show_role_form($role, $roles) { + for ($i = 0; $i < count($roles); $i++) { + echo " $roles[$i]\n"; + } + } + function get_area_hubs($area_id = null) { $q = new HubQuery; if (isset($area_id)) $q->useAddressQuery()->filterByAreaId($area_id)->endUse();