From 323697d9dc2b321da494f1cde0f22d8052587320 Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Tue, 13 Jul 2010 02:26:28 -0700 Subject: [PATCH] more group editor --- mod/group.php | 17 +++++++++++++---- view/acl_selectors.php | 8 ++++---- view/group_edit.tpl | 18 ++++++++++++++++++ view/style.css | 4 ++++ 4 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 view/group_edit.tpl diff --git a/mod/group.php b/mod/group.php index 538277a0c6..57e879206a 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 e5df4c65ed..e3ee8c8792 100644 --- a/view/acl_selectors.php +++ b/view/acl_selectors.php @@ -1,11 +1,11 @@ \r\n"; + $o .= "\r\n"; + $o .= " + +
+
+ +$selector + +
+
+ + diff --git a/view/style.css b/view/style.css index a031731c54..cd10102d48 100644 --- a/view/style.css +++ b/view/style.css @@ -831,4 +831,8 @@ input#dfrn-url { #acl-wrapper-end { clear: both; +} + +.group_members_select { + width: 200px; } \ No newline at end of file