From d5da2590b54a11de0fc17cf1a8e2ae0fdc002b07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 19 Apr 2010 14:11:14 +0200 Subject: [PATCH] Replace own string export in pmd with generic one. --- js/messages.php | 12 +++++++++++- pmd/scripts/ajax.js | 6 +++--- pmd_general.php | 19 ++++++++----------- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/js/messages.php b/js/messages.php index 4a1936167..0845226d7 100644 --- a/js/messages.php +++ b/js/messages.php @@ -16,7 +16,7 @@ header('Content-Type: text/javascript; charset=UTF-8'); header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 3600) . ' GMT'); // Avoid loading the full common.inc.php because this would add many -// non-js-compatible stuff like DOCTYPE +// non-js-compatible stuff like DOCTYPE define('PMA_MINIMUM_COMMON', true); require_once './libraries/common.inc.php'; // But this one is needed for PMA_escapeJsString() @@ -50,6 +50,16 @@ $js_messages['strPasswordNotSame'] = $GLOBALS['strPasswordNotSame']; $js_messages['strGo'] = __('Go'); $js_messages['strCancel'] = __('Cancel'); +/* Designer */ +$js_messages['strModifications'] = $GLOBALS['strModifications']; +$js_messages['strRelationDeleted'] = $GLOBALS['strRelationDeleted']; +$js_messages['strForeignKeyRelationAdded'] = $GLOBALS['strForeignKeyRelationAdded']; +$js_messages['strInternalRelationAdded'] = $GLOBALS['strInternalRelationAdded']; +$js_messages['strErrorRelationAdded'] = $GLOBALS['strErrorRelationAdded']; +$js_messages['strErrorRelationExists'] = $GLOBALS['strErrorRelationExists']; +$js_messages['strErrorSaveTable'] = $GLOBALS['strErrorSaveTable']; +$js_messages['strGeneralRelationFeat:strDisabled'] = $GLOBALS['strGeneralRelationFeat'] . ': ' . $GLOBALS['strDisabled']; + echo "var PMA_messages = new Array();\n"; foreach ($js_messages as $name => $js_message) { echo "PMA_messages['" . $name . "'] = '" . PMA_escapeJsString($js_message) . "';\n"; diff --git a/pmd/scripts/ajax.js b/pmd/scripts/ajax.js index ffaea81ee..9a3ef3ed3 100644 --- a/pmd/scripts/ajax.js +++ b/pmd/scripts/ajax.js @@ -104,17 +104,17 @@ function PrintXML() //xmldoc.getElementsByTagName('root')[0].getAttribute("act") if (root.getAttribute('act') == 'save_pos') { - layer_alert(strLang[root.getAttribute('return')]); + layer_alert(PMA_messages[root.getAttribute('return')]); } if (root.getAttribute('act') == 'relation_upd') { - layer_alert(strLang[root.getAttribute('return')]); + layer_alert(PMA_messages[root.getAttribute('return')]); if (root.getAttribute('b') == '1') { contr.splice(root.getAttribute('K'), 1); Re_load(); } } if (root.getAttribute('act') == 'relation_new') { - layer_alert(strLang[root.getAttribute('return')]); + layer_alert(PMA_messages[root.getAttribute('return')]); if (root.getAttribute('b') == '1') { var i = contr.length; var t1 = root.getAttribute('DB1') + '.' + root.getAttribute('T1'); diff --git a/pmd_general.php b/pmd_general.php index f5be69818..a93931c57 100644 --- a/pmd_general.php +++ b/pmd_general.php @@ -39,21 +39,18 @@ echo ' var LangSelectForeignKey = "' . PMA_escapeJsString($strSelectForeignKey) . '"; var LangPleaseSelectPrimaryOrUniqueKey = "' . PMA_escapeJsString($strPleaseSelectPrimaryOrUniqueKey) . '"; var LangIEnotSupport = "' . PMA_escapeJsString($strIEUnsupported) . '"; - var LangChangeDisplay = "' . PMA_escapeJsString($strChangeDisplay) . '"; - - var strLang = Array(); - strLang["strModifications"] = "' . PMA_escapeJsString($strModifications) . '"; - strLang["strRelationDeleted"] = "' . PMA_escapeJsString($strRelationDeleted) . '"; - strLang["strForeignKeyRelationAdded"] = "' . PMA_escapeJsString($strForeignKeyRelationAdded). '"; - strLang["strGeneralRelationFeat:strDisabled"] = "' . PMA_escapeJsString($strGeneralRelationFeat . ' : ' . $strDisabled) . '"; - strLang["strInternalRelationAdded"] = "' . PMA_escapeJsString($strInternalRelationAdded) . '"; - strLang["strErrorRelationAdded"] = "' . PMA_escapeJsString($strErrorRelationAdded) . '"; - strLang["strErrorRelationExists"] = "' . PMA_escapeJsString($strErrorRelationExists) . '"; - strLang["strErrorSaveTable"] = "' . PMA_escapeJsString($strErrorSaveTable) . '";'; + var LangChangeDisplay = "' . PMA_escapeJsString($strChangeDisplay) . '";'; ?> // ]]> + $GLOBALS['lang']); +if (isset($GLOBALS['db'])) { + $params['db'] = $GLOBALS['db']; +} +?> +