/** * Executes search action * * @param opWebRequest $request a request object */ public function executeSearch(opWebRequest $request) { sfConfig::set('sf_nav_type', 'default'); $params = $request->getParameter('community', array()); $this->isResult = false; $this->category_id = 0; if (isset($params['name'])) { $params['name'] = $params['name']; $this->isResult = true; } if (isset($params['community_category_id'])) { $this->category_id = $params['community_category_id']; $params['community_category_id'] = $this->category_id; $this->isResult = true; } $this->filters = new CommunityFormFilter(); $this->filters->bind($params); $q = $this->filters->getQuery()->orderBy('id desc'); $this->pager = new sfDoctrinePager('Community', 10); $this->pager->setQuery($q); $this->pager->setPage($request->getParameter('page', 1)); $this->pager->init(); $this->categorys = Doctrine::getTable('CommunityCategory')->getAllChildren(); return sfView::SUCCESS; }
public function executeEdit(opWebRequest $request) { $this->form = new sfForm(); $memberId = $request->getParameter('member_id'); if ($request->isMethod(sfWebRequest::POST)) { $wid = $request->getParameter('wid'); if (!$memberId || !$wid) { return sfView::ERROR; } $member = Doctrine::getTable('Member')->find($memberId, null); if (is_null($member)) { return sfView::ERROR; } $config = Doctrine::getTable('MemberConfig')->retrieveByNameAndMemberId('op_kintai_member_wid', $memberId); if (!$config) { $config = new MemberConfig(); $config->setName('op_kintai_member_wid'); $config->setMember($member); } $config->setValue($wid); $config->save(); $this->message = "登録しました。"; $this->member = $member; $this->value = $wid; } else { $this->redirectIf(is_null($memberId), 'opGyoenKintaiPlugin/list'); $member = Doctrine::getTable('Member')->find($memberId, null); $this->redirectIf(is_null($member), 'opGyoenKintaiPlugin/list'); $this->member = $member; $config = Doctrine::getTable('MemberConfig')->retrieveByNameAndMemberId('op_kintai_member_wid', $memberId); $this->value = $config ? $config->getValue() : ''; } return sfView::SUCCESS; }
public function executeFriendListBox(opWebRequest $request) { if ($request->hasParameter('id') && $request->getParameter('module') == 'member' && $request->getParameter('action') == 'profile') { $this->member = Doctrine::getTable('Member')->find($request->getParameter('id')); } else { $this->member = $this->getUser()->getMember(); } $this->row = $this->gadget->getConfig('row'); $this->col = $this->gadget->getConfig('col'); $this->friends = $this->member->getFriends($this->row * $this->col, true); }
public function executeSmtCommunity(opWebRequest $request) { $this->communityId = (int) $request->getParameter('id'); $this->community = Doctrine::getTable('Community')->find($this->communityId); opSmartphoneLayoutUtil::setLayoutParameters(array('community' => $this->community)); $this->setTemplate('smtCommunity'); return sfView::SUCCESS; }
public function executeSmtMemberJoinCommunityListBox(opWebRequest $request) { if ($request->hasParameter('id') && 'profile' !== sfContext::getInstance()->getActionName()) { $this->member = Doctrine::getTable('Member')->find($request->getParameter('id')); } else { $this->member = $this->getUser()->getMember(); } }
public function executeCommunity(opWebRequest $request) { $communityId = $request->getParameter('id'); $community = Doctrine::getTable('Community')->find($communityId); $this->forward404Unless($community, 'Undefined community.'); $this->forwardIf($request->isSmartphone(), 'timeline', 'smtCommunity'); sfConfig::set('sf_nav_type', 'community'); return sfView::SUCCESS; }
public function executeFriendListBox(opWebRequest $request) { $memberId = $this->getUser()->getMemberId(); if ($request->hasParameter('id')) { $memberId = $request->getParameter('id'); } $this->member = Doctrine::getTable('Member')->find($memberId); $this->row = $this->gadget->getConfig('row'); $this->friends = $this->member->getFriends($this->row, true); }
public function executeJoinListBox(opWebRequest $request) { $memberId = $this->getUser()->getMemberId(); if ($request->hasParameter('id')) { $memberId = $request->getParameter('id'); } $this->member = Doctrine::getTable('Member')->find($memberId); $this->row = $this->gadget->getConfig('row'); $this->crownIds = Doctrine::getTable('CommunityMember')->getCommunityIdsOfAdminByMemberId($this->member->getId()); $this->communities = Doctrine::getTable('Community')->retrievesByMemberId($this->member->getId(), $this->row, true); }
public function executeIndex(opWebRequest $request) { $this->form = new opTimelinePluginConfigurationForm(); if ($request->isMethod(sfRequest::POST)) { $this->form->bind($request->getParameter($this->form->getName())); if ($this->form->isValid()) { $this->form->save(); $this->getUser()->setFlash('notice', 'Saved configuration successfully.'); $this->redirect('opTimelinePlugin/index'); } } }
public function executeDecision(opWebRequest $request) { $request->checkCSRFProtection(); $this->checkCategory(); $params = array('category' => $this->category, 'id' => $request->getParameter('id'), 'is_accepted' => $request->hasParameter('accept'), 'member' => $this->getUser()->getMember()); $event = new sfEvent($this, 'op_confirmation.decision', $params); $this->dispatcher->notifyUntil($event); if ($event->isProcessed()) { $message = (string) $event->getReturnValue(); $this->getUser()->setFlash('notice', $message); } $this->redirect('@confirmation_list?category=' . $this->category); }
public function executeDeleteImage(opWebRequest $request) { $this->image = Doctrine::getTable('MemberImage')->find($request->getParameter('member_image_id')); $this->forward404Unless($this->image); $this->forward404Unless($this->image->getMemberId() == $this->getUser()->getMemberId()); $this->form = new sfForm(); if ($request->isMethod(sfWebRequest::POST)) { $request->checkCSRFProtection(); $this->image->delete(); $this->redirect('member/configImage'); } }
/** * Executes joinlist action * * @param opWebRequest $request A request object */ public function executeJoinlist(opWebRequest $request) { $this->forwardIf($request->isSmartphone(), 'community', 'smtJoinlist'); sfConfig::set('sf_nav_type', 'default'); if ($request->hasParameter('id') && $request->getParameter('id') != $this->getUser()->getMemberId()) { sfConfig::set('sf_nav_type', 'friend'); } return parent::executeJoinlist($request); }
public function executeBirthdayBox(opWebRequest $request) { $id = $request->getParameter('id', $this->getUser()->getMemberId()); $birthday = Doctrine::getTable('MemberProfile')->getViewableProfileByMemberIdAndProfileName($id, 'op_preset_birthday'); $this->targetDay = $birthday ? opToolkit::extractTargetDay((string) $birthday) : false; }
public function executeSmtCommunityMemberJoinListBox(opWebRequest $request) { $this->id = $request->getParameter('id'); $this->community = Doctrine::getTable('Community')->find($this->id); }
/** * Executes dropMember action * * @param sfRequest $request A request object */ public function executeDropMember(opWebRequest $request) { $this->redirectUnless($this->isAdmin || $this->isSubAdmin, '@error'); $member = Doctrine::getTable('Member')->find($request->getParameter('member_id')); $this->forward404Unless($member); $isCommunityMember = Doctrine::getTable('CommunityMember')->isMember($member->getId(), $this->id); $this->redirectUnless($isCommunityMember, '@error'); $isAdmin = Doctrine::getTable('CommunityMember')->isAdmin($member->getId(), $this->id); $isSubAdmin = Doctrine::getTable('CommunityMember')->isSubAdmin($member->getId(), $this->id); $this->redirectIf($isAdmin || $isSubAdmin, '@error'); if ($request->isMethod(sfWebRequest::POST)) { $request->checkCSRFProtection(); Doctrine::getTable('CommunityMember')->quit($member->getId(), $this->id); $this->redirect('@community_memberManage?id=' . $this->id); } $this->member = $member; $this->community = Doctrine::getTable('Community')->find($this->id); return sfView::INPUT; }
public function executeShowAllMemberActivity(opWebRequest $request) { if (!isset($this->size)) { $this->size = 20; } $page = $request->getParameter('page', 1); if ($page == 1 && opConfig::get('is_allow_post_activity')) { $activityData = new ActivityData(); $activityData->setBody($request->getParameter('body')); $this->form = new ActivityDataForm($activityData); } $this->pager = Doctrine::getTable('ActivityData')->getAllMemberActivityListPager($page, $this->size); }
/** * Executes changeLanguage action * * @param opWebRequest $request a request object */ public function executeChangeLanguage(opWebRequest $request) { if ($request->isMethod(sfWebRequest::POST)) { $form = new opLanguageSelecterForm(); if ($form->bindAndSetCulture($request->getParameter('language'))) { $this->redirect($form->getValue('next_uri')); } } $this->redirect('@homepage'); }