Exemplo n.º 1
0
 /**
  * Create sub dictionary
  */
 public function createsubAction()
 {
     $name = Request::post('name', Filter::FILTER_ALPHANUM, false);
     if (empty($name)) {
         Response::jsonError($this->_lang->get('INVALID_VALUE_FOR_FIELD') . ' ' . $this->_lang->get('DICTIONARY_NAME'));
     }
     if ($this->_manager->dictionaryExists($name)) {
         Response::jsonError($this->_lang->get('DICTIONARY_EXISTS'));
     }
     try {
         $this->_manager->createDictionary($name);
     } catch (Exception $e) {
         Response::jsonError($e->getMessage());
     }
     Response::jsonSuccess();
 }