]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
groups tab added to profile
authordave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 19 Jul 2010 13:57:08 +0000 (13:57 +0000)
committerdave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 19 Jul 2010 13:57:08 +0000 (13:57 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@6738 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/profile/index.php
mod/profile/views/default/profile/profile_contents/groups.php [new file with mode: 0644]
mod/profile/views/default/profile/profile_navigation.php

index 41552602d08129267297bad3cbc4dc9d3d3998bb..3b3a882e633990ba3d2d53b56963f74b91d360a2 100644 (file)
@@ -29,6 +29,9 @@ if ($user = get_user_by_username($username)) {
                case 'friends':
                        $body .= elgg_view('profile/profile_contents/friends', array("entity" => $user));
                break;
+               case 'groups':
+                       $body .= elgg_view('profile/profile_contents/groups', array("entity" => $user));
+               break;
                case 'extend':
                        $body .= elgg_view('profile/profile_contents/extend', array("entity" => $user));
                break;
diff --git a/mod/profile/views/default/profile/profile_contents/groups.php b/mod/profile/views/default/profile/profile_contents/groups.php
new file mode 100644 (file)
index 0000000..323bb61
--- /dev/null
@@ -0,0 +1,11 @@
+<?php\r
+/**\r
+ * Profile groups\r
+ **/\r
+$groups = list_entities_from_relationship('member',$vars['entity']->getGUID(),false,'group','',0, $limit,false, false);\r
+\r
+if(!$groups) {\r
+       $groups = '<p>' . elgg_echo('profile:no_groups') . '</p>';\r
+}\r
+\r
+echo $groups;
\ No newline at end of file
index bf7ece422995a14fa12e66a95063e660c06dd33e..5a7283a9c3a97366c62a8fb2b456f877b482e362 100755 (executable)
@@ -22,7 +22,9 @@ switch($section){
        case 'details':
                $details = 'class="selected"';
                break;
-
+       case 'groups':
+               $groups = 'class="selected"';
+               break;
        case 'twitter':
                $twitter = 'class="selected"';
                break;
@@ -42,6 +44,7 @@ switch($section){
        <li <?php echo $activity; ?>><a href="<?php echo $url; ?>"><?php echo elgg_echo('activity'); ?></a></li>
        <li <?php echo $details; ?>><a href="<?php echo $url . 'details'; ?>"><?php echo elgg_echo('Details'); ?></a></li>
        <li <?php echo $friends; ?>><a href="<?php echo $url . 'friends'; ?>"><?php echo elgg_echo('friends'); ?></a></li>
+       <li <?php echo $groups; ?>><a href="<?php echo $url . 'groups'; ?>"><?php echo elgg_echo('groups'); ?></a></li>
        <li <?php echo $commentwall; ?>><a href="<?php echo $url . 'commentwall'; ?>"><?php echo elgg_echo('profile:commentwall'); ?></a></li>
        <?php
                //check to see if the twitter username is set