ここの情報は古いです。ご理解頂いた上でお取り扱いください。

source: OpenPNE3/trunk/apps/mobile_frontend/modules/community/actions/actions.class.php @ 11622

Last change on this file since 11622 was 11622, checked in by nagasawa, 13 years ago

#3880:added the communities search page to the mobile.

File size: 2.3 KB
Line 
1<?php
2
3/**
4 * This file is part of the OpenPNE package.
5 * (c) OpenPNE Project (http://www.openpne.jp/)
6 *
7 * For the full copyright and license information, please view the LICENSE
8 * file and the NOTICE file that were distributed with this source code.
9 */
10
11/**
12 * community actions.
13 *
14 * @package    OpenPNE
15 * @subpackage community
16 * @author     Kousuke Ebihara <ebihara@tejimaya.com>
17 */
18class communityActions extends sfOpenPNECommunityAction
19{
20  /**
21   * Executes home action
22   *
23   * @param sfWebRequest $request a request object
24   */
25  public function executeHome(sfWebRequest $request)
26  {
27    $this->membersSize = 5;
28
29    return parent::executeHome($request);
30  }
31
32  /**
33   * Executes joinlist action
34   *
35   * @param sfWebRequest $request a request object
36   */
37  public function executeJoinlist(sfWebRequest $request)
38  {
39    $this->size = 10;
40
41    parent::executeJoinlist($request);
42  }
43
44  /**
45   * Executes memberList action
46   *
47   * @param sfWebRequest $request a request object
48   */
49  public function executeMemberList(sfWebRequest $request)
50  {
51    $this->size = 10;
52
53    parent::executeMemberList($request);
54  }
55
56  /**
57   * Executes search action
58   *
59   * @param sfWebRequest $request a request object
60   */
61  public function executeSearch(sfWebRequest $request)
62  {
63    sfConfig::set('sf_nav_type', 'default');
64
65    $params = $request->getParameter('community', array());
66    $params['community_category_id'] = $request->getParameter('community_category_id');
67    $this->isResult = false;
68    $this->category_id = 0;
69    if (isset($params['name']))
70    {
71      $params['name'] = $params['name'];
72      $this->isResult = true;
73    }
74    if (isset($params['community_category_id']))
75    {
76      $this->category_id = $params['community_category_id'];
77      $params['community_category_id'] = $this->category_id;
78      $this->isResult = true;
79    }
80
81    $this->filters = new CommunityFormFilter();
82    $this->filters->bind($params);
83    $q = $this->filters->getQuery();
84
85    $this->pager = new sfDoctrinePager('Community', 20);
86    $this->pager->setQuery($q);
87    $this->pager->setPage($request->getParameter('page', 1));
88    $this->pager->init();
89
90    $this->categorys = Doctrine::getTable('CommunityCategory')
91      ->createQuery()
92      ->where('lft > 1')
93      ->execute();
94
95    return sfView::SUCCESS;
96  }
97}
Note: See TracBrowser for help on using the repository browser.