From 61915a524debe3db08a07f0adb86033ee894be28 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 12 Apr 2011 01:31:55 -0700 Subject: [PATCH] first cut at group chooser UI --- boot.php | 10 +++++++--- include/group.php | 2 +- mod/group.php | 19 +++++++++++++++++++ view/theme/duepuntozero/style.css | 19 +++++++++++++++++++ view/theme/loozah/style.css | 20 ++++++++++++++++++++ 5 files changed, 66 insertions(+), 4 deletions(-) diff --git a/boot.php b/boot.php index 5fac9df5a..b11c90312 100644 --- a/boot.php +++ b/boot.php @@ -2076,10 +2076,14 @@ function micropro($contact, $redirect = false, $class = '') { $sparkle = ' sparkle'; } } - + $click = ((x($contact,'click')) ? ' onclick="' . $contact['click'] . '" ' : ''); + if($click) + $url = ''; return '
' . $contact['name'] . '
' . "\r\n"; + . (($click) ? ' fakelink' : '') . '" ' + . (($url) ? '" href="' . $url . '"' : '') . $click . ' >' . $contact['name'] 
+		. '' . "\r\n"; }} diff --git a/include/group.php b/include/group.php index 07cd45f19..5001cf53e 100644 --- a/include/group.php +++ b/include/group.php @@ -108,7 +108,7 @@ function group_get_members($gid) { if(intval($gid)) { $r = q("SELECT `group_member`.`contact-id`, `contact`.* FROM `group_member` LEFT JOIN `contact` ON `contact`.`id` = `group_member`.`contact-id` - WHERE `gid` = %d AND `group_member`.`uid` = %d", + WHERE `gid` = %d AND `group_member`.`uid` = %d ORDER BY `contact`.`name` ASC ", intval($gid), intval(local_user()) ); diff --git a/mod/group.php b/mod/group.php index 591c93627..8733614dd 100644 --- a/mod/group.php +++ b/mod/group.php @@ -158,10 +158,29 @@ function group_content(&$a) { } $o .= '
'; + $o .= '

' . t('In Group') . '

'; foreach($members as $member) { + $member['click'] = 'groupMember(' . $member['id'] . '); return true;'; $o .= micropro($member,true,'mpgroup'); } + $o .= '
'; + $o .= '
'; + $o .= '
'; + + $o .= '

' . t('All Contacts') . '

'; + $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `blocked` = 0 and `pending` = 0 and `self` = 0 ORDER BY `name` ASC", + intval(local_user()) + ); + + if(count($r)) { + foreach($r as $member) { + $member['click'] = 'groupMember(' . $member['id'] . '); return true;'; + $o .= micropro($member,true,'mpall'); + } + } + + $o .= '
'; return $o; diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index cc55f7887..8bddbdfba 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -2229,9 +2229,28 @@ a.mail-list-link { #group-members { margin-top: 20px; + padding: 10px; + height: 450px; + overflow: auto; + border: 1px solid #ddd; } #group-members-end { clear: both; } +#group-separator { + margin-top: 10px; + margin-bottom: 10px; +} + +#group-all-contacts { + padding: 10px; + height: 450px; + overflow: auto; + border: 1px solid #ddd; +} + +#group-all-contacts-end { + clear: both; +} diff --git a/view/theme/loozah/style.css b/view/theme/loozah/style.css index 17b4e7fb2..76c2df46b 100644 --- a/view/theme/loozah/style.css +++ b/view/theme/loozah/style.css @@ -2253,9 +2253,29 @@ a.mail-list-link { #group-members { margin-top: 20px; + padding: 10px; + height: 450px; + overflow: auto; + border: 1px solid #ddd; } #group-members-end { clear: both; } +#group-separator { + margin-top: 10px; + margin-bottom: 10px; +} + +#group-all-contacts { + padding: 10px; + height: 450px; + overflow: auto; + border: 1px solid #ddd; +} + +#group-all-contacts-end { + clear: both; +} +