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

Changeset 11055


Ignore:
Timestamp:
Mar 18, 2009, 6:44:51 PM (10 years ago)
Author:
ShogoKawahara
Message:

opCommunityTopicPlugin:fixed some page layouts and added recentlyTopicList page

Location:
OpenPNE3/plugins/opCommunityTopicPlugin/branches/kawahara_mobile
Files:
2 added
13 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/plugins/opCommunityTopicPlugin/branches/kawahara_mobile/apps/mobile_frontend/modules/communityTopic/actions/actions.class.php

    r11038 r11055  
    2929    return parent::executeListCommunity($request);
    3030  }
     31
     32  /**
     33   * Executes recently topic list.
     34   *
     35   * @param sfWebRequest $request
     36   */
     37  public function executeRecentlyTopicList(sfWebRequest $request)
     38  {
     39    $this->size = 10;
     40
     41    return parent::executeRecentlyTopicList($request);
     42  }
    3143}
  • OpenPNE3/plugins/opCommunityTopicPlugin/branches/kawahara_mobile/apps/mobile_frontend/modules/communityTopic/templates/_communityTopicList.php

    r11036 r11055  
    33<?php
    44$list = array();
    5 foreach ($communityTopics as $key => $communityTopic)
     5foreach ($communityTopics as $communityTopic)
    66{
    77  $list[] = sprintf("[%s] %s",
     
    1010      op_truncate($communityTopic->getName(), 28),
    1111      $communityTopic->countCommunityTopicComments()
    12     ), 'communityTopic_show', $communityTopic)
    13   );
     12    ), 'communityTopic_show', $communityTopic
     13  ));
    1414}
    1515$moreInfo = array();
  • OpenPNE3/plugins/opCommunityTopicPlugin/branches/kawahara_mobile/apps/mobile_frontend/modules/communityTopic/templates/_topicCommentListBox.php

    r11036 r11055  
    1717  'title' => __('Recently Posted Community Topics'),
    1818  'border' => true,
     19  'moreInfo' => array(
     20    link_to(__('More'), 'communityTopic_recently_topic_list')
     21  ),
    1922);
    2023op_include_list('communityList', $list, $options);
  • OpenPNE3/plugins/opCommunityTopicPlugin/branches/kawahara_mobile/apps/pc_frontend/modules/communityTopic/actions/actions.class.php

    r11036 r11055  
    2525  public function postExecute()
    2626  {
    27     sfConfig::set('sf_nav_type', 'community');
    28     sfConfig::set('sf_nav_id', $this->community->getId());
     27    if ($this->community instanceof Community)
     28    {
     29      sfConfig::set('sf_nav_type', 'community');
     30      sfConfig::set('sf_nav_id', $this->community->getId());
     31    }
    2932  }
    3033}
  • OpenPNE3/plugins/opCommunityTopicPlugin/branches/kawahara_mobile/apps/pc_frontend/modules/communityTopic/templates/_communityTopicList.php

    r10586 r11055  
    11<?php if ($community->isViewableCommunityTopic($sf_user->getMemberId())): ?>
     2<?php $sf_response->addStylesheet('/opCommunityTopicPlugin/css/communityTopic') ?>
    23<?php use_helper('Date'); ?>
    3 <tr>
     4<tr class="communityTopic">
    45<th><?php echo __('Community Topics') ?></th>
    56<td>
    6 <ul>
    7 <?php if (count($communityTopics)): ?>
     7<?php if ($count = count($communityTopics)): ?>
     8<ul class="articleList">
    89<?php foreach ($communityTopics as $key => $communityTopic): ?>
    910<li>
     
    1213</li>
    1314<?php endforeach; ?>
     15</ul>
     16<?php endif; ?>
     17<div class="moreInfo">
     18<ul class="moreInfo">
     19<?php if($count): ?>
    1420<li><?php echo link_to(__('More'), 'communityTopic_list_community', $community); ?></li>
    1521<?php endif; ?>
     
    1824<?php endif; ?>
    1925</ul>
    20 </td>
     26</div>
    2127</tr>
    2228<?php endif; ?>
  • OpenPNE3/plugins/opCommunityTopicPlugin/branches/kawahara_mobile/apps/pc_frontend/modules/communityTopic/templates/_topicCommentListBox.php

    r11050 r11055  
    55<ul class="articleList">
    66<?php foreach ($communityTopic as $topic): ?>
    7 <li><span class="date"><?php echo op_format_date($topic->getUpdatedAt(), 'XShortDateJa') ?></span><?php echo link_to(op_truncate($topic->getName(), 36).' ('.$topic->countCommunityTopicComments().')', 'communityTopic_show', $topic).' ('.$topic->getCommunity()->getName().')' ?></li>
     7<li><span class="date"><?php echo op_format_date($topic->getUpdatedAt(), 'XShortDateJa') ?></span>
     8<?php echo sprintf('%s (%s)',
     9  link_to(sprintf('%s(%d)',
     10    op_truncate($topic->getName(), 36),
     11    $topic->countCommunityTopicComments()
     12  ), 'communityTopic_show', $topic),
     13  $topic->getCommunity()->getName()
     14) ?></li>
    815<?php endforeach; ?>
    916</ul>
     17<div class="moreInfo">
     18<ul class="moreInfo">
     19<li><?php echo link_to(__('More'), 'communityTopic_recently_topic_list') ?></li>
     20</ul>
     21</div>
    1022</div>
    1123</div></div>
  • OpenPNE3/plugins/opCommunityTopicPlugin/branches/kawahara_mobile/lib/action/opCommunityTopicPluginTopicActions.class.php

    r11037 r11055  
    2020 */
    2121
    22 class opCommunityTopicPluginTopicActions extends sfActions
     22abstract class opCommunityTopicPluginTopicActions extends sfActions
    2323{
    2424  /**
     
    2727  public function preExecute()
    2828  {
    29     $object = $this->getRoute()->getObject();
    30 
    31     if ($object instanceof Community)
    32     {
    33       $this->community = $object;
    34     }
    35     elseif ($object instanceof CommunityTopic)
    36     {
    37       $this->communityTopic = $object;
    38       $this->community = $this->communityTopic->getCommunity();
     29    if ($this->getRoute() instanceof sfPropelRoute)
     30    {
     31      $object = $this->getRoute()->getObject();
     32
     33      if ($object instanceof Community)
     34      {
     35        $this->community = $object;
     36      }
     37      elseif ($object instanceof CommunityTopic)
     38      {
     39        $this->communityTopic = $object;
     40        $this->community = $this->communityTopic->getCommunity();
     41      }
    3942    }
    4043  }
     
    5457    }
    5558
    56     $this->pager = CommunityTopicPeer::getCommunityTopicListPager($this->community->getId(), $request->getParameter('page'), $this->size);
     59    $this->pager = CommunityTopicPeer::getCommunityTopicListPager(
     60      $this->community->getId(),
     61      $request->getParameter('page'),
     62      $this->size
     63    );
     64
     65    return sfView::SUCCESS;
    5766  }
    5867
     
    6776
    6877    $this->form = new CommunityTopicCommentForm();
     78
     79    return sfView::SUCCESS;
    6980  }
    7081
     
    7990
    8091    $this->form = new CommunityTopicForm();
     92
     93    return sfView::SUCCESS;
    8194  }
    8295
     
    96109
    97110    $this->setTemplate('new');
     111   
     112    return sfView::SUCCESS;
    98113  }
    99114 
     
    108123
    109124    $this->form = new CommunityTopicForm($this->communityTopic);
     125   
     126    return sfView::SUCCESS;
    110127  }
    111128 
     
    123140
    124141    $this->setTemplate('edit');
     142   
     143    return sfView::SUCCESS;
    125144  }
    126145
     
    136155
    137156    $this->form = new sfForm();
     157   
     158    return sfView::SUCCESS;
    138159  }
    139160 
     
    154175
    155176    $this->redirect('community/home?id='.$this->community->getId());
     177  }
     178
     179  /**
     180   * Executes recentlyTopicList
     181   *
     182   * @param sfRequest $request A request object
     183   */
     184  public function executeRecentlyTopicList($request)
     185  {
     186    if (!$this->size)
     187    {
     188      $this->size = 50;
     189    }
     190
     191    $this->pager = CommunityTopicPeer::getRecentlyTopicListPager(
     192      $this->getUser()->getMemberId(),
     193      $request->getParameter('page', 1),
     194      $this->size
     195    );
     196
     197    return sfView::SUCCESS;
    156198  }
    157199
  • OpenPNE3/plugins/opCommunityTopicPlugin/branches/kawahara_mobile/lib/action/opCommunityTopicPluginTopicCommentActions.class.php

    r11037 r11055  
    1919 * @author     Shogo Kawahara <kawahara@tejimaya.net>
    2020 */
    21 class opCommunityTopicPluginTopicCommentActions extends sfActions
     21abstract class opCommunityTopicPluginTopicCommentActions extends sfActions
    2222{
    2323  /**
     
    6161
    6262    $this->setTemplate('../../communityTopic/templates/show');
     63
     64    return sfView::SUCCESS;
    6365  }
    6466
     
    7375
    7476    $this->form = new sfForm();
     77
     78    return sfView::SUCCESS;
    7579  }
    7680
  • OpenPNE3/plugins/opCommunityTopicPlugin/branches/kawahara_mobile/lib/action/opCommunityTopicPluginTopicCommentComponents.class.php

    r11036 r11055  
    1818 * @author     Shogo Kawahara <kawahara@tejimaya.net>
    1919 */
    20 class opCommunityTopicCommentComponents extends sfComponents
     20abstract class opCommunityTopicCommentComponents extends sfComponents
    2121{
    2222  public function executeList($request)
  • OpenPNE3/plugins/opCommunityTopicPlugin/branches/kawahara_mobile/lib/action/opCommunityTopicPluginTopicComponents.class.php

    r11036 r11055  
    99 */
    1010
    11 class opCommunityTopicPluginTopicComponents extends sfComponents
     11/**
     12 * opCommunityTopicPluginTopicComponents
     13 *
     14 * @package    OpenPNE
     15 * @subpackage action
     16 * @author     masabon
     17 * @author     Kousuke Ebihara <ebihara@tejimaya.com>
     18 * @author     Rimpei Ogawa <ogawa@tejimaya.com>
     19 * @author     Shogo Kawahara <kawahara@tejimaya.net>
     20 */
     21abstract class opCommunityTopicPluginTopicComponents extends sfComponents
    1222{
    1323  public function executeCommunityTopicList()
  • OpenPNE3/plugins/opCommunityTopicPlugin/branches/kawahara_mobile/lib/model/CommunityTopicPeer.php

    r10010 r11055  
    4949    return CommunityTopicPeer::doSelect($c);
    5050  }
     51
     52  public static function getRecentlyTopicListPager($memberId, $page = 1, $size = 50)
     53  {
     54    $c = new Criteria();
     55    $communityIds = CommunityPeer::getIdsByMemberId($memberId);
     56    $c->add(CommunityTopicPeer::COMMUNITY_ID, $communityIds, Criteria::IN);
     57    $c->addDescendingOrderByColumn(CommunityTopicPeer::UPDATED_AT);
     58   
     59    $pager = new sfPropelPager('CommunityTopic', $size);
     60    $pager->setCriteria($c);
     61    $pager->setPage($page);
     62    $pager->init();
     63
     64    return $pager;
     65  }
    5166}
  • OpenPNE3/plugins/opCommunityTopicPlugin/branches/kawahara_mobile/lib/opCommunityTopicPluginRouting.class.php

    r10389 r11055  
    7272        array('model' => 'CommunityTopic', 'type' => 'object')
    7373      ),
     74      'communityTopic_recently_topic_list' => new sfRoute(
     75        '/communityTopic/recentlyTopicList',
     76        array('module' => 'communityTopic', 'action' => 'recentlyTopicList')
     77      ),
    7478
    7579      'communityTopic_comment_create' => new sfPropelRoute(
  • OpenPNE3/plugins/opCommunityTopicPlugin/branches/kawahara_mobile/web/css/communityTopic.css

    r10508 r11055  
    4444  padding: 10px 0;
    4545}
     46
     47.communityTopic ul.articleList {
     48  background:transparent url(../../images/icon_2.gif) no-repeat scroll 3px 0.4em;
     49  padding-bottom:5px;
     50  padding-left:85px;
     51  text-indent:-72px;
     52}
     53
     54.communityTopic div.moreInfo ul.moreInfo {
     55  margin: 0 2px 0 auto;
     56  width: 10em;
     57}
     58
     59
     60
Note: See TracChangeset for help on using the changeset viewer.