public function execute() { parent::execute(); try { $id = Uuid::fromString($this->getParameter('id', 'string')); $teamMember = $this->get('team_repository')->find($id); } catch (\Exception $e) { return $this->redirect(Model::createURLForAction('Index') . '&error=non-existing'); } $form = new TeamType('edit', $teamMember); if ($form->handle()) { $teamMember = $form->getData(); $this->get('team_repository')->save($teamMember); return $this->redirect(Model::createURLForAction('Index') . '&report=edited' . '&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->tpl->assign('teamMember', $teamMember->toArray()); $this->parse(); $this->display(); }
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); } }
/** * 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); } }
/** * 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); } }
/** * Parse the page */ protected function parse() { parent::parse(); $this->tpl->assign('item', $this->record); $this->tpl->assign('iframe', BackendModel::createURLForAction('preview') . "&id=" . $this->id); // get url $url = BackendModel::getURLForBlock($this->URL->getModule(), 'detail'); $url404 = BackendModel::getURL(404); if ($url404 != $url) { $this->tpl->assign('detailURL', SITE_URL . $url); } }
/** * Parse the form */ protected function parse() { parent::parse(); // assign the data $this->tpl->assign('item', $this->record); $this->tpl->assign('showFaqDeleteCategory', BackendFaqModel::deleteCategoryAllowed($this->id) && BackendAuthentication::isAllowedAction('DeleteCategory')); $url = BackendModel::getURLForBlock($this->URL->getModule(), 'Category'); $url404 = BackendModel::getURL(404); if ($url404 != $url) { $this->tpl->assign('detailURL', SITE_URL . $url); } }
/** * Parse the page */ protected function parse() { parent::parse(); // Get url $url = Model::getURLForBlock($this->URL->getModule(), 'Detail'); $url404 = Model::getURL(404); // Parse additional variables if ($url404 != $url) { $this->tpl->assign('detailURL', SITE_URL . $url); } $this->tpl->assign('item', $this->record); }
/** * Parse the form */ protected function parse() { parent::parse(); // get url $url = BackendModel::getURLForBlock($this->URL->getModule(), 'detail'); $url404 = BackendModel::getURL(404); if ($url404 != $url) { $this->tpl->assign('detailURL', SITE_URL . $url); } // assign the active record and additional variables $this->tpl->assign('item', $this->record); $this->tpl->assign('feedback', $this->feedback); }
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(); }
/** * Parse the form */ 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); } // fetch proper slug $this->record['url'] = $this->meta->getURL(); // assign the active record and additional variables $this->tpl->assign('item', $this->record); $this->tpl->assign('status', BL::lbl(\SpoonFilter::ucfirst($this->record['status']))); // assign revisions-datagrid $this->tpl->assign('revisions', $this->dgRevisions->getNumResults() != 0 ? $this->dgRevisions->getContent() : false); $this->tpl->assign('drafts', $this->dgDrafts->getNumResults() != 0 ? $this->dgDrafts->getContent() : false); $this->tpl->assign('imageIsAllowed', $this->imageIsAllowed); // assign category if ($this->categoryId !== null) { $this->tpl->assign('categoryId', $this->categoryId); } }
/** * Parse the form * * @return void */ protected function parse() { //--Add javascript file $this->header->addJS('Jquery.uploadify.min.js', null, false); $this->header->addJS('Edit.js', null, false); $this->header->addCSS('Uploadify.css'); // call parent parent::parse(); // assign the category $this->tpl->assign('album', $this->record); $this->tpl->assign('images', $this->images); if ($this->frmAddImage) { $this->frmAddImage->parse($this->tpl); } if ($this->frmDeleteImage) { $this->frmDeleteImage->parse($this->tpl); } //--Add data to Javascript $this->header->addJsData("Galleria", "id", $this->id); // can the category be deleted? if (BackendGalleriaModel::deleteAlbumAllowed($this->id)) { $this->tpl->assign('showDelete', true); } // get url $url = BackendModel::getURLForBlock($this->URL->getModule(), 'group'); $url404 = BackendModel::getURL(404); if ($url404 != $url) { $this->tpl->assign('detailURL', SITE_URL . $url); } }
/** * Parse the page */ protected function parse() { parent::parse(); $this->tpl->assign('item', $this->record); // get url $url = BackendModel::getURLForBlock($this->URL->getModule(), 'Detail'); $url404 = BackendModel::getURL(404); if ($url404 != $url) { $this->tpl->assign('detailURL', SITE_URL . $url); } $this->tpl->assign("fieldLanguages", $this->fieldLanguages); }
/** * Parse the page */ protected function parse() { parent::parse(); $this->header->addJS('edit.js'); $this->tpl->assign('item', $this->record); // get url $url = BackendModel::getURLForBlock($this->URL->getModule(), 'Group'); $url404 = BackendModel::getURL(404); if ($url404 != $url) { $this->tpl->assign('detailURL', SITE_URL . $url); } }
/** * 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 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 $this->tpl->assign('item', $this->record); $this->tpl->assign('dataGrid', $this->dataGrid->getNumResults() != 0 ? $this->dataGrid->getContent() : false); $this->tpl->assign('categories', $this->categories); $this->tpl->assign('imageCount', BackendSlideshowModel::getImagesByGallery($this->id)); // settings allowed? $this->tpl->assign('settingsPerSlideshow', $this->get('fork.settings')->get('Slideshow', 'settings_per_slide')); }
/** * 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(); $this->tpl->assign('item', $this->record); $this->tpl->assign('mediaItems', $this->media->getMediaItems()); }
/** * 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); } $this->tpl->assign('product', $this->record); $this->tpl->assign('fieldLanguages', $this->fieldLanguages); //--Add media $this->tpl->assign('mediaItems', $this->media->getMediaItems()); }
/** * Load the form for step 4 */ private function loadFormForStep4() { // check if we have to redirect back to step 3 (HTML content is not set) if (empty($this->record['content_html'])) { $this->redirect(BackendModel::createURLForAction('Edit') . '&id=' . $this->id . '&step=3&error=complete-step-3'); } // get preview URL $previewURL = BackendMailmotorModel::getMailingPreviewURL($this->record['id'], 'html', true); // check if the mailmotor is linked if (BackendModel::getURLForBlock($this->getModule(), 'detail') == BackendModel::getURL(404)) { $previewURL = false; } // parse the preview URL $this->tpl->assign('previewURL', $previewURL); // create form $this->frm = new BackendForm('step4'); // subject $this->frm->addText('email'); $this->frm->addDate('send_on_date', $this->record['send_on']); $this->frm->addTime('send_on_time', \SpoonDate::getDate('H:i', $this->record['send_on'])); // show the form $this->tpl->assign('step4', true); }