$smarty->assign("configuration_saved", 1); } if (isset($_GET["delete"])) { if (CONF_BACKEND_SAFEMODE) { Redirect(ADMIN_FILE . "?dpt=conf&sub=shipping&safemode=yes"); } shDeleteShippingMethod($_GET["delete"]); Redirect(ADMIN_FILE . "?dpt=conf&sub=shipping"); } if (isset($_POST["save_shipping"])) { if (CONF_BACKEND_SAFEMODE) { Redirect(ADMIN_FILE . "?dpt=conf&sub=shipping&safemode=yes"); } $values = ScanPostVariableWithId(array("Enabled", "name", "description", "email_comments_text", "module", "sort_order")); foreach ($values as $key => $value) { shUpdateShippingMethod($key, $value["name"], $value["description"], isset($value["Enabled"]) ? 1 : 0, (int) $value["sort_order"], $value["module"], $value["email_comments_text"]); } if (trim($_POST["new_name"]) != "") { shAddShippingMethod($_POST["new_name"], $_POST["new_description"], isset($_POST["new_Enabled"]) ? 1 : 0, (int) $_POST["new_sort_order"], $_POST["new_module"], $_POST["new_email_comments_text"]); } Redirect(ADMIN_FILE . "?dpt=conf&sub=shipping&save_successful=yes"); } /** * get all installed module objects */ $smarty->assign("shipping_types", shGetAllShippingMethods()); $smarty->assign("shipping_modules", modGetAllInstalledModuleObjs(SHIPPING_RATE_MODULE)); //set sub-department template $smarty->assign("admin_sub_dpt", "conf_shipping.tpl"); } }
if (isset($_POST["save_payment"])) { if (CONF_BACKEND_SAFEMODE) { Redirect(ADMIN_FILE . "?dpt=conf&sub=payment&safemode=yes"); } $values = ScanPostVariableWithId(array("Enabled", "name", "description", "email_comments_text", "module", "sort_order", "calculate_tax")); foreach ($values as $PID => $value) { payUpdatePaymentMethod($PID, $value["name"], $value["description"], isset($value["Enabled"]) ? 1 : 0, (int) $value["sort_order"], $value["module"], $value["email_comments_text"], isset($value["calculate_tax"]) ? 1 : 0); payResetPaymentShippingMethods($PID); foreach ($shipping_methods as $shipping_method) { if (isset($_POST["ShippingMethodsToAllow_" . $PID . "_" . $shipping_method["SID"]])) { paySetPaymentShippingMethod($PID, $shipping_method["SID"]); } } } if (trim($_POST["new_name"]) != "") { $PID = payAddPaymentMethod($_POST["new_name"], $_POST["new_description"], isset($_POST["new_Enabled"]) ? 1 : 0, (int) $_POST["new_sort_order"], $_POST["new_email_comments_text"], $_POST["new_module"], isset($_POST["new_calculate_tax"]) ? 1 : 0); foreach ($shipping_methods as $shipping_method) { if (isset($_POST["new_ShippingMethodsToAllow_" . $shipping_method["SID"]])) { paySetPaymentShippingMethod($PID, $shipping_method["SID"]); } } } Redirect(ADMIN_FILE . "?dpt=conf&sub=payment&save_successful=yes"); } $smarty->assign("payment_types", payGetAllPaymentMethods()); $smarty->assign("payment_modules", modGetAllInstalledModuleObjs(PAYMENT_MODULE)); $smarty->assign("shipping_methods", $shipping_methods); //set sub-department template $smarty->assign("admin_sub_dpt", "conf_payment.tpl"); } }
$constants = $shipping_module->settings_list(); $settings = array(); $controls = array(); foreach ($constants as $constant) { $settings[] = settingGetSetting($constant); $controls[] = settingCallHtmlFunction($constant); } if (isset($_POST['save'])) { Redirect(set_query('Pustishka=')); } $smarty->assign("settings", $settings); $smarty->assign("controls", $controls); $smarty->assign("shipping_module", $shipping_module); $smarty->assign("constant_managment", 1); } else { $shipping_configs = modGetAllInstalledModuleObjs(SHIPPING_RATE_MODULE); foreach ($shipping_configs as $_Ind => $_Conf) { $shipping_configs[$_Ind] = array('ConfigID' => $_Conf->get_id(), 'ConfigName' => $_Conf->title, 'ConfigClassName' => get_class($_Conf)); } $shipping_modules = array(); $shipping_methods_by_modules = array(); foreach ($moduleFiles as $fileName) { $className = GetClassName($fileName); if (!$className) { continue; } eval("\$shippingModule = new " . $className . "();"); $shipping_modules[] = $shippingModule; $shipping_methods_by_modules[] = shGetShippingMethodsByModule($shippingModule); } function cmpShObjs($a, $b)
} $constants = $payment_module->settings_list(); $settings = array(); $controls = array(); foreach ($constants as $constant) { $settings[] = settingGetSetting($constant); $controls[] = settingCallHtmlFunction($constant); $smarty->assign("settings", $settings); $smarty->assign("controls", $controls); } $smarty->assign("payment_module", $payment_module); $smarty->assign("constant_managment", 1); } else { $payment_modules = array(); $payment_methods_by_modules = array(); $payment_configs = modGetAllInstalledModuleObjs(PAYMENT_MODULE); foreach ($payment_configs as $_Ind => $_Conf) { $payment_configs[$_Ind] = array('ConfigID' => $_Conf->get_id(), 'ConfigName' => $_Conf->title, 'ConfigClassName' => get_class($_Conf)); } foreach ($moduleFiles as $fileName) { $className = GetClassName($fileName); if (!$className) { continue; } eval('$paymentModule = new ' . $className . '();'); $payment_modules[] = $paymentModule; $payment_methods_by_modules[] = payGetPaymentMethodsByModule($paymentModule); } function cmpPObjs($a, $b) { return strcmp($a->title, $b->title);