header("Content-Disposition: attachment; filename=" . $sName); echo $sContent; exit; } else { if (isset($_POST['action']) && $_POST['action'] == 'get_edit_form_language') { echo json_encode(array('code' => PopupBox('adm-langs-wnd-edit', _t('_adm_box_cpt_lang_edit_language'), _getLanguageCreateForm(true)))); exit; } } } } } } //--- Create/Delete/Edit Language Key ---// if (isset($_POST['action']) && $_POST['action'] == 'get_edit_form_key') { echo json_encode(array('code' => PageCodeKeyEdit((int) $_POST['id']))); exit; } if (isset($_POST['create_key'])) { $sName = process_db_input($_POST['name']); $iCategoryId = (int) $_POST['category']; $mixedResult = $GLOBALS['MySQL']->query("INSERT INTO `sys_localization_keys`(`IDCategory`, `Key`) VALUES('" . $iCategoryId . "', '" . $sName . "')", false); if ($mixedResult !== false) { $bCompiled = true; $iKeyId = (int) $GLOBALS['MySQL']->lastId(); $aLanguages = $GLOBALS['MySQL']->getAll("SELECT `ID` AS `id`, `Title` AS `title` FROM `sys_localization_languages`"); foreach ($aLanguages as $aLanguage) { if (isset($_POST['string_for_' . $aLanguage['id']])) { $GLOBALS['MySQL']->query("INSERT INTO `sys_localization_strings`(`IDKey`, `IDLanguage`, `String`) VALUES('" . $iKeyId . "', '" . $aLanguage['id'] . "', '" . process_db_input($_POST['string_for_' . $aLanguage['id']]) . "')"); $bCompiled = $bCompiled && compileLanguage((int) $aLanguage['id']); }
exit; } else { if (isset($_POST['action']) && $_POST['action'] == 'get_edit_form_language') { $oJson = new Services_JSON(); echo $oJson->encode(array('code' => PopupBox('adm-langs-wnd-edit', _t('_adm_box_cpt_lang_edit_language'), _getLanguageCreateForm(true)))); exit; } } } } } } //--- Create/Delete/Edit Language Key ---// if (isset($_POST['action']) && $_POST['action'] == 'get_edit_form_key') { $oJson = new Services_JSON(); echo $oJson->encode(array('code' => PageCodeKeyEdit((int) $_POST['id']))); exit; } if (isset($_POST['create_key'])) { $sName = process_db_input($_POST['name']); $iCategoryId = (int) $_POST['category']; $mixedResult = $GLOBALS['MySQL']->query("INSERT INTO `sys_localization_keys`(`IDCategory`, `Key`) VALUES('" . $iCategoryId . "', '" . $sName . "')", false); if ($mixedResult !== false) { $bCompiled = true; $iKeyId = (int) $GLOBALS['MySQL']->lastId(); $aLanguages = $GLOBALS['MySQL']->getAll("SELECT `ID` AS `id`, `Title` AS `title` FROM `sys_localization_languages`"); foreach ($aLanguages as $aLanguage) { if (isset($_POST['string_for_' . $aLanguage['id']])) { $GLOBALS['MySQL']->query("INSERT INTO `sys_localization_strings`(`IDKey`, `IDLanguage`, `String`) VALUES('" . $iKeyId . "', '" . $aLanguage['id'] . "', '" . process_db_input($_POST['string_for_' . $aLanguage['id']]) . "')"); $bCompiled = $bCompiled && compileLanguage((int) $aLanguage['id']); }