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

Changeset 11636


Ignore:
Timestamp:
May 15, 2009, 9:34:28 PM (11 years ago)
Author:
nagasawa
Message:

#3880:added the communities search page to the mobile(3.0.x)

Location:
OpenPNE3/branches/STABLE/3.0.x
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/branches/STABLE/3.0.x/apps/mobile_frontend/i18n/messages.ja.xml

    r11583 r11636  
    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>
     417      <trans-unit id="">
     418        <source>Search communities top</source>
     419        <target>コミュニティ検索トップ</target>
     420      </trans-unit>
    393421    </body>
    394422  </file>
  • OpenPNE3/branches/STABLE/3.0.x/apps/mobile_frontend/modules/community/actions/actions.class.php

    r11014 r11636  
    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
     84    $this->pager = new sfPropelPager('Community', 20);
     85    $this->pager->setCriteria($this->filters->getCriteria());
     86    $this->pager->setPage($request->getParameter('page', 1));
     87    $this->pager->init();
     88
     89    $this->categorys = CommunityCategoryPeer::retrieveAllChildren();
     90
     91    return sfView::SUCCESS;
     92  }
    5593}
  • OpenPNE3/branches/STABLE/3.0.x/apps/mobile_frontend/modules/member/templates/homeSuccess.php

    r11151 r11636  
    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/branches/STABLE/3.0.x/lib/filter/CommunityFormFilter.class.php

    r11200 r11636  
    2525  public function configure()
    2626  {
    27     unset($this['file_id'], $this['community_category_id'], $this['created_at'], $this['updated_at']);
    28     $this->setWidget('name', new sfWidgetFormFilterInput(array('with_empty' => false)));
    29     $this->setValidator('name', new sfValidatorPass());
     27    unset($this['file_id'], $this['created_at'], $this['updated_at']);
     28    $c = new Criteria();
     29    $c->add(CommunityCategoryPeer::LEFT_COL, 1, Criteria::GREATER_THAN);
     30    $this->setWidgets(array(
     31      'name'                  => new sfWidgetFormFilterInput(array('with_empty' => false)),
     32      'community_category_id' => new sfWidgetFormPropelChoice(array(
     33        'model'       => 'CommunityCategory',
     34        'add_empty'   => sfContext::getInstance()->getI18N()->__('All categories'),
     35        'criteria'    => $c,
     36        'default' => 0)),
     37    ));
     38
     39    $this->widgetSchema->setLabel('community_category_id', 'Community Category');
    3040
    3141    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
Note: See TracChangeset for help on using the changeset viewer.