Beispiel #1
0
 public function executeParameters(sfWebRequest $request)
 {
     /*------------------------------ PREDEFINED LISTS---------------------------------------*/
     //List of tables to display:
     $this->tables = array_fill_keys(array(PredefinedLists::PUBLIC_CATEGORIES, PredefinedLists::UNITY, PredefinedLists::USER_AWARENESS, PredefinedLists::USER_SEG, PredefinedLists::COMPUTER_OS, PredefinedLists::COMPUTER_OS_FAMILY, PredefinedLists::METHOD_OF_PAYMENT), null);
     //Get all the tables to display:
     $this->tables = PredefinedLists::getData($this->tables);
     //Create a computer os form in order to have the select for the computer os family when adding a computer os:
     $this->os_form = new ComputerOsForm();
     /*---------------------------------- PARAMETERS------------------------------------------*/
     //Get the prefix of the current user:
     ParametersConfiguration::setUserPrefix(sfContext::getInstance()->getUser()->getAttribute('login'));
     //Get the parameters from xml file:
     $this->values = ParametersConfiguration::getAll();
     !$this->values['default_follow_moderator'] ? $this->values['default_follow_moderator'] = false : ($this->values['default_follow_moderator'] = true);
     //Indicate to the template if the system parameters have been updated (not by default):
     $this->update_system = $request->getAttribute('update_system', false);
     //Indicate to the template if the default parameters have been updated (not by default):
     $this->update_default = $request->getAttribute('update_def', false);
     /*------------------------------ SYSTEM PARAMETERS------------------------------------*/
     //Build the form:
     $this->form = new SystemParametersForm($this->values);
     /*----------------------------- DEFAULT PARAMETERS------------------------------------*/
     //Build the form:
     $cultures = array_merge($this->getContext()->get('InstalledCultures'), array('en'));
     $this->def_form = new DefaultParametersForm($this->values, array('cultures' => $cultures, 'follow' => $this->values['default_follow_moderator']));
 }
 /**
  * Requests are forwarded here when using the ->askConfirmation()
  * method on the actions class
  */
 public function executeAsk_confirmation(sfWebRequest $request)
 {
     if ($this->isAjax()) {
         $this->setLayout(false);
     } else {
         $this->loadAdminTheme();
     }
     $this->url = $request->getUri();
     $this->title = $request->getAttribute('title');
     $this->message = $request->getAttribute('message');
     $this->isAjax = $request->getAttribute('is_ajax');
 }
 public function executeMatchEmail(sfWebRequest $request)
 {
     $this->resource = $request->getAttribute('resource');
     $this->contact = $request->getAttribute('contact');
     $this->type = $this->resource['transaction_type'];
     $this->setLayout('layoutEmail');
 }
Beispiel #4
0
 public function executeConfirmation(sfWebRequest $request)
 {
     $this->url = $request->getUri();
     $this->title = $request->getAttribute('title');
     $this->message = $request->getAttribute('message');
 }
 public function executeForm(sfWebRequest $request)
 {
     $this->reviewValue = $request->getParameter("v");
     $this->reviewType = $request->getParameter("t");
     $this->reviewEntityId = $request->getParameter("e");
     $this->reviewBox = $request->getParameter("b");
     $nl = $request->getParameter("nl");
     $this->reviewText = '';
     $this->reviewId = '';
     if ($request->getAttribute("cf") == 1) {
         $this->cf = 1;
     }
     $this->maxLength = BasesfReviewFrontActions::MAX_LENGTH;
     $this->redirect = false;
     if (!$this->getUser()->isAuthenticated()) {
         if ($nl == 1) {
             $this->prepareRedirect($request);
             $this->redirect = '@sf_guard_signin';
         } else {
             return 'NotLogged';
         }
     }
     if (!$this->redirect) {
         $criteria = new Criteria();
         $t = $request->getParameter("t");
         if ($t != '') {
             $criteria->add(SfReviewPeer::ENTITY_ID, $this->reviewEntityId);
             $criteria->add(SfReviewPeer::SF_REVIEW_TYPE_ID, $this->reviewType);
         } else {
             $criteria->add(SfReviewPeer::SF_REVIEW_ID, $this->reviewEntityId);
         }
         $criteria->add(SfReviewPeer::SF_GUARD_USER_ID, $this->getUser()->getGuardUser()->getId());
         if ($this->reviewValue) {
             SfReviewManager::postReview($this->getUser()->getGuardUser()->getId(), $this->reviewType, $this->reviewEntityId, $this->reviewValue, false, false, false, '?', 'form', '?');
         }
         $review = SfReviewPeer::doSelectOne($criteria);
         if ($review) {
             $this->reviewValue = $review->getValue();
             $this->reviewText = $review->getText();
             $this->reviewId = $review->getId();
             $this->reviewToFb = $review->getToFb();
             $this->reviewToTw = $review->getToTw();
             $this->anonReview = $review->getAnonymous();
         }
     }
 }
 public function executeRegisterDone(sfWebRequest $request)
 {
     $this->user = $request->getAttribute('user');
     return sfView::SUCCESS;
 }
 /**
  * Builds the body for the send token email
  */
 public function executeSendLoginTokenEmail(sfWebRequest $request)
 {
     $this->user = $request->getAttribute('user');
     $this->setLayout('layoutEmail');
 }
 /**
  * Internal action used by create the body for the email that goes out
  * to the creator of a "need time"
  */
 public function executeNeedEmail(sfWebRequest $request)
 {
     $this->resource = $request->getAttribute('resource');
     $this->setLayout('layoutEmail');
 }