public function saveAction() { $response = $this->controller->execute('save'); $id = $this->response->getVariable('savedRecordID'); $course_id = $this->request->getSessionData('course_id'); $reading_list = new ReadingList($this->request->requireSessionData('course_id', 'Session has expired')); $reading_list->assignRecords(array($id)); return $response; }
/** * User supplied data to edit the record */ public function editAction() { $reading_list = new ReadingList($this->request->requireSessionData('course_id', 'Session has expired')); // this is a reset if ($this->request->getParam('reset') != "") { $record_id = $this->request->getParam('record_id'); $reading_list->clearRecordData($record_id); } else { $result = new Result(); $result->record_id = $this->request->getParam('record_id'); $result->title = $this->request->getParam('title'); $result->author = $this->request->getParam('author'); $result->publication = $this->request->getParam('publication'); $result->description = $this->request->getParam('abstract'); $success = $reading_list->editRecord($result); } // return to reading list $params = array('controller' => $this->request->getParam('controller'), 'action' => 'results', 'course_id' => $this->getCourseID(), '#' => 'record-' . $this->request->getParam('record_id')); return $this->redirectTo($params); }