*/ class Configuration extends BaseAdminController { public function saveAction() { $response = $this->checkAuth([AdminResources::MODULE], ['backofficepath'], AccessManager::UPDATE); if ($response !== null) { return $response; } $form = new \BackOfficePath\Form\Configuration($this->getRequest()); $message = ''; try { $vform = $this->validateForm($form); $data = $vform->getData(); ConfigQuery::write('back_office_path', $data['back_office_path'], false, true); ConfigQuery::write( 'back_office_path_default_enabled', $data['back_office_path_default_enabled'] ? '1' : '0', false, true ); } catch (\Exception $e) { $message = $e->getMessage(); } if ($message) { $form->setErrorMessage($message); $this->getParserContext()->addForm($form); $this->getParserContext()->setGeneralError($message); return $this->render( 'module-configure', array( 'module_code' => BackOfficePath::getModuleCode(), ) ); } return RedirectResponse::create( URL::getInstance()->absoluteUrl( '/admin/module/' . BackOfficePath::getModuleCode() ) ); } }