Example #1
0
 /**
  * Execute the action
  */
 public function execute()
 {
     // call parent, this will probably add some general CSS/JS or other required files
     parent::execute();
     // add js
     $this->header->addJS('jstree/jquery.tree.js', null, false);
     $this->header->addJS('jstree/lib/jquery.cookie.js', null, false);
     $this->header->addJS('jstree/plugins/jquery.tree.cookie.js', null, false);
     // get the templates
     $this->templates = BackendExtensionsModel::getTemplates();
     $this->isGod = BackendAuthentication::getUser()->isGod();
     // init var
     $defaultTemplateId = $this->get('fork.settings')->get('Pages', 'default_template', false);
     // fallback
     if ($defaultTemplateId === false) {
         // get first key
         $keys = array_keys($this->templates);
         // set the first items as default if no template was set as default.
         $defaultTemplateId = $this->templates[$keys[0]]['id'];
     }
     // set the default template as checked
     $this->templates[$defaultTemplateId]['checked'] = true;
     // get the extras
     $this->extras = BackendExtensionsModel::getExtras();
     $this->loadForm();
     $this->validateForm();
     $this->parse();
     $this->display();
 }
Example #2
0
 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     $this->loadDataGrid();
     $this->parse();
     $this->display();
 }
Example #3
0
 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     $this->loadForm();
     $this->validateForm();
     $this->parse();
     $this->display();
 }
Example #4
0
 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     $this->templates = BackendContentBlocksModel::getTemplates();
     $this->loadForm();
     $this->validateForm();
     $this->parse();
     $this->display();
 }
Example #5
0
 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     $this->groupId = $this->getParameter('group_id', 'int');
     $this->loadForm();
     $this->validateForm();
     $this->parse();
     $this->display();
 }
Example #6
0
 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     $this->cm = BackendMailmotorCMHelper::getCM();
     $this->loadForm();
     $this->validateForm();
     $this->parse();
     $this->display();
 }
Example #7
0
 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     // the user email and key provided match
     if (!$this->isUserAllowed()) {
         $this->redirect(BackendModel::createURLForAction('Index'));
     }
     $this->loadForm();
     $this->validateForm();
     $this->parse();
     $this->display();
 }
Example #8
0
 /**
  * Execute the action
  */
 public function execute()
 {
     // only one category allowed, so we redirect
     if (!BackendModel::get('fork.settings')->getForModule('Agenda', 'allow_multiple_categories', true)) {
         $this->redirect(BackendModel::createURLForAction('categories') . '&error=only-one-category-allowed');
     }
     parent::execute();
     $this->loadForm();
     $this->validateForm();
     $this->parse();
     $this->display();
 }
Example #9
0
 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     // load additional js
     $this->header->addJS('ThemeTemplate.js');
     // load data
     $this->loadData();
     $this->loadForm();
     $this->validateForm();
     $this->parse();
     $this->display();
 }
 /**
  * Execute the actions
  */
 public function execute()
 {
     // If step 1 isn't entered, redirect back to the first step of the wizard
     $this->record = \SpoonSession::get('module');
     if (!$this->record || !array_key_exists('title', $this->record)) {
         $this->redirect(Model::createURLForAction('add'));
     }
     parent::execute();
     $this->loadDataGrid();
     $this->parse();
     $this->display();
 }
 /**
  * Execute the action
  *
  * @return  void
  */
 public function execute()
 {
     // call parent, this will probably add some general CSS/JS or other required files
     parent::execute();
     // load the form
     $this->loadForm();
     // validate the form
     $this->validateForm();
     // parse
     $this->parse();
     // display the page
     $this->display();
 }
Example #12
0
 /**
  * Execute the action
  */
 public function execute()
 {
     $this->id = $this->getParameter('product_id', 'int');
     if ($this->id !== null && BackendCatalogModel::exists($this->id)) {
         parent::execute();
         $this->getData();
         $this->loadForm();
         $this->validateForm();
         $this->parse();
         $this->display();
     } else {
         $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing');
     }
 }
Example #13
0
 /**
  * Execute the action.
  */
 public function execute()
 {
     // get parameters
     $this->id = $this->getParameter('id', 'int');
     // does the item exists
     if ($this->id !== null && BackendProfilesModel::exists($this->id)) {
         parent::execute();
         $this->loadForm();
         $this->validateForm();
         $this->parse();
         $this->display();
     } else {
         $this->redirect(BackendModel::createURLForAction('Index') . '&error=non-existing');
     }
 }
Example #14
0
 public function execute()
 {
     // get parameters
     $this->id = $this->getParameter('id', 'int');
     if ($this->id !== null && BackendHotelsModel::exists('hotels', $this->id)) {
         parent::execute();
         $this->getData();
         $this->loadForm();
         $this->validateForm();
         $this->parse();
         $this->display();
     } else {
         // no item found, throw an exception, because somebody is f*****g with our URL
         $this->redirect(BackendModel::createURLForAction('Index') . '&error=non-existing');
     }
 }
 /**
  * Execute the actions
  */
 public function execute()
 {
     // If step 1 isn't entered, redirect back to the first step of the wizard
     $this->record = \SpoonSession::get('module');
     if (!$this->record || !array_key_exists('title', $this->record)) {
         $this->redirect(Model::createURLForAction('Add'));
     }
     // If there are no fields added, redirect back to the second step of the wizard
     if (!array_key_exists('fields', $this->record) || empty($this->record['fields'])) {
         $this->redirect(Model::createURLForAction('AddStep2'));
     }
     parent::execute();
     $this->loadForm();
     $this->validateForm();
     $this->parse();
     $this->display();
 }
Example #16
0
 public function execute()
 {
     parent::execute();
     $form = new TeamType('add');
     if ($form->handle()) {
         $teamMember = $form->getData();
         $this->get('team_repository')->add($teamMember);
         return $this->redirect(Model::createURLForAction('Index') . '&report=added' . '&highlight=row-' . $teamMember->getId());
     }
     // assign the detail url to the template if available
     $url = Model::getURLForBlock($this->URL->getModule(), 'Detail');
     if (Model::getURL(404) != $url) {
         $this->tpl->assign('detailURL', SITE_URL . $url);
     }
     $form->parse($this->tpl);
     $this->parse();
     $this->display();
 }
Example #17
0
 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     $form = $this->createForm(new ContentBlockType($this->get('fork.settings')->get('Core', 'theme', 'core')));
     $form->handleRequest($this->get('request'));
     if (!$form->isValid()) {
         $this->tpl->assign('form', $form->createView());
         $this->parse();
         $this->display();
         return;
     }
     /** @var CreateContentBlock $createContentBlock */
     $createContentBlock = $form->getData();
     $createContentBlock->userId = Authentication::getUser()->getUserId();
     // The command bus will handle the saving of the content block in the database.
     $this->get('command_bus')->handle($createContentBlock);
     $this->get('event_dispatcher')->dispatch(ContentBlockCreated::EVENT_NAME, new ContentBlockCreated($createContentBlock->contentBlock));
     return $this->redirect(BackendModel::createURLForAction('Index', null, null, ['report' => 'added', 'var' => $createContentBlock->title]));
 }
Example #18
0
 /**
  * Execute the action.
  */
 public function execute()
 {
     // call parent, this will probably add some general CSS/JS or other required files
     parent::execute();
     // zip extension is required for module upload
     if (!extension_loaded('zlib')) {
         $this->tpl->assign('zlibIsMissing', true);
     }
     if (!$this->isWritable()) {
         // we need write rights to upload files
         $this->tpl->assign('notWritable', true);
     } else {
         // everything allright, we can upload
         $this->loadForm();
         $this->validateForm();
         $this->parse();
     }
     // display the page
     $this->display();
 }
 /**
  * Execute the action
  *
  * @return  void
  */
 public function execute()
 {
     // get parameters
     $this->id = $this->getParameter('id');
     // does the item exists
     if ($this->id !== null && BackendSlideshowModel::existsGallery($this->id)) {
         // call parent, this will probably add some general CSS/JS or other required files
         parent::execute();
         // get all data for the item we want to edit
         $this->getData();
         // load the form
         $this->loadForm();
         // validate the form
         $this->validateForm();
         // parse
         $this->parse();
         // display the page
         $this->display();
     } else {
         // no item found, throw an exception, because somebody is f*****g with our URL
         $this->redirect(BackendModel::createURLForAction('Index') . '&error=non-existing');
     }
 }