コード例 #1
0
 public function insertkey()
 {
     $lang_module = Get::req('lang_module', DOTY_MIXED, '');
     $lang_key = Get::req('lang_key', DOTY_MIXED, '');
     $model = new LangAdm();
     $id_text = $model->insertKey($lang_key, $lang_module, '');
     if (!$id_text) {
         $re = false;
     } else {
         $re = true;
         foreach ($_POST['translation'] as $lang_code => $translation) {
             if ($translation != '') {
                 $re &= $model->insertTranslation($id_text, $lang_code, $translation);
             }
         }
     }
     $output = array('success' => $re ? true : false, 'message' => $re ? Lang::t('_OPERATION_SUCCESSFUL', 'admin_lang') : Lang::t('_OPERATION_FAILURE', 'admin_lang'));
     echo $this->json->encode($output);
 }