public function storeOperation() { $this->autoRender = false; if ($this->request->is('post')) { History::storeOperation($this->Session, $this->request->data); } }
public function unmarkPostposition($documentId, $documentOffset, $sentenceId, $position, $preventHistory = 0) { $this->autoRender = false; $currentWord = $this->Word->find('first', array('conditions' => array('sentence_id' => $sentenceId, 'position' => $position))); if ($currentWord['Word']['is_postposition']) { $postposition = $currentWord; $baseWord = $this->Word->find('first', array('conditions' => array('sentence_id' => $sentenceId, 'position' => $position - 1))); } else { $baseWord = $currentWord; $postposition = $this->Word->find('first', array('conditions' => array('sentence_id' => $sentenceId, 'position' => $position + 1))); } $baseWord['Word']['postposition_id'] = null; $postposition['Word']['is_postposition'] = 0; $this->Word->save($baseWord); $this->Word->save($postposition); if ($preventHistory == 0) { History::storeOperation($this->Session, array("type" => "unmarkPostposition", "documentId" => $documentId, "documentOffset" => $documentOffset, "sentenceId" => $sentenceId, "position" => $baseWord['Word']['position'])); } return $this->redirect(array('controller' => 'dashboard', 'action' => 'index', $documentId, $documentOffset, $position)); }