} } if (isset($_POST['adm-lang-key-delete']) && is_array($_POST['keys'])) { foreach ($_POST['keys'] as $iKeyId) { $GLOBALS['MySQL']->query("DELETE FROM `sys_localization_keys`, `sys_localization_strings` USING `sys_localization_keys`, `sys_localization_strings` WHERE `sys_localization_keys`.`ID`=`sys_localization_strings`.`IDKey` AND `sys_localization_keys`.`ID`='" . $iKeyId . "'"); } } $iNameIndex = 5; $_page = array('name_index' => $iNameIndex, 'css_name' => array('forms_adv.css', 'lang_file.css'), 'js_name' => array('lang_file.js'), 'header' => _t('_adm_page_cpt_lang_file')); $sLangRssFeed = 'on' == getParam('feeds_enable') ? DesignBoxAdmin(_t('_adm_box_cpt_lang_files'), ' <div class="RSSAggrCont" rssid="boonex_unity_lang_files" rssnum="5" member="0"> <div class="loading_rss"> <img src="' . getTemplateImage('loading.gif') . '" alt="' . _t('_loading ...') . '" /> </div> </div>') : ''; $_page_cont[$iNameIndex] = array('page_result_code' => $sResult, 'page_code_settings' => PageCodeSettings($mixedResultSettings), 'page_code_create' => PageCodeCreate($mixedResultCreate), 'page_code_keys' => PageCodeKeys($mixedResultKeys), 'page_code_key' => PageCodeKeyCreate() . $sLangRssFeed); PageCodeAdmin(); function PageCodeSettings($mixedResult) { $aForm = array('form_attrs' => array('id' => 'adm-settings-form-settings', 'name' => 'adm-settings-form-settings', 'action' => $GLOBALS['site']['url_admin'] . 'lang_file.php', 'method' => 'post', 'enctype' => 'multipart/form-data'), 'params' => array(), 'inputs' => array('lang_default' => array('type' => 'select', 'name' => 'lang_default', 'caption' => _t('_adm_txt_langs_def_lang'), 'values' => array(), 'value' => getParam('lang_default')), 'save_settings' => array('type' => 'submit', 'name' => 'save_settings', 'value' => _t("_adm_btn_settings_save")))); $aLangs = getLangsArr(); foreach ($aLangs as $sName => $sTitle) { $aForm['inputs']['lang_default']['values'][] = array('key' => $sName, 'value' => htmlspecialchars_adv($sTitle)); } $oForm = new BxTemplFormView($aForm); $sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $oForm->getCode())); if ($mixedResult !== true && !empty($mixedResult)) { $sResult = MsgBox(_t($mixedResult), 3) . $sResult; } return DesignBoxAdmin(_t('_adm_box_cpt_lang_settings'), $sResult); }
if (isset($_POST['action']) && $_POST['action'] == 'get_edit_form_action') { $oJson = new Services_JSON(); echo $oJson->encode(array('code' => PageCodeAction((int) $_POST['level_id'], (int) $_POST['action_id'], $mixedResultAction))); exit; } } } } } } } } $iLevelId = bx_get('level') !== false ? (int) bx_get('level') : 0; $iNameIndex = 6; $_page = array('name_index' => $iNameIndex, 'css_name' => array('forms_adv.css', 'settings.css', 'memb_levels.css', 'plugins/jquery/themes/|ui.datepicker.css'), 'js_name' => array('ui.datepicker.js', 'memb_levels.js'), 'header' => _t('_adm_page_cpt_memb_levels')); $_page_cont[$iNameIndex] = array('page_code_settings' => PageCodeSettings($mixedResultSettings), 'page_code_create' => PageCodeCreate(), 'page_code_available' => PageCodeAvailable($mixedResultAvailable), 'page_code_actions' => bx_get('action') !== false && bx_get('action') == 'actions' && $iLevelId > 0 ? PageCodeActions($iLevelId, $mixedResultActions) : "", 'page_code_prices' => bx_get('action') !== false && bx_get('action') == 'prices' && $iLevelId > 0 ? PageCodePrices($iLevelId, $mixedResultPrices) : ""); PageCodeAdmin(); function PageCodeSettings($mixedResult) { $sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $GLOBALS['oSettings']->getForm())); if ($mixedResult !== true && !empty($mixedResult)) { $sResult = $mixedResult . $sResult; } return DesignBoxAdmin(_t('_adm_box_cpt_mlevel_settings'), $sResult); } function PageCodeCreate() { $aForm = array('form_attrs' => array('id' => 'adm-mlevels-create', 'action' => $GLOBALS['site']['url_admin'] . 'memb_levels.php', 'method' => 'post', 'enctype' => 'multipart/form-data'), 'params' => array('db' => array('table' => 'sys_acl_levels', 'key' => 'ID', 'uri' => '', 'uri_title' => '', 'submit_name' => 'submit')), 'inputs' => array('Active' => array('type' => 'hidden', 'name' => 'Active', 'value' => 'no', 'db' => array('pass' => 'Xss')), 'Purchasable' => array('type' => 'hidden', 'name' => 'Purchasable', 'value' => 'yes', 'db' => array('pass' => 'Xss')), 'Removable' => array('type' => 'hidden', 'name' => 'Removable', 'value' => 'yes', 'db' => array('pass' => 'Xss')), 'Name' => array('type' => 'text', 'name' => 'name', 'caption' => _t('_adm_txt_mlevels_name'), 'value' => '', 'db' => array('pass' => 'Xss'), 'checker' => array('func' => 'length', 'params' => array(3, 100), 'error' => _t('_adm_txt_mlevels_name_err'))), 'Icon' => array('type' => 'file', 'name' => 'Icon', 'caption' => _t('_adm_txt_mlevels_icon'), 'value' => '', 'checker' => array('func' => '', 'params' => '', 'error' => _t('_adm_txt_mlevels_icon_err'))), 'Description' => array('type' => 'textarea', 'name' => 'description', 'caption' => _t('_adm_txt_mlevels_description'), 'value' => '', 'db' => array('pass' => 'XssHtml')), 'submit' => array('type' => 'submit', 'name' => 'submit', 'value' => _t('_adm_btn_mlevels_add')))); $oForm = new BxTemplFormView($aForm); $oForm->initChecker(); $bFile = true;
$mixedResultSettings = ''; $mixedResultTemplates = ''; if (isset($_POST['save']) && isset($_POST['cat'])) { $mixedResultSettings = $oSettings->saveChanges($_POST); } elseif (isset($_POST['action']) && $_POST['action'] == 'get_translations') { $aTranslation = $GLOBALS['MySQL']->getRow("SELECT `Subject` AS `subject`, `Body` AS `body` FROM `sys_email_templates` WHERE `Name`='" . process_db_input($_POST['templ_name']) . "' AND `LangID`='" . (int) $_POST['lang_id'] . "' LIMIT 1"); if (empty($aTranslation)) { $aTranslation = $GLOBALS['MySQL']->getRow("SELECT `Subject` AS `subject`, `Body` AS `body` FROM `sys_email_templates` WHERE `Name`='" . process_db_input($_POST['templ_name']) . "' AND `LangID`='0' LIMIT 1"); } $oJson = new Services_JSON(); echo $oJson->encode(array('subject' => $aTranslation['subject'], 'body' => $aTranslation['body'])); exit; } $iNameIndex = 8; $_page = array('name_index' => $iNameIndex, 'css_name' => array('forms_adv.css', 'settings.css'), 'js_name' => array('email_templates.js'), 'header' => _t('_adm_page_cpt_email_templates')); $_page_cont[$iNameIndex] = array('page_code_settings' => PageCodeSettings($mixedResultSettings), 'page_code_templates' => PageCodeTemplates($mixedResultTemplates)); PageCodeAdmin(); function PageCodeSettings($mixedResult) { $sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $GLOBALS['oSettings']->getForm())); if ($mixedResult !== true && !empty($mixedResult)) { $sResult = $mixedResult . $sResult; } return DesignBoxAdmin(_t('_adm_box_cpt_email_settings'), $sResult); } function PageCodeTemplates($mixedResult) { $aForm = array('form_attrs' => array('id' => 'adm-email-templates', 'action' => $GLOBALS['site']['url_admin'] . 'email_templates.php', 'method' => 'post', 'enctype' => 'multipart/form-data'), 'params' => array('db' => array('table' => 'sys_email_templates', 'key' => 'ID', 'uri' => '', 'uri_title' => '', 'submit_name' => 'adm-emial-templates-save')), 'inputs' => array()); $aLanguages = $GLOBALS['MySQL']->getAll("SELECT `ID` AS `id`, `Title` AS `title` FROM `sys_localization_languages`"); $aLanguageChooser = array(array('key' => 0, 'value' => 'default')); foreach ($aLanguages as $aLanguage) {