+
+ if (dbm::is_result($r)) {
+ foreach ($r as $rr) {
+ $selected = (($group_id == $rr['id']) ? ' group-selected' : '');
+
+ if ($editmode == "full") {
+ $groupedit = array(
+ 'href' => "group/".$rr['id'],
+ 'title' => t('edit'),
+ );
+ } else {
+ $groupedit = null;
+ }
+
+ $groups[] = array(
+ 'id' => $rr['id'],
+ 'cid' => $cid,
+ 'text' => $rr['name'],
+ 'selected' => $selected,
+ 'href' => $each."/".$rr['id'],
+ 'edit' => $groupedit,
+ 'ismember' => in_array($rr['id'],$member_of),
+ );
+ }
+ }
+
+
+ $tpl = get_markup_template("group_side.tpl");
+ $o = replace_macros($tpl, array(
+ '$title' => t('Groups'),
+ 'newgroup' => (($editmode == "extended") || ($editmode == "full") ? 1 : ''),
+ '$editgroupstext' => t('Edit groups'),
+ 'grouppage' => "group/",
+ '$edittext' => t('Edit group'),
+ '$createtext' => t('Create a new group'),
+ '$creategroup' => t('Group Name: '),
+ '$form_security_token' => get_form_security_token("group_edit"),
+ '$ungrouped' => (($every === 'contacts') ? t('Contacts not in any group') : ''),
+ '$groups' => $groups,
+ '$add' => t('add'),
+ ));
+