Exemplo n.º 1
0
 /**
  * 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;
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 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;
 }
Exemplo n.º 5
0
 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();
     }
 }
Exemplo n.º 6
0
 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;
 }
Exemplo n.º 7
0
 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);
 }
Exemplo n.º 8
0
 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);
 }
Exemplo n.º 9
0
 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);
 }
Exemplo n.º 11
0
 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');
     }
 }
Exemplo n.º 12
0
 /**
  * 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);
 }
Exemplo n.º 13
0
 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;
 }
Exemplo n.º 14
0
 public function executeSmtCommunityMemberJoinListBox(opWebRequest $request)
 {
     $this->id = $request->getParameter('id');
     $this->community = Doctrine::getTable('Community')->find($this->id);
 }
Exemplo n.º 15
0
 /**
  * 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;
 }
Exemplo n.º 16
0
 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);
 }
Exemplo n.º 17
0
 /**
  * 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');
 }