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

Changeset 10906


Ignore:
Timestamp:
Feb 27, 2009, 5:13:48 PM (12 years ago)
Author:
ShogoKawahara
Message:

#3278:added ability to render crown icon for community administrator

Location:
OpenPNE3/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/apps/pc_frontend/modules/community/actions/components.class.php

    r10260 r10906  
    1818    $this->row = $this->gadget->getConfig('row');
    1919    $this->col = $this->gadget->getConfig('col');
     20    $this->crownIds = CommunityMemberPeer::getCommunityIdsOfAdminByMemberId($this->member->getId());
    2021    $this->communities = CommunityPeer::retrievesByMemberId($this->member->getId(), $this->row * $this->col, $c);
    2122  }
  • OpenPNE3/trunk/apps/pc_frontend/modules/community/templates/_joinListBox.php

    r10593 r10906  
    33  'title' => __('Communities List'),
    44  'list' => $communities,
     5  'crownIds' => $sf_data->getRaw('crownIds'),
    56  'link_to' => 'community/home?id=',
    67  'moreInfo' => array(link_to(sprintf('%s(%d)', __('Show all'), $member->countCommunityMembers()), 'community/joinlist')),
  • OpenPNE3/trunk/apps/pc_frontend/modules/community/templates/homeSuccess.php

    r10444 r10906  
    1212  'title' => __('Community Members'),
    1313  'list' => $community->getMembers(9),
     14  'crownIds' => array($community_admin->getId()),
    1415  'link_to' => 'member/profile?id=',
    1516  'moreInfo' => array(link_to(sprintf('%s(%d)', __('Show all'), $community->countCommunityMembers()), 'community/memberList?id='.$community->getId())),
  • OpenPNE3/trunk/apps/pc_frontend/modules/community/templates/joinlistSuccess.php

    r10375 r10906  
    33  'title' => __('Communities List'),
    44  'list' => $pager->getResults(),
     5  'crownIds' => $sf_data->getRaw('crownIds'),
    56  'link_to' => 'community/home?id=',
    67  'pager' => $pager,
  • OpenPNE3/trunk/apps/pc_frontend/modules/community/templates/memberListSuccess.php

    r10375 r10906  
    33  'title' => __('Community Members'),
    44  'list' => $pager->getResults(),
     5  'crownIds' => $sf_data->getRaw('crownIds'),
    56  'link_to' => 'member/profile?id=',
    67  'pager' => $pager,
  • OpenPNE3/trunk/apps/pc_frontend/templates/_partsNineTable.php

    r10609 r10906  
    55$options->setDefault('col', 3);
    66$options->setDefault('type', 'full');
     7$options->setDefault('crownIds', array());
    78?>
    8 
    99<table>
    1010<?php $row = ceil(count($options->list) / $options->row) ?>
     
    1414<?php for ($j = ($i * $options->col) - $options->col; ($i * $options->col) > $j; $j++): ?>
    1515<td><?php if (!empty($options->list[$j])): ?>
     16<?php if (in_array($options->list[$j]->getId(), $options->getRaw('crownIds'))): ?>
     17<p class="crown"><?php echo image_tag('icon_crown.gif', array('alt' => 'admin')) ?></p>
     18<?php endif; ?>
    1619<?php echo link_to(image_tag_sf_image($options->list[$j]->getImageFileName(), array('size' => '76x76')), $options->link_to.$options->list[$j]->getId()) ?>
    1720<?php endif; ?></td>
  • OpenPNE3/trunk/apps/pc_frontend/templates/_partsPhotoTable.php

    r10671 r10906  
    44$options->setDefault('col', 5);
    55$options->setDefault('type', 'full');
     6$options->setDefault('crownIds', array());
    67
    78$options->addRequiredOption('pager');
     
    1920<?php for ($j = ($i * $options->col) - $options->col; ($i * $options->col) > $j; $j++): ?>
    2021<td><?php if (!empty($options->list[$j])): ?>
     22<?php if (in_array($options->list[$j]->getId(), $options->getRaw('crownIds'))): ?>
     23<p class="crown"><?php echo image_tag('icon_crown.gif', array('alt' => 'admin')) ?></p>
     24<?php endif; ?>
    2125<?php echo link_to(image_tag_sf_image($options->list[$j]->getImageFileName(), array('size' => '76x76')), $options->link_to.$options->list[$j]->getId()) ?>
    2226<?php endif; ?></td>
  • OpenPNE3/trunk/lib/action/sfOpenPNECommunityAction.class.php

    r10467 r10906  
    8888    }
    8989
     90    $this->crownIds = CommunityMemberPeer::getCommunityIdsOfAdminByMemberId($memberId);
     91
    9092    return sfView::SUCCESS;
    9193  }
     
    104106      return sfView::ERROR;
    105107    }
    106 
     108   
     109    $this->crownIds = array(CommunityMemberPeer::getCommunityAdmin($this->id)->getMemberId());
     110   
    107111    return sfView::SUCCESS;
    108112  }
  • OpenPNE3/trunk/lib/model/CommunityMemberPeer.php

    r10003 r10906  
    7878    return self::doSelectOne($c);
    7979  }
     80
     81  public static function getCommunityIdsOfAdminByMemberId($memberId)
     82  {
     83    $c = new Criteria();
     84    $c->add(self::MEMBER_ID, $memberId);
     85    $c->add(self::POSITION, 'admin');
     86    $communityMembers = self::doSelect($c);
     87
     88    $result = array();
     89
     90    foreach ($communityMembers as $communityMember)
     91    {
     92      $result[] = $communityMember->getCommunityId();
     93    }
     94
     95    return $result;
     96  }
    8097}
Note: See TracChangeset for help on using the changeset viewer.