$step()) { $copyError = $LanguageFunctions->errorMessages; break; } $nextStep = $LanguageFunctions->nextStep; if($nextStep == "") { break; // switch abbrechen und damit kopiervorgang beenden. } echo json_encode(array("next_step" => $nextStep, "message" => $LanguageFunctions->message)); return; default: break; } if(count($copyError)) { $errorDivs = array(); foreach($copyError as $error) { $errorDivs[] = "
" . $error . "
\n"; } echo json_encode(array("next_step" => "", "message" => $errorDivs, "error" => 1)); } else { echo json_encode(array("next_step" => "", "message" => array('
' . $translation->get("copy_language_success") . '
'), "error" => 0)); } } function edit_language( $_id = "", $messages = array() ) { if ((int)$_id > 0) { $input_id = $_id; } else { $input_id = $_REQUEST["input_id"]; } if ($input_id <> '') { $pdoHost = getenv('MAIN_MYSQL_DB_HOST'); $pdoPort = getenv('MAIN_MYSQL_DB_PORT'); $pdoUser = getenv('MAIN_MYSQL_DB_USER'); $pdoPass = getenv('MAIN_MYSQL_DB_PASS'); $pdoSchema = getenv('MAIN_MYSQL_DB_SCHEMA'); $pdo = new \DynCom\mysyde\common\classes\PDOQueryWrapper($pdoHost, $pdoPort, $pdoSchema, $pdoUser, $pdoPass); $prepStatement = " SELECT *, (SELECT COUNT(id) FROM main_navigation WHERE main_language_id = main_language.id) AS 'no_of_navigation' FROM main_language WHERE id = :id LIMIT 1 "; $params = [ [':id',$input_id, PDO::PARAM_STR], ]; $pdo->setQuery($prepStatement); $pdo->prepareQuery(); $pdo->bindParameters($params); $pdo->executePreparedStatement(); $result = $pdo->getResultArray(); if (count($result) == 1) { $input_language = $result[0]; require_once("edit_language_cardform.inc.php"); } } else { $input_language = array(); require_once("edit_language_cardform.inc.php"); } } function delete_language() { $translation = \DynCom\mysyde\common\classes\Registry::get("translation"); $messages = array(); if ($_REQUEST["input_id"] <> '') { $query = "DELETE FROM main_language WHERE id = '" . $_REQUEST["input_id"] . "' LIMIT 1"; @mysqli_query($GLOBALS['mysql_con'], $query); if($GLOBALS["language"]['id'] == $_REQUEST["input_id"]) { $messages[] = '
' . $translation->get("language_msg_info1") . '
' . $translation->get("website_msg_tologin") . '
'; if(IS_AJAX) { header('EDIT_ERROR: 1'); $input_language = array(); require_once("edit_language_cardform.inc.php"); return; } } } require_once("edit_language_listform.inc.php"); } function save_language() { $translation = \DynCom\mysyde\common\classes\Registry::get("translation"); $input_id = ""; $active = 0; if($_REQUEST["input_active"] == "on") { $active = 1; } $catalogLogin = 0; if($_REQUEST["input_catalog_login"] == "on") { $catalogLogin = 1; } if ($_REQUEST["input_id"] <> '') { $query = "UPDATE main_language SET company = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_company"]) . "', shop_code = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_shopcode"]) . "', shop_language_code = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_language_code"]) . "', code = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_code"]) . "', locale_code = '" . mysqli_real_escape_string($GLOBALS['mysql_con'],$_REQUEST['input_locale_code']) . "', name = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_name"]) . "', site_name = '', std_main_navigation_id = '" . $_REQUEST["input_std_main_navigation_id"] . "', site_title_name = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_site_title_name"]) . "', meta_description = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_meta_description"]) . "', meta_keywords = '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_meta_keywords"]) . "', main_layout_id = '" . $_REQUEST["input_main_layout_id"] . "', logout_site_id = '" . $_REQUEST["input_login_site"] . "', logout_language_id = '" . $_REQUEST["input_login_language"] . "', logout_navigation_id = '" . $_REQUEST["input_login_navigation"] . "', related_language_codes = '" . $_REQUEST["input_related_language_codes"] . "', active = " . $active . " WHERE id = '" . $_REQUEST["input_id"] . "' LIMIT 1"; $inserted = FALSE; $input_id = $_REQUEST["input_id"]; } else { $query = "INSERT INTO main_language (id, main_site_id, code,locale_code,name,site_name,std_main_navigation_id,site_title_name,meta_description,meta_keywords,main_layout_id,company,shop_code,shop_language_code,logout_site_id,logout_language_id,logout_navigation_id,related_language_codes, active) VALUES ( NULL, '" . $GLOBALS["site"]["id"] . "', '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_code"]) . "', '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_locale_code"]) . "', '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_name"]) . "', '', '" . $_REQUEST["input_std_main_navigation_id"] . "', '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_site_title_name"]) . "', '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_meta_description"]) . "', '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_meta_keywords"]) . "', '" . $_REQUEST["input_main_layout_id"] . "', '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_company"]) . "', '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_shopcode"]) . "', '" . mysqli_real_escape_string($GLOBALS['mysql_con'], $_REQUEST["input_language_code"]) . "', '" . $_REQUEST["input_login_site"] . "', '" . $_REQUEST["input_login_language"] . "', '" . $_REQUEST["input_login_navigation"] . "', '" . $_REQUEST["input_related_language_codes"] . "', " . $active . " )"; $inserted = TRUE; } if (($_REQUEST["input_code"] == '') | ($_REQUEST["input_name"] == '')) { $messages[] = "
" . $translation->get("error_textkey_description") . "
\n"; $error = TRUE; } if ($_REQUEST["input_code"] <> urlencode($_REQUEST["input_code"])) { $messages[] = "
" . $translation->get("error_textkey_encoding") . "
\n"; $error = TRUE; } $result = @mysqli_query($GLOBALS['mysql_con'], "SELECT * FROM main_language WHERE code = '" . $_REQUEST["input_code"] . "' AND main_site_id = '" . $GLOBALS["site"]["id"] . "'"); if ((@mysqli_num_rows($result) <> 0) && ($_REQUEST["input_id"] == '')) { $messages[] = "
" . $translation->get("error_textkey_exists") . "
\n"; $error = TRUE; } if (!$error) { @mysqli_query($GLOBALS['mysql_con'], $query); if ($inserted == TRUE) { $input_id = mysqli_insert_id($GLOBALS['mysql_con']); $messages[] = '
' . $translation->get("language_msg_success1") . '
'; } else { $messages[] = '
' . $translation->get("language_msg_success2") . '
'; if($GLOBALS["language"]["code"] == $_REQUEST["input_code"]) { header('EDIT_ERROR: 1'); // schliessen des overlays verhindern $messages[] = '
' . $translation->get("language_msg_info1") . '
' . $translation->get("website_msg_tologin") . '
'; } } edit_language($input_id, $messages); } else { header('EDIT_ERROR: 1'); $input_language["logout_site"] = $_REQUEST["input_login_site"]; $input_language["logout_language"] = $_REQUEST["input_login_language"]; $input_language["logout_navigation"] = $_REQUEST["input_login_navigation"]; $input_language["company"] = $_REQUEST["input_company"]; $input_language["shop_code"] = $_REQUEST["input_shopcode"]; $input_language["shop_language_code"] = $_REQUEST["input_language_code"]; $input_language["id"] = $_REQUEST["input_id"]; $input_language["code"] = $_REQUEST["input_code"]; $input_language["locale_code"] = $_REQUEST["input_locale_code"]; $input_language["name"] = $_REQUEST["input_name"]; $input_language["std_std_main_navigation_id"] = $_REQUEST["input_std_main_navigation_id"]; $input_language["site_title_name"] = $_REQUEST["input_site_title_name"]; $input_language["meta_description"] = $_REQUEST["input_meta_description"]; $input_language["meta_keywords"] = $_REQUEST["input_meta_keywords"]; $input_language["main_navigation_id"] = $_REQUEST["input_main_layout_id"]; $input_language["no_of_navigation"] = @mysqli_num_rows(@mysqli_query($GLOBALS['mysql_con'], "SELECT id FROM main_navigation WHERE main_language_id = '" . $_REQUEST["input_id"]."'")); $input_language["related_language_codes"] = $_REQUEST["input_related_language_codes"]; $input_language["catalog_login"] = $_REQUEST["input_catalog_login"]; $input_language["active"] = $_REQUEST["input_active"]; require_once("edit_language_cardform.inc.php"); } } ?>