execute() public method

Execute the action If a javascript file with the name of the module or action exists it will be loaded.
public execute ( )
Beispiel #1
0
 /**
  * Execute the extra
  *
  * @return void
  */
 public function execute()
 {
     parent::execute();
     // Define email from the subscribe widget
     $email = $this->getEmail();
     // Create the form
     $form = $this->createForm($this->get('mailmotor.form.subscription'), new Subscription($email, FRONTEND_LANGUAGE));
     $form->handleRequest($this->get('request'));
     if (!$form->isValid()) {
         $this->tpl->assign('form', $form->createView());
         if ($form->isSubmitted()) {
             $this->tpl->assign('mailmotorSubscribeHasFormError', true);
         }
         $this->loadTemplate();
         $this->parse();
         return;
     }
     $redirectLink = FrontendNavigation::getURLForBlock('Mailmotor', 'Subscribe') . '?subscribed=true';
     /** @var Subscription $subscription */
     $subscription = $form->getData();
     try {
         // The command bus will handle the unsubscription
         $this->get('command_bus')->handle($subscription);
     } catch (NotImplementedException $e) {
         // fallback for when no mail-engine is chosen in the Backend
         $this->get('event_dispatcher')->dispatch(NotImplementedSubscribedEvent::EVENT_NAME, new NotImplementedSubscribedEvent($subscription));
         $redirectLink .= '&double-opt-in=false';
     }
     $redirectLink .= '#mailmotorSubscribeForm';
     return $this->redirect($redirectLink);
 }
 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     //--Get the id
     $id = $this->URL->getParameter(1);
     //--check if the id is not empty
     if (empty($id)) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     //--Explode the id
     $ids = explode("-", $id);
     //--check if the id contains 2 elements
     if (count($ids) != 2) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     //--Get the ids and decrypt
     $send_id = (int) FrontendMailengineModel::decryptId($ids[0]);
     $user_id = (int) FrontendMailengineModel::decryptId($ids[1]);
     //--check if the ids are integers
     if ($send_id <= 0) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     if ($user_id > 0) {
         $data = array();
         $data["send_id"] = $send_id;
         $data["user_id"] = $user_id;
         //--Add open-mail to the database
         FrontendMailengineModel::insertMailOpen($data);
     }
     //--Create an empty image
     $this->createImage();
     //--Stop the script
     die;
 }
Beispiel #3
0
 /**
  * Execute the action
  * We will build the class name, require the class and call the execute method.
  */
 public function execute()
 {
     // build action-class-name
     $actionClass = 'Frontend\\Modules\\' . $this->getModule() . '\\Actions\\' . $this->getAction();
     if ($this->getModule() == 'Core') {
         $actionClass = 'Frontend\\Core\\Actions\\' . $this->getAction();
     }
     // validate if class exists (aka has correct name)
     if (!class_exists($actionClass)) {
         throw new FrontendException('The action class couldn\'t be found: ' . $actionClass . '.');
     }
     // create action-object
     $this->object = new $actionClass($this->getKernel(), $this->getModule(), $this->getAction(), $this->getData());
     // validate if the execute-method is callable
     if (!is_callable(array($this->object, 'execute'))) {
         throw new FrontendException('The action file should contain a callable method "execute".');
     }
     // call the execute method of the real action (defined in the module)
     $this->object->execute();
     // set some properties
     $this->setOverwrite($this->object->getOverwrite());
     if ($this->object->getTemplatePath() !== null) {
         $this->setTemplatePath($this->object->getTemplatePath());
     }
 }
Beispiel #4
0
 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     $this->loadTemplate();
     $this->getData();
     $this->parse();
 }
Beispiel #5
0
 /**
  * Execute the extra.
  */
 public function execute()
 {
     // get reset key
     $key = $this->URL->getParameter(0);
     // do we have an reset key?
     if (isset($key)) {
         // load parent
         parent::execute();
         // load template
         $this->loadTemplate();
         // get profile id
         $profileId = FrontendProfilesModel::getIdBySetting('forgot_password_key', $key);
         // have id?
         if ($profileId !== 0) {
             // load
             $this->loadForm();
             // validate
             $this->validateForm();
         } elseif ($this->URL->getParameter('sent') != 'true') {
             $this->redirect(FrontendNavigation::getURL(404));
         }
         // parse
         $this->parse();
     } else {
         $this->redirect(FrontendNavigation::getURL(404));
     }
 }
Beispiel #6
0
 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     $this->addJS('https://maps.googleapis.com/maps/api/js?sensor=false', true, false);
     $this->addJS('/src/Frontend/Modules/Addresses/Js/markerclusterer.js', true, false);
     $this->addJS('/src/Frontend/Modules/Addresses/Js/bootstrap.min.js', true, false);
     $this->addJS('/src/Frontend/Modules/Addresses/Js/bootstrap-multiselect.js', true, false);
     $this->addCSS('/src/Frontend/Modules/Addresses/Layout/Css/bootstrap-multiselect.css', true, false);
     $this->addCSS('/src/Frontend/Modules/Addresses/Layout/Css/Addresses.css', true, false);
     //--Get search
     $this->search = urldecode(\SpoonFilter::getGetValue("search", null, ""));
     if ($this->search != "") {
         $this->lat = urldecode(\SpoonFilter::getGetValue("lat", null, ""));
         $this->lng = urldecode(\SpoonFilter::getGetValue("lng", null, ""));
     }
     $this->addJSData('search', $this->search);
     $this->addJSData('lat', $this->lat);
     $this->addJSData('lng', $this->lng);
     $this->searchGroups = \SpoonFilter::getGetValue("groups", null, array(), 'array');
     //$this ->searchTopGroups = (\SpoonFilter::getGetValue("topgroups", null, array(),'array'));
     $this->loadTemplate();
     $this->loadData();
     $this->loadForm();
     $this->parse();
 }
Beispiel #7
0
 /**
  * Execute the extra
  */
 public function execute()
 {
     parent::execute();
     $this->tpl->assign('hideContentTitle', true);
     $this->loadTemplate();
     $this->getData();
     $this->parse();
 }
Beispiel #8
0
 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     $this->header->addCSS('/src/Frontend/Modules/' . $this->getModule() . '/Layout/Css/Agenda.css');
     $this->loadTemplate();
     $this->getData();
     $this->parse();
 }
Beispiel #9
0
 /**
  * Execute the extra
  */
 public function execute()
 {
     $this->addJS('http://maps.google.com/maps/api/js?sensor=true', true, false);
     parent::execute();
     $this->loadTemplate();
     $this->loadData();
     $this->parse();
 }
 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     $this->loadForm();
     $this->validateForm();
     $this->loadTemplate();
     $this->parse();
 }
Beispiel #11
0
 /**
  * Execute the extra
  */
 public function execute()
 {
     parent::execute();
     // overwrite the template path
     $this->setOverwrite(true);
     $this->setTemplatePath(FRONTEND_MODULES_PATH . '/' . $this->getModule() . '/Layout/Templates/Detail.tpl');
     $this->loadData();
     $this->parse();
 }
Beispiel #12
0
 /**
  * Execute the action
  */
 public function execute()
 {
     $this->addJS('http://maps.google.com/maps/api/js?sensor=true', true, false);
     $this->addJS('/src/Frontend/Modules/Addresses/Js/bootstrap.min.js', true, false);
     $this->addJS('/src/Frontend/Modules/Addresses/Js/bootstrap-multiselect.js', true, false);
     $this->addCSS('/src/Frontend/Modules/Addresses/Layout/Css/Addresses.css', true, false);
     parent::execute();
     $this->loadTemplate();
     $this->loadData();
     $this->parse();
 }
Beispiel #13
0
 /**
  * Execute the action
  */
 public function execute()
 {
     $this->addJS('http://maps.google.com/maps/api/js?sensor=true', true, false);
     parent::execute();
     $this->tpl->assign('hideContentTitle', true);
     $this->loadTemplate();
     $this->getData();
     $this->loadForm();
     $this->validateForm();
     $this->parse();
 }
 /**
  * Execute the extra
  *
  * @return void
  */
 public function execute()
 {
     // call the parent
     parent::execute();
     // load template
     $this->loadTemplate();
     // load the data
     $this->getData();
     // parse
     $this->parse();
 }
Beispiel #15
0
 /**
  * Execute the extra
  */
 public function execute()
 {
     $this->id = $this->URL->getParameter(1);
     // validate incoming parameters
     if ($this->id === null) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     parent::execute();
     $this->loadTemplate();
     $this->getData();
     $this->parse();
 }
Beispiel #16
0
 /**
  * Execute the extra
  */
 public function execute()
 {
     parent::execute();
     // hide contentTitle, in the template the title is wrapped with an inverse-option
     $this->tpl->assignGlobal('hideContentTitle', true);
     $this->loadTemplate();
     $this->getData();
     $this->updateStatistics();
     $this->loadForm();
     $this->validateForm();
     $this->parse();
 }
Beispiel #17
0
 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     $this->loadTemplate();
     $this->loadData();
     //--Add css
     $this->header->addCSS('/src/Frontend/Modules/' . $this->getModule() . '/Layout/Css/Gallery.css');
     //$this->header->addCSS('/src/Frontend/Modules/' . $this->getModule() . '/Layout/Css/Colorbox.css');
     //--Add javascript
     //$this->header->addJS('/src/Frontend/Modules/' . $this->getModule() . '/Js/Jquery.colorbox-min.js');
     $this->parse();
 }
 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     //--Get the id
     $this->id = \SpoonFilter::getGetValue('id', null, 0, 'int');
     //--Check if mailing exist
     if (!FrontendMailengineModel::extistSend($this->id)) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     $this->loadTemplate();
     $this->loadData();
     $this->parse();
 }
Beispiel #19
0
 /**
  * Execute the extra.
  */
 public function execute()
 {
     // only for guests
     if (!FrontendProfilesAuthentication::isLoggedIn()) {
         parent::execute();
         $this->loadTemplate();
         $this->loadForm();
         $this->validateForm();
         $this->parse();
     } else {
         // already logged in, redirect to settings
         $this->redirect(FrontendNavigation::getURLForBlock('Profiles', 'Settings'));
     }
 }
Beispiel #20
0
 /**
  * Execute the extra
  */
 public function execute()
 {
     // profile not logged in
     if (!FrontendProfilesAuthentication::isLoggedIn()) {
         parent::execute();
         $this->loadTemplate();
         $this->loadForm();
         $this->validateForm();
         $this->parse();
     } else {
         // profile logged in
         $this->redirect(FrontendNavigation::getURL(404));
     }
 }
Beispiel #21
0
 /**
  * Execute the extra.
  */
 public function execute()
 {
     // profile logged in
     if (FrontendProfilesAuthentication::isLoggedIn()) {
         parent::execute();
         $this->getData();
         $this->loadTemplate();
         $this->loadForm();
         $this->validateForm();
         $this->parse();
     } else {
         $this->redirect(FrontendNavigation::getURLForBlock('Profiles', 'Login') . '?queryString=' . FrontendNavigation::getURLForBlock('Profiles', 'ChangePassword'), 307);
     }
 }
Beispiel #22
0
 /**
  * Execute the extra
  */
 public function execute()
 {
     // define Google Maps API key
     $apikey = $this->get('fork.settings')->get('Core', 'google_maps_key');
     // check Google Maps API key, otherwise show error
     if ($apikey == null) {
         trigger_error('Please provide a Google Maps API key.');
     }
     $this->addJS('https://maps.googleapis.com/maps/api/js?key=' . $apikey, true, false);
     $this->addJS(FrontendLocationModel::getPathToMapStyles(false), true);
     parent::execute();
     $this->loadTemplate();
     $this->loadData();
     $this->parse();
 }
Beispiel #23
0
 /**
  * Execute the extra.
  */
 public function execute()
 {
     // only logged in profiles can seer their dashboard
     if (FrontendProfilesAuthentication::isLoggedIn()) {
         // call the parent
         parent::execute();
         /*
          * You could use this as some kind of dashboard where you can show an activity
          * stream, some statistics, ...
          */
         $this->loadTemplate();
     } else {
         // profile not logged in
         $this->redirect(FrontendNavigation::getURLForBlock('Profiles', 'Login') . '?queryString=' . FrontendNavigation::getURLForBlock('Profiles'), 307);
     }
 }
Beispiel #24
0
 /**
  * Execute.
  */
 public function execute()
 {
     parent::execute();
     // profile not logged in
     if (!FrontendProfilesAuthentication::isLoggedIn()) {
         $this->loadTemplate();
         $this->loadForm();
         $this->validateForm();
         $this->parse();
     } else {
         // profile already logged in
         // query string
         $queryString = urldecode(\SpoonFilter::getGetValue('queryString', null, SITE_URL));
         // redirect
         $this->redirect($queryString);
     }
 }
Beispiel #25
0
 /**
  * Execute the extra.
  */
 public function execute()
 {
     parent::execute();
     $this->loadTemplate();
     // profile not logged in
     if (!FrontendProfilesAuthentication::isLoggedIn()) {
         $this->loadForm();
         $this->validateForm();
         $this->parse();
     } elseif ($this->URL->getParameter('sent') == true) {
         // just registered so show success message
         $this->parse();
     } else {
         // already logged in, so you can not register
         $this->redirect(SITE_URL);
     }
 }
 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     //--Get the id
     $id = $this->URL->getParameter(1);
     //--check if the id is not empty
     if (empty($id)) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     //--Explode the id
     $ids = explode("-", $id);
     //--check if the id contains 2 elements
     if (count($ids) != 2) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     //--Get the ids and decrypt
     $link_id = (int) FrontendMailengineModel::decryptId($ids[0]);
     $user_id = (int) FrontendMailengineModel::decryptId($ids[1]);
     //--check if the ids are integers
     if ($link_id <= 0) {
         //--Redirect to 404
         $this->redirect(FrontendNavigation::getURL(404));
     }
     //--Only if userid > 0 (because of the preview on the frontend)
     if ($user_id > 0) {
         $data = array();
         $data["link_id"] = $link_id;
         $data["user_id"] = $user_id;
         //--Add click-link to the database
         FrontendMailengineModel::insertLinkClicked($data);
     }
     //--Redirect the page
     $this->redirectLink($link_id);
     //--Stop the script
     die;
 }
Beispiel #27
0
 /**
  * Execute the extra
  */
 public function execute()
 {
     parent::execute();
     $this->loadTemplate();
     $this->loadForm();
     $this->validateForm();
     $this->display();
     $this->saveStatistics();
 }