Split hub roles.
[readifood.git] / lib / contact.php
index ccfcd48..166fd97 100644 (file)
   }
 
   function show_contact_role_form($role) {
-    global $roles;
-
-    for ($i = 0; $i < count($roles); $i++) {
-      echo " <input type=\"checkbox\" name=\"role_$i\"";
-      if ($role & (1 << $i)) echo " checked";
-      echo ">$roles[$i]\n";
-    }
+    return show_role_form($role, $GLOBALS['contact_roles']);
   }
 
   function show_contact_form($contact = null) {
-    global $roles;
+    global $contact_roles;
 
     if (! $contact) $contact = new Contact;
 
   }
 
   function update_contact(&$contact, $area_id, $new = false) {
-    global $roles;
+    global $contact_roles;
 
     $role = 0;
-    for ($i = 0; $i < count($roles); $i++) {
+    for ($i = 0; $i < count($contact_roles); $i++) {
       if ($_POST['role_' . $i] == "on") $role |= (1 << $i);
     }