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

Changeset 9761


Ignore:
Timestamp:
Dec 29, 2008, 12:57:36 AM (14 years ago)
Author:
ebihara
Message:

#3249:added actions and templates to manage of community members

Location:
OpenPNE3/trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/apps/pc_frontend/modules/community/templates/homeSuccess.php

    r9760 r9761  
    99  'moreInfo' => array(sprintf('%s(%d)', __('全てを見る'), $community->countCommunityMembers()) => 'community/memberList?id=' . $community->getId()),
    1010);
     11
     12if ($isAdmin)
     13{
     14  $option['moreInfo'][__('メンバー管理')] = 'community/memberManage?id='.$community->getId();
     15}
     16
    1117include_parts('nineTable', 'frendList', $option);
    1218?>
  • OpenPNE3/trunk/lib/action/sfOpenPNECommunityAction.class.php

    r9599 r9761  
    120120  public function executeQuit($request)
    121121  {
    122     if (!$this->isCommunityMember || $this->isAdmin) {
     122    if (!$this->isCommunityMember || $this->isAdmin)
     123    {
    123124      return sfView::ERROR;
    124125    }
     
    127128    $this->redirect('community/home?id=' . $this->id);
    128129  }
     130
     131 /**
     132  * Executes memberManage action
     133  *
     134  * @param sfRequest $request A request object
     135  */
     136  public function executeMemberManage($request)
     137  {
     138    $this->redirectUnless($this->isAdmin, '@error');
     139
     140    $this->community = CommunityPeer::retrieveByPk($this->id);
     141    $this->pager = CommunityPeer::getCommunityMemberListPager($this->id, $request->getParameter('page', 1));
     142
     143    if (!$this->pager->getNbResults())
     144    {
     145      return sfView::ERROR;
     146    }
     147
     148    return sfView::SUCCESS;
     149  }
     150
     151 /**
     152  * Executes dropMember action
     153  *
     154  * @param sfRequest $request A request object
     155  */
     156  public function executeDropMember($request)
     157  {
     158    $this->redirectUnless($this->isAdmin, '@error');
     159    $member = MemberPeer::retrieveByPk($request->getParameter('member_id'));
     160    $this->forward404Unless($member);
     161
     162    $isCommunityMember = CommunityMemberPeer::isMember($member->getId(), $this->id);
     163    $this->redirectUnless($this->isAdmin, '@error');
     164    $isAdmin = CommunityMemberPeer::isAdmin($member->getId(), $this->id);
     165    $this->redirectIf($isAdmin, '@error');
     166
     167    CommunityMemberPeer::quit($member->getId(), $this->id);
     168    $this->redirect('community/memberManage?id='.$this->id);
     169  }
     170
    129171}
Note: See TracChangeset for help on using the changeset viewer.