public function action_delete($id = null) { is_null($id) and Response::redirect('faculty'); if ($faculty = Model_Faculty::find($id)) { $faculty->delete(); Session::set_flash('success', 'Deleted faculty #' . $id); } else { Session::set_flash('error', 'Could not delete faculty #' . $id); } Response::redirect('faculty'); }
public function actionView() { $this->view->setData('title', 'View Paper'); $paperId = htmlspecialchars(isset($_GET['paperId']) ? $_GET['paperId'] : ''); $paper = $this->grabPaperData($paperId); if (!$paper) { return $this->redirectController('Controller_Error'); } $keywords = $this->getPaperModel()->getKeywords($paper); $facultyIds = $this->getPaperModel()->getFacultyIds($paper); $facultyModel = new Model_Faculty(); $emails = $facultyModel->getUsersByPaperId($paperId); $emails = $facultyModel->getEmails($emails); $dataModifier = new DataModifier_Paper(); $dataModifier->incrementPageView($paperId); $this->view->setData('paper', $paper[0]); $this->view->setData('keywords', $keywords); $this->view->setData('facultyIds', $facultyIds); $this->view->setData('emails', $emails); return $this->view->render('assets/view/papers/view.php'); }