view->tabs = $this->Module()->getConfigTabs()->activate('jobs'); $repo = new JobsIniRepository(); $this->view->jobs = $repo->select(array('name')); } /** * Create a job */ public function newAction() { $form = $this->prepareForm()->add(); $form->handleRequest(); $this->renderForm($form, $this->translate('New Job')); } /** * Update a job */ public function updateAction() { $form = $this->prepareForm()->edit($this->params->getRequired('name')); try { $form->handleRequest(); } catch (NotFoundError $_) { $this->httpNotFound($this->translate('Job not found')); } $this->renderForm($form, $this->translate('Update Job')); } /** * Remove a job */ public function removeAction() { $form = $this->prepareForm()->remove($this->params->getRequired('name')); try { $form->handleRequest(); } catch (NotFoundError $_) { $this->httpNotFound($this->translate('Job not found')); } $this->renderForm($form, $this->translate('Remove Job')); } /** * Assert config permission and return a prepared RepositoryForm * * @return JobConfigForm */ protected function prepareForm() { $this->assertPermission('config/x509'); return (new JobConfigForm()) ->setRepository(new JobsIniRepository()) ->setRedirectUrl(Url::fromPath('x509/jobs')); } }