- if (dbm::is_result($r)) {
- $textmode = (($switchtotext && (count($r) > $switchtotext)) ? true : false);
- foreach($r as $member) {
- if(! in_array($member['id'],$preselected)) {
- $member['click'] = 'groupChangeMember(' . $group['id'] . ',' . $member['id'] . ',\'' . $sec_token . '\'); return true;';
- $groupeditor['contacts'][] = micropro($member,true,'mpall', $textmode);
+ if (DBM::is_result($r)) {
+ // Format the data of the contacts who aren't in the contact group
+ foreach ($r as $member) {
+ if (! in_array($member['id'], $preselected)) {
+ $entry = _contact_detail_for_template($member);
+ $entry['label'] = 'contacts';
+ $entry['photo_menu'] = '';
+ $entry['change_member'] = [
+ 'title' => L10n::t("Add Contact"),
+ 'gid' => $group['id'],
+ 'cid' => $member['id'],
+ 'sec_token' => $sec_token
+ ];
+
+ $groupeditor['contacts'][] = $entry;