diff --git a/mod/group.php b/mod/group.php index 538277a0c..57e879206 100644 --- a/mod/group.php +++ b/mod/group.php @@ -49,7 +49,9 @@ function group_content(&$a) { } -dbg(2); + + + if(($a->argc == 2) && (intval($a->argv[1]))) { require_once('view/acl_selectors.php'); $r = q("SELECT * FROM `group` WHERE `id` = %d AND `uid` = %d LIMIT 1", @@ -60,14 +62,21 @@ dbg(2); notice("Group not found." . EOL ); goaway($a->get_baseurl() . '/contacts'); } - $ret = group_get_members($r[0]['id']); + $group = $r[0]; + $ret = group_get_members($group['id']); $preselected = array(); if(count($ret)) { foreach($ret as $p) $preselected[] = $p['id']; } - $sel = contact_select('group_members_select','group_members_select',$preselected); - $o .= $sel; + + $tpl = file_get_contents('view/group_edit.tpl'); + $o .= replace_macros($tpl, array( + '$gid' => $group['id'], + '$name' => $group['name'], + '$selector' => contact_select('group_members_select','group_members_select',$preselected,25) + )); + } diff --git a/view/acl_selectors.php b/view/acl_selectors.php index e5df4c65e..e3ee8c879 100644 --- a/view/acl_selectors.php +++ b/view/acl_selectors.php @@ -1,11 +1,11 @@ \r\n"; + $o .= "\r\n"; $r = q("SELECT * FROM `group` WHERE `uid` = %d ORDER BY `name` ASC", $_SESSION['uid'] @@ -30,11 +30,11 @@ function group_select($selname,$selclass,$preselected = false) { -function contact_select($selname,$selclass,$preselected = false) { +function contact_select($selname,$selclass,$preselected = false,$size = 4) { $o = ''; - $o .= "\r\n"; + $o .= "\r\n"; $r = q("SELECT `id`, `name` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 ORDER BY `name` ASC ", $_SESSION['uid'] diff --git a/view/group_edit.tpl b/view/group_edit.tpl new file mode 100644 index 000000000..ebe32f472 --- /dev/null +++ b/view/group_edit.tpl @@ -0,0 +1,18 @@ +