public function lang() { require_once _base_ . '/lib/lib.preference.php'; $preference = new AdminPreference(); $idst = Get::req('idst', DOTY_INT, 0); $output = array(); if (Get::req('confirm', DOTY_INT, 0) == 1) { $new_lang = array(); if (isset($_POST['admin_lang'])) { $new_lang = array_keys($_POST['admin_lang']); } $new_lang = $this->json->encode($new_lang); $output['success'] = $preference->saveLangAdminRules($idst, $new_lang); echo $this->json->encode($output); } else { $body = Form::openForm('add_rules_form', 'ajax.adm_server.php?r=adm/adminrules/lang&confirm=1') . Form::openElementSpace() . Form::getHidden('idst', 'idst', $idst) . $preference->getLangModifyMask($idst) . Form::closeElementSpace() . Form::closeForm(); $output['success'] = true; $output['header'] = Lang::t('_MOD', 'adminrules') . ' '; $output['body'] = $body; echo $this->json->encode($output); } }