diff --git a/mod/group.php b/mod/group.php index 57e879206..4ab810242 100644 --- a/mod/group.php +++ b/mod/group.php @@ -1,6 +1,8 @@ get_baseurl() . '/group'); return; // NOTREACHED } - + if(($a->argc == 2) && (intval($a->argv[1]))) { + $r = q("SELECT * FROM `group` WHERE `id` = %d AND `uid` = %d LIMIT 1", + intval($a->argv[1]), + intval($_SESSION['uid']) + ); + if(! count($r)) { + notice("Group not found." . EOL ); + goaway($a->get_baseurl() . '/contacts'); + } + $group = $r[0]; + $groupname = notags(trim($_POST['groupname'])); + if((strlen($groupname)) && ($groupname != $group['name'])) { + $r = q("UPDATE `group` SET `name` = '%s' WHERE `uid` = %d AND `id` = %d LIMIT 1", + dbesc($groupname), + intval($_SESSION['uid']), + intval($group['id']) + ); + } + $members = $_POST['group_members_select']; + array_walk($members,'validate_members'); + $r = q("DELETE FROM `group_member` WHERE `gid` = %d AND `uid` = %d", + intval($a->argv[1]), + intval($_SESSION['uid']) + ); + if(count($members)) { + foreach($members as $member) { + $r = q("INSERT INTO `group_member` ( `uid`, `gid`, `contact-id`) + VALUES ( %d, %d, %d )", + intval($_SESSION['uid']), + intval($group['id']), + intval($member) + ); + } + } + } + } function group_content(&$a) { diff --git a/view/group_edit.tpl b/view/group_edit.tpl index ebe32f472..7cfd0fe3e 100644 --- a/view/group_edit.tpl +++ b/view/group_edit.tpl @@ -3,16 +3,21 @@
-
+
- +
- + $selector
+
+
+ +
+
diff --git a/view/style.css b/view/style.css index cd10102d4..f8582d97b 100644 --- a/view/style.css +++ b/view/style.css @@ -833,6 +833,41 @@ input#dfrn-url { clear: both; } +#group-edit-name-label { + float: left; + width: 175px; + margin-top: 20px; + margin-bottom: 20px; +} + +#group-edit-name { + float: left; + width: 225px; + margin-top: 20px; + margin-bottom: 20px; +} + +#group-edit-name-wrapper { + + +} + + +#group_members_select_label { + display: block; + float: left; + width: 175px; +} + .group_members_select { - width: 200px; + float: left; + width: 230px; + overflow: auto; +} + +#group_members_select_end { + clear: both; +} +#group-edit-name-end { + clear: both; } \ No newline at end of file diff --git a/wip/todo b/wip/todo index 7b9a15525..ca5c298ae 100644 --- a/wip/todo +++ b/wip/todo @@ -7,19 +7,15 @@ profile photo to self contact page? - resolve profile photo inconsistency use photo hash to notify of changes? -no ACL block for visitors wall-wall !! - contact editor block photo profile "you name it" field -groups +group - delete, theme -permissions - -pager - items and photos +pager - photos photos/albums/ java uploader