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('settings.css', 'memb_levels.css'), 'js_name' => array('memb_levels.js'), 'header' => _t('_adm_page_cpt_memb_levels')); $_page_cont[$iNameIndex] = array('page_code_main' => PageCodeMain($aResults, $iLevelId), '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) : ""); // add necessary js and css files bx_import('BxTemplFormView'); $oForm = new BxTemplFormView(array()); $oForm->addCssJs(true, true); PageCodeAdmin(); function PageCodeMain($aResults, $iLevelId) { $sTab = bx_get('tab') !== false ? process_db_input(bx_get('tab')) : 'levels'; $bEdit = bx_get('action') !== false && bx_get('action') == 'edit'; if ($bEdit) { $sTab = 'levels_add'; } $aTopItems = array('adm-mlevels-btn-levels' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:onChangeType(this)', 'title' => _t('_adm_txt_mlevels_levels'), 'active' => $sTab == 'levels' ? 1 : 0), 'adm-mlevels-btn-levels-add' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:onChangeType(this)', 'title' => _t('_adm_txt_mlevels_levels_add'), 'active' => $sTab == 'levels_add' ? 1 : 0), 'adm-mlevels-btn-settings' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:onChangeType(this)', 'title' => _t('_adm_txt_mlevels_settings'), 'active' => $sTab == 'settings' ? 1 : 0)); $sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('mlevels.html', array('content_levels' => _getLevelsList(isset($aResults['levels']) ? $aResults['levels'] : true, $sTab == 'levels'), 'content_create' => _getLevelsCreateForm($bEdit ? $iLevelId : 0, $sTab == 'levels_add'), 'content_settings' => _getLevelsSettingsForm(isset($aResults['settings']) ? $aResults['settings'] : true, $sTab == 'settings'))); return DesignBoxAdmin(_t('_adm_box_cpt_mlevel_memberships'), $sResult, $aTopItems);
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;