]> git.mxchange.org Git - friendica.git/commitdiff
first cut at group chooser UI
authorFriendika <info@friendika.com>
Tue, 12 Apr 2011 08:31:55 +0000 (01:31 -0700)
committerFriendika <info@friendika.com>
Tue, 12 Apr 2011 08:31:55 +0000 (01:31 -0700)
boot.php
include/group.php
mod/group.php
view/theme/duepuntozero/style.css
view/theme/loozah/style.css

index 5fac9df5aeabb94bbeb53232717e267f93d2124e..b11c9031256acafc8fdcffef77e467496134339b 100644 (file)
--- 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 '<div class="contact-block-div' . $class . '"><a class="contact-block-link' . $class . $sparkle 
-               . '" href="' . $url . '" ><img class="contact-block-img' . $class . $sparkle . '" src="' . $contact['micro'] 
-               . '" title="' . $contact['name'] . ' [' . $contact['url'] . ']" alt="' . $contact['name'] . '" /></a></div>' . "\r\n";
+               . (($click) ? ' fakelink' : '') . '" '
+               . (($url) ? '" href="' . $url . '"' : '') . $click . ' ><img class="contact-block-img' . $class . $sparkle . '" src="' 
+               . $contact['micro'] . '" title="' . $contact['name'] . ' [' . $contact['url'] . ']" alt="' . $contact['name'] 
+               . '" /></a></div>' . "\r\n";
 }}
 
 
index 07cd45f199d32f2f33a23cdf8ec8c4d465ac4d42..5001cf53ecbb916fcc2a14dc16831a61eeb2ac31 100644 (file)
@@ -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())
                );
index 591c936271c5e5c93b1f79bfa7f34ace6b20f016..8733614dd10576070d15f366364d3ae5b9c5e3b7 100644 (file)
@@ -158,10 +158,29 @@ function group_content(&$a) {
        }
 
        $o .= '<div id="group-members">';
+       $o .= '<h3>' . t('In Group') . '</h3>';
        foreach($members as $member) {
+               $member['click'] = 'groupMember(' . $member['id'] . '); return true;';
                $o .= micropro($member,true,'mpgroup');
        }
+
        $o .= '</div><div id="group-members-end"></div>';
+       $o .= '<hr id="group-separator" />';
+       $o .= '<div id="group-all-contacts">';
+
+               $o .= '<h3>' . t('All Contacts') . '</h3>';
+               $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 .= '</div><div id="group-all-contacts-end"></div>';
 
        return $o;
 
index cc55f7887ba3e6485470a6349243ce954149b7d6..8bddbdfba86e852a7306322bc7f645f7ec9140e0 100644 (file)
@@ -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;
+}
index 17b4e7fb28b48fbe8392962d1ba2bebafa60a26b..76c2df46b2204fbb1dfda1fbd43ba12637a3b6f6 100644 (file)
@@ -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;
+}
+