public function process() { Phpfox::isUser(true); list($iCnt, $aFriends) = Friend_Service_Request_Request::instance()->get(0, 100); foreach ($aFriends as $key => $friend) { if ($friend['relation_data_id']) { $aFriends[$key]['relation_name'] = Custom_Service_Relation_Relation::instance()->getRelationName($friend['relation_id']); } } $this->template()->assign(['aFriends' => $aFriends]); }
/** * Controller */ public function process() { Phpfox::isUser(true); if ($iDeleteId = $this->request()->get('id')) { if (Phpfox::getService('friend.request.process')->delete($iDeleteId, Phpfox::getUserId())) { $this->url()->send('friend.pending', null, Phpfox::getPhrase('friend.friends_request_successfully_deleted')); } } $iPage = $this->request()->getInt('page'); $iPageSize = 12; list($iCnt, $aPendingRequests) = Friend_Service_Request_Request::instance()->getPending($iPage, $iPageSize); Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt)); Friend_Service_Friend::instance()->buildMenu(); $this->template()->setTitle('Friends')->setBreadcrumb(Phpfox::getPhrase('friend.my_friends'), $this->url()->makeUrl('friend')); $this->template()->setTitle(Phpfox::getPhrase('friend.pending_friend_requests'))->setHeader('cache', array())->assign(array('aPendingRequests' => $aPendingRequests)); }
public function process() { Phpfox::isUser(true); list($iCnt, $aFriends) = Friend_Service_Request_Request::instance()->get(0, 100); foreach ($aFriends as $key => $friend) { if ($friend['relation_data_id']) { $sRelationShipName = Custom_Service_Relation_Relation::instance()->getRelationName($friend['relation_id']); if (isset($sRelationShipName) && !empty($sRelationShipName)) { $aFriends[$key]['relation_name'] = $sRelationShipName; } else { //This relationship was removed unset($aFriends[$key]); } } } $this->template()->assign(['aFriends' => $aFriends]); }
public function process() { Phpfox::isUser(true); list($iCnt, $aFriends) = Friend_Service_Request_Request::instance()->get(0, 100); $this->template()->assign(['aFriends' => $aFriends]); }