function save_switch_xml() { if (is_readable($_SESSION['switch']['dialplan']['dir'])) { save_dialplan_xml(); } if (is_readable($_SESSION['switch']['extensions']['dir'])) { if (file_exists($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/app/extensions/resources/classes/extension.php")) { require_once $_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "app/extensions/resources/classes/extension.php"; $extension = new extension(); $extension->xml(); } } if (is_readable($_SESSION['switch']['conf']['dir'])) { if (file_exists($_SERVER['DOCUMENT_ROOT'] . PROJECT_PATH . "/app/settings/app_config.php")) { save_setting_xml(); } if (file_exists($_SERVER['DOCUMENT_ROOT'] . PROJECT_PATH . "/app/modules/app_config.php")) { save_module_xml(); } if (file_exists($_SERVER['DOCUMENT_ROOT'] . PROJECT_PATH . "/app/vars/app_config.php")) { save_var_xml(); } if (file_exists($_SERVER['DOCUMENT_ROOT'] . PROJECT_PATH . "/app/call_center/app_config.php")) { save_call_center_xml(); } if (file_exists($_SERVER['DOCUMENT_ROOT'] . PROJECT_PATH . "/app/gateways/app_config.php")) { save_gateway_xml(); } //if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/ivr_menu/app_config.php")) { // save_ivr_menu_xml(); //} if (file_exists($_SERVER['DOCUMENT_ROOT'] . PROJECT_PATH . "/app/sip_profiles/app_config.php")) { save_sip_profile_xml(); } } }
header("Location: modules.php"); return; } //if ($action == "add") if ($action == "update" && permission_exists('module_edit')) { $sql = "update v_modules set "; $sql .= "module_label = '{$module_label}', "; $sql .= "module_name = '{$module_name}', "; $sql .= "module_description = '{$module_description}', "; $sql .= "module_category = '{$module_category}', "; $sql .= "module_enabled = '{$module_enabled}', "; $sql .= "module_default_enabled = '{$module_default_enabled}' "; $sql .= "where module_uuid = '{$module_uuid}' "; $db->exec(check_sql($sql)); unset($sql); save_module_xml(); $_SESSION["message"] = $text['message-update']; header("Location: modules.php"); return; } //if ($action == "update") } //if ($_POST["persistformvar"] != "true") } //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) //pre-populate the form if (count($_GET) > 0 && $_POST["persistformvar"] != "true") { $module_uuid = $_GET["id"]; $sql = "select * from v_modules "; $sql .= "where module_uuid = '{$module_uuid}' "; $prep_statement = $db->prepare(check_sql($sql));