'system/phrase:rw', 'Phrases' => 'system/phrase:r')); $this->load->library('PhrasesLib'); } /** * */ public function getPhrase() { $phrase_id = $this->get('phrase_id'); if (isset($phrase_id)) { $result = $this->phraseslib->getPhrase($phrase_id); $this->response($result, REST_Controller::HTTP_OK); } else { $this->response(); } } /** * */ public function getPhrases() { $app = $this->get('app'); $sprache = $this->get('sprache'); $phrase = $this->get('phrase'); $orgeinheit_kurzbz = $this->get('orgeinheit_kurzbz'); $orgform_kurzbz = $this->get('orgform_kurzbz'); $blockTags = $this->get('blockTags'); if (isset($app) && isset($sprache)) { $result = $this->phraseslib->getPhrases($app, $sprache, $phrase, $orgeinheit_kurzbz, $orgform_kurzbz, $blockTags); $this->response($result, REST_Controller::HTTP_OK); } else { $this->response(); } } /** * */ public function postPhrase() { if ($this->_validate($this->post())) { if (isset($this->post()['phrase_id'])) { $result = $this->PhraseModel->update($this->post()['phrase_id'], $this->post()); } else { $result = $this->PhraseModel->insert($this->post()); } $this->response($result, REST_Controller::HTTP_OK); } else { $this->response(); } } /** * */ private function _validate($phrase = null) { return false; } }