[Isocial-svn] SF.net SVN: isocial: [280] app
Status: Pre-Alpha
Brought to you by:
aguidrevitch
From: <di...@us...> - 2008-07-09 10:36:22
|
Revision: 280 http://isocial.svn.sourceforge.net/isocial/?rev=280&view=rev Author: dim0s77 Date: 2008-07-09 03:36:31 -0700 (Wed, 09 Jul 2008) Log Message: ----------- hide 'join group' link if user in current group Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/views/groupapp/group/browse.tpl app/views/groupapp/group/index.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-07-09 09:14:07 UTC (rev 279) +++ app/controllers/groupapp/group_controller.php 2008-07-09 10:36:31 UTC (rev 280) @@ -284,9 +284,17 @@ $links = $group_pages->paginator->getLinks(); $this->pages_links = $links['first'] . ' ' . $links['back'] . ' ' . $links['pages'] . ' ' . $links['next'] . ' ' . $links['last']; - $_filter = array('conditions' => "type_id" . $type_id, 'include' => 'picture'); + $_filter = array('conditions' => 'type_id' . $type_id, 'include' => 'picture'); $options = array_merge($_filter, $this->pagination_helper->getFindOptions($this->GroupappGroup)); $this->groups = $this->GroupappGroup->find('all', $options); + + $user_groups = $this->current_user->groupapp_group->load(); + if (!empty($user_groups)) { + $this->user_groups = array(); + foreach ($user_groups as $user_group) { + $this->user_groups[$user_group->id] = true; + } + } } function show_members () { Modified: app/views/groupapp/group/browse.tpl =================================================================== --- app/views/groupapp/group/browse.tpl 2008-07-09 09:14:07 UTC (rev 279) +++ app/views/groupapp/group/browse.tpl 2008-07-09 10:36:31 UTC (rev 280) @@ -85,13 +85,19 @@ <div class="actions"> <ul class="actions_list"> - <li><a href="#">_{Join Group}</a></li> + {?user_groups} + <? if (!isset($user_groups[$group->id])): ?> + <li><a href="#">_{Join Group}</a></li> + <? endif ?> + {end} </ul> </div> <div class="info"> <div class="name"><a href="/groupapp/group/show_group/{group.id?}">{group.name}</a></div> - <div class="other"><span class="param">_{Members count}:</span> {group.members_count}</div> + <div class="other"><span class="param">_{Members count}:</span> + <a href="/groupapp/group/show_members/{group.id?}">{group.members_count}</a> + </div> <div class="other"><span class="param">_{Type}:</span> <a href="/groupapp/group/browse/?g={group_type_id}"><?= $gt[$group_type_id] ?></a> - <a href="/groupapp/group/browse/?g={group_type_id}&sg={group.type_id}"><?= $gt[$group->type_id] ?></a> Modified: app/views/groupapp/group/index.tpl =================================================================== --- app/views/groupapp/group/index.tpl 2008-07-09 09:14:07 UTC (rev 279) +++ app/views/groupapp/group/index.tpl 2008-07-09 10:36:31 UTC (rev 280) @@ -60,7 +60,9 @@ <div class="info"> <div class="name"><a href="/groupapp/group/show_group/{user_group.id?}">{user_group.name}</a></div> - <div class="other"><span class="param">_{Members count}:</span> {user_group.members_count}</div> + <div class="other"><span class="param">_{Members count}:</span> + <a href="/groupapp/group/show_members/{user_group.id?}">{user_group.members_count}</a> + </div> <div class="other"><span class="param">_{Type}:</span> <? $subtype_id = $user_group->type_id; $type_id = $subgroup_types[$subtype_id]; ?> <a href="/groupapp/group/browse/?g={type_id?}"><?= $gt[$type_id] ?></a> - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |