In this case this is the base class for the add action
Inheritance: extends Action
Example #1
0
 /**
  * Parse the form
  */
 protected function parse()
 {
     parent::parse();
     // prevent XSS
     $filter = \SpoonFilter::arrayMapRecursive('htmlspecialchars', $this->filter);
     $this->tpl->assign($filter);
 }
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();
 }
 /**
  * Parse the form
  *
  * @return  void
  */
 protected function parse()
 {
     // call parent
     parent::parse();
     // assign the active record and additional variables
     $this->tpl->assign('item', $this->record);
     // assign image input fields
     $this->tpl->assign('imageInput', $this->ImageInput);
 }
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();
     $this->groupId = $this->getParameter('group_id', 'int');
     $this->loadForm();
     $this->validateForm();
     $this->parse();
     $this->display();
 }
Example #8
0
 public function parse()
 {
     parent::parse();
     $url = BackendModel::getURLForBlock($this->URL->getModule(), 'Category');
     $url404 = BackendModel::getURL(404);
     if ($url404 != $url) {
         $this->tpl->assign('detailURL', SITE_URL . $url);
     }
 }
Example #9
0
 /**
  * Parse the page
  */
 protected function parse()
 {
     parent::parse();
     // assign the url for the detail page
     $url = BackendModel::getURLForBlock($this->URL->getModule(), 'Group');
     $url404 = BackendModel::getURL(404);
     if ($url404 != $url) {
         $this->tpl->assign('detailURL', SITE_URL . $url);
     }
 }
Example #10
0
 /**
  * Parse the page
  */
 protected function parse()
 {
     parent::parse();
     // get url
     $url = BackendModel::getURLForBlock($this->URL->getModule(), 'detail');
     $url404 = BackendModel::getURL(404);
     // parse additional variables
     if ($url404 != $url) {
         $this->tpl->assign('detailURL', SITE_URL . $url);
     }
 }
Example #11
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 #12
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();
 }
 /**
  * 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 #14
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 #15
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 #16
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 #17
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();
 }
Example #18
0
 /**
  * Parses stuff into the template
  */
 protected function parse()
 {
     parent::parse();
     $this->tpl->assign('product', $this->product);
 }
Example #19
0
 /**
  * Parse the page
  */
 protected function parse()
 {
     parent::parse();
     // add css
     $this->header->addCSS('/src/Backend/Modules/' . $this->getModule() . '/Layout/Css/agenda.css', null, true);
     // get url
     $url = BackendModel::getURLForBlock($this->URL->getModule(), 'detail');
     $url404 = BackendModel::getURL(404);
     // parse additional variables
     if ($url404 != $url) {
         $this->tpl->assign('detailURL', SITE_URL . $url);
     }
     $this->record['url'] = $this->meta->getURL();
 }
Example #20
0
 protected function parse()
 {
     parent::parse();
     $this->tpl->assign('fieldLanguages', $this->fieldLanguages);
 }
Example #21
0
 /**
  * Parse
  */
 protected function parse()
 {
     parent::parse();
     $this->tpl->assign('notifyProfile', $this->notifyProfile);
 }
 /**
  * Parse the page
  */
 protected function parse()
 {
     $this->tpl->assign('item', $this->record);
     parent::parse();
 }
 /**
  * Parse the page
  */
 protected function parse()
 {
     parent::parse();
 }
Example #24
0
 /**
  * Parse the form
  */
 protected function parse()
 {
     parent::parse();
     // assign form errors
     $this->tpl->assign('formErrors', (string) $this->frm->getErrors());
 }
Example #25
0
 /**
  * Parses stuff into the template
  */
 protected function parse()
 {
     parent::parse();
     $this->tpl->assign('item', $this->item);
 }
 /**
  * Parse the form
  *
  * @return void
  */
 protected function parse()
 {
     // call parent
     parent::parse();
     $url = BackendModel::getURLForBlock($this->URL->getModule(), 'Detail');
     $url404 = BackendModel::getURL(404);
     // parse additional variables
     if ($url404 != $url) {
         $this->tpl->assign('detailURL', SITE_URL . $url);
     }
     // assign categories
     $this->tpl->assign('categories', $this->categories);
 }
 /**
  * Parse the page
  */
 protected function parse()
 {
     parent::parse();
     $this->tpl->assign('datagrid', $this->datagrid->getNumResults() != 0 ? $this->datagrid->getContent() : false);
     $this->tpl->assign('varcharFound', $this->allowSave);
 }
Example #28
0
 /**
  * Parse
  */
 protected function parse()
 {
     parent::parse();
     // parse some variables
     $this->tpl->assign('templates', $this->templates);
     $this->tpl->assign('isGod', $this->isGod);
     $this->tpl->assign('positions', $this->positions);
     $this->tpl->assign('extrasData', json_encode(BackendExtensionsModel::getExtrasData()));
     $this->tpl->assign('extrasById', json_encode(BackendExtensionsModel::getExtras()));
     $this->tpl->assign('prefixURL', rtrim(BackendPagesModel::getFullURL(1), '/'));
     $this->tpl->assign('formErrors', (string) $this->frm->getErrors());
     $this->tpl->assign('showTags', $this->showTags());
     // get default template id
     $defaultTemplateId = $this->get('fork.settings')->get('Pages', 'default_template', 1);
     // assign template
     $this->tpl->assignArray($this->templates[$defaultTemplateId], 'template');
     // parse the form
     $this->frm->parse($this->tpl);
     // parse the tree
     $this->tpl->assign('tree', BackendPagesModel::getTreeHTML());
 }
 /**
  * Parse the page
  */
 protected function parse()
 {
     parent::parse();
     $this->tpl->assign('meta', $this->selectedMeta !== false);
     if ($this->frm->isSubmitted() && $this->frm->getField('search')->isChecked()) {
         $this->tpl->assign('search', true);
     } else {
         $this->tpl->assign('search', $this->selectedSearch !== false);
     }
 }