2 /* vim: set expandtab sw=4 ts=4 sts=4: */
6 * @package PhpMyAdmin-Designer
12 require_once './libraries/common.inc.php';
13 require_once 'libraries/pmd_common.php';
15 $cfgRelation = PMA_getRelationsParam();
17 if (! $cfgRelation['designerwork']) {
22 * Sets globals from $_POST
28 foreach ($post_params as $one_post_param) {
29 if (isset($_POST[$one_post_param])) {
30 $GLOBALS[$one_post_param] = $_POST[$one_post_param];
34 foreach ($_POST['t_x'] as $key => $value) {
35 // table name decode (post PDF exp/imp)
36 $KEY = empty($_POST['IS_AJAX']) ?
urldecode($key) : $key;
37 list($DB,$TAB) = explode(".", $KEY);
38 PMA_queryAsControlUser(
39 'DELETE FROM ' . PMA_Util
::backquote($GLOBALS['cfgRelation']['db'])
40 . '.' . PMA_Util
::backquote($GLOBALS['cfgRelation']['designer_coords'])
41 . ' WHERE `db_name` = \'' . PMA_Util
::sqlAddSlashes($DB) . '\''
42 . ' AND `table_name` = \'' . PMA_Util
::sqlAddSlashes($TAB) . '\'',
43 true, PMA_DatabaseInterface
::QUERY_STORE
46 PMA_queryAsControlUser(
47 'INSERT INTO ' . PMA_Util
::backquote($GLOBALS['cfgRelation']['db'])
48 . '.' . PMA_Util
::backquote($GLOBALS['cfgRelation']['designer_coords'])
49 . ' (db_name, table_name, x, y, v, h)'
51 . '\'' . PMA_Util
::sqlAddSlashes($DB) . '\', '
52 . '\'' . PMA_Util
::sqlAddSlashes($TAB) . '\', '
53 . '\'' . PMA_Util
::sqlAddSlashes($_POST['t_x'][$key]) . '\', '
54 . '\'' . PMA_Util
::sqlAddSlashes($_POST['t_y'][$key]) . '\', '
55 . '\'' . PMA_Util
::sqlAddSlashes($_POST['t_v'][$key]) . '\', '
56 . '\'' . PMA_Util
::sqlAddSlashes($_POST['t_h'][$key]) . '\')',
57 true, PMA_DatabaseInterface
::QUERY_STORE
60 //----------------------------------------------------------------------------
67 function PMD_errorSave()
69 global $die_save_pos; // if this file included
70 if (! empty($die_save_pos)) {
71 header("Content-Type: text/xml; charset=utf-8");
72 header("Cache-Control: no-cache");
74 '<root act="save_pos" return="'
75 . __('Error saving coordinates for Designer.')
81 if (! empty($die_save_pos)) {
82 header("Content-Type: text/xml; charset=utf-8");
83 header("Cache-Control: no-cache");
87 return='<?php echo __('Modifications have been saved
'); ?>'></root
>