[Isocial-svn] SF.net SVN: isocial:[295] app
Status: Pre-Alpha
Brought to you by:
aguidrevitch
From: <di...@us...> - 2008-08-26 11:12:50
|
Revision: 295 http://isocial.svn.sourceforge.net/isocial/?rev=295&view=rev Author: dim0s77 Date: 2008-08-26 11:13:00 +0000 (Tue, 26 Aug 2008) Log Message: ----------- Show all groups in browse page by default Modified Paths: -------------- app/controllers/groupapp/group_controller.php app/views/groupapp/group/browse.tpl Modified: app/controllers/groupapp/group_controller.php =================================================================== --- app/controllers/groupapp/group_controller.php 2008-08-26 10:23:36 UTC (rev 294) +++ app/controllers/groupapp/group_controller.php 2008-08-26 11:13:00 UTC (rev 295) @@ -273,13 +273,19 @@ $this->_extract_group_types(); $all_group_types = $this->GroupappGroupType->find('all'); - $this->group_type_id = (!empty($this->params['g']) && is_numeric($this->params['g'])) ? $this->params['g'] : 2; + $this->group_type_id = (!empty($this->params['g']) && is_numeric($this->params['g'])) ? $this->params['g'] : 0; $this->subgroup_type_id = (!empty($this->params['sg']) && is_numeric($this->params['sg'])) ? $this->params['sg'] : 0; - $type_id = $this->subgroup_type_id > 0 ? " = " . $this->subgroup_type_id : - " BETWEEN " . $this->group_type_id * 100 . " and " . ($this->group_type_id + 1) * 100; + $type_id = ''; + $_filter_pagination = array('items_per_page' => 10); + $_filter = array('include' => 'picture'); + if ($this->group_type_id) { + $type_id = $this->subgroup_type_id > 0 ? " = " . $this->subgroup_type_id : + " BETWEEN " . $this->group_type_id * 100 . " and " . ($this->group_type_id + 1) * 100; + $_filter_pagination['count_conditions'] = "type_id" . $type_id; + $_filter['conditions'] = 'type_id' . $type_id; + } - $_filter_pagination = array('items_per_page' => 10, 'count_conditions' => "type_id" . $type_id ); $group_pages = $this->pagination_helper->getPaginator($this->GroupappGroup, $_filter_pagination);// paginator $this->first_group = ($group_pages->getCurrentPage() - 1) * $group_pages->getItemsPerPage() + 1; $this->last_group = ($group_pages->getCurrentPage() * $group_pages->getItemsPerPage() < $group_pages->getItemCount()) ? @@ -289,7 +295,6 @@ $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'); $options = array_merge($_filter, $this->pagination_helper->getFindOptions($this->GroupappGroup)); $this->groups = $this->GroupappGroup->find('all', $options); Modified: app/views/groupapp/group/browse.tpl =================================================================== --- app/views/groupapp/group/browse.tpl 2008-08-26 10:23:36 UTC (rev 294) +++ app/views/groupapp/group/browse.tpl 2008-08-26 11:13:00 UTC (rev 295) @@ -43,11 +43,13 @@ <div class="title_text">_{Filter groups by}:</div> <div class="filter_name">_{type}</div> <select id="group_type_id" onchange="javascript: window.location.href='?g=' + this.options[this.selectedIndex].value"> + <option <? if($group_type_id == 0): ?>selected="selected" <? endif ?>value="0">_{All}</option> {loop group_types} <option <? $this_group_type_id = $group_type->id ?><? if($this_group_type_id == $group_type_id): ?>selected="selected" <? endif ?>value="{group_type.id?}"><?= $gt[$this_group_type_id] ?></option> {end} </select> + <? if($group_type_id): ?> <div class="filter_name">_{subtype}</div> <ul class="subgroups_list"> <? if ($subgroup_type_id == 0): ?> @@ -64,6 +66,8 @@ <? endif ?> {end} </ul> + <? endif ?> + </div> </div> @@ -99,7 +103,7 @@ <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}"><?= $gt[$subgroup_types[$group->type_id]] ?></a> - <a href="/groupapp/group/browse/?g={group_type_id}&sg={group.type_id}"><?= $gt[$group->type_id] ?></a> </div> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |