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

Changeset 11622


Ignore:
Timestamp:
May 13, 2009, 8:16:16 PM (13 years ago)
Author:
nagasawa
Message:

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

Location:
OpenPNE3/trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/apps/mobile_frontend/i18n/messages.ja.xml

    r11584 r11622  
    391391        <target>管理者</target>
    392392      </trans-unit>
     393      <trans-unit id="">
     394        <source>Search</source>
     395        <target>検索</target>
     396      </trans-unit>
     397      <trans-unit id="">
     398        <source>Create a new community</source>
     399        <target>コミュニティ作成</target>
     400      </trans-unit>
     401      <trans-unit id="">
     402        <source>Search Communities</source>
     403        <target>コミュニティ検索</target>
     404      </trans-unit>
     405      <trans-unit id="">
     406        <source>Categories</source>
     407        <target>カテゴリー</target>
     408      </trans-unit>
     409      <trans-unit id="">
     410        <source>Your search queries did not match any communities.</source>
     411        <target>該当するコミュニティはありませんでした。</target>
     412      </trans-unit>
     413      <trans-unit id="">
     414        <source>All categories</source>
     415        <target>すべてのカテゴリー</target>
     416      </trans-unit>
    393417    </body>
    394418  </file>
  • OpenPNE3/trunk/apps/mobile_frontend/modules/community/actions/actions.class.php

    r11014 r11622  
    5353    parent::executeMemberList($request);
    5454  }
     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  }
    5597}
  • OpenPNE3/trunk/apps/mobile_frontend/modules/member/templates/homeSuccess.php

    r11151 r11622  
    5252<?php
    5353$list = array(
     54  link_to(__('Search Communities'), 'community/search'),
     55);
     56op_include_list('search', $list, array('title' => __('Search')))
     57?>
     58
     59<?php
     60$list = array(
    5461  link_to(__('Edit profile'), 'member/editProfile'),
    5562);
  • OpenPNE3/trunk/apps/pc_frontend/i18n/messages.ja.xml

    r11584 r11622  
    547547        <target>コミュニティカテゴリ</target>
    548548      </trans-unit>
     549      <trans-unit id="">
     550        <source>All categories</source>
     551        <target>すべてのカテゴリー</target>
     552      </trans-unit>
    549553    </body>
    550554  </file>
  • OpenPNE3/trunk/lib/filter/doctrine/CommunityFormFilter.class.php

    r11479 r11622  
    2525  public function configure()
    2626  {
     27    $q = Doctrine::getTable('CommunityCategory')->createQuery()->where('lft > 1');
    2728    $this->setWidgets(array(
    28       'name'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
     29      'name'                  => new sfWidgetFormFilterInput(array('with_empty' => false)),
     30      'community_category_id' => new sfWidgetFormDoctrineChoice(array(
     31        'model'       => 'CommunityCategory',
     32        'add_empty'   => sfContext::getInstance()->getI18N()->__('All categories'),
     33        'query'    => $q,
     34        'default' => 0)),
    2935    ));
    3036
    3137    $this->setValidators(array(
    32       'name'       => new sfValidatorPass(),
     38      'name'                  => new sfValidatorPass(),
     39      'community_category_id' => new sfValidatorPass(),
    3340    ));
     41
     42    $this->widgetSchema->setLabel('community_category_id', 'Community Category');
    3443
    3544    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
Note: See TracChangeset for help on using the changeset viewer.