Exemplo n.º 1
0
 public function addrecordAction()
 {
     $this->_checkCanEdit();
     $dictionary = Request::post('dictionary', Filter::FILTER_CLEANED_STR, false);
     $key = Request::post('key', Filter::FILTER_CLEANED_STR, false);
     $lang = Request::post('lang', Filter::FILTER_ARRAY, false);
     if ($dictionary === false || empty($dictionary) || $key === false || $lang === false) {
         Response::jsonError($this->_lang->get('WRONG_REQUEST'));
     }
     try {
         $this->_manager->addRecord($dictionary, $key, $lang);
         $this->_router->runController('Backend_Compiler_Controller', 'lang');
         // Response::jsonSuccess();
     } catch (Exception $e) {
         Response::jsonError($e->getMessage());
     }
 }