public function editAction() { $id = $this->_request->get("id"); $job = new Wpjb_Model_Job($id); if ($job->employer_id != Wpjb_Model_Employer::current()->getId()) { $this->_addError(__("You do not have access to this page.", WPJB_DOMAIN)); $this->view->revoke_access = true; return; } if (!Wpjb_Project::getInstance()->conf("front_allow_edition")) { $this->_addError(__("Administrator does not allow job postings edition.", WPJB_DOMAIN)); $this->view->revoke_access = true; return; } if ($this->_request->post("remove_image") == 1) { $job->deleteImage(); $job->save(); $form = new Wpjb_Form_Admin_AddJob($id); $this->view->form = $form; } else { parent::editAction(); } }
public function editAction() { if ($this->_request->post("remove_image") == 1) { $id = $this->_request->post("id"); $job = new Wpjb_Model_Job($id); $job->deleteImage(); $job->save(); Wpjb_Form_Admin_AddJob::$isAdmin = true; $form = new Wpjb_Form_Admin_AddJob($id); $form->init(); $this->view->form = $form; Wpjb_Form_Admin_AddJob::$isAdmin = false; } else { Wpjb_Form_Admin_AddJob::$isAdmin = true; parent::editAction(); Wpjb_Form_Admin_AddJob::$isAdmin = false; } }