2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * @package PhpMyAdmin-Designer
10 require_once './libraries/common.inc.php';
12 PMA_Response
::getInstance()->disable();
14 require_once 'libraries/pmd_common.php';
21 foreach ($post_params as $one_post_param) {
22 if (isset($_POST[$one_post_param])) {
23 $GLOBALS[$one_post_param] = $_POST[$one_post_param];
30 if ($cfgRelation['displaywork']) {
32 $disp = PMA_getDisplayField($db, $table);
34 if ($display_field != $disp) {
35 $upd_query = 'UPDATE ' . PMA_Util
::backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_Util
::backquote($cfgRelation['table_info'])
36 . ' SET display_field = \'' . PMA_Util
::sqlAddSlashes($display_field) . '\''
37 . ' WHERE db_name = \'' . PMA_Util
::sqlAddSlashes($db) . '\''
38 . ' AND table_name = \'' . PMA_Util
::sqlAddSlashes($table) . '\'';
40 $upd_query = 'DELETE FROM ' . PMA_Util
::backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_Util
::backquote($cfgRelation['table_info'])
41 . ' WHERE db_name = \'' . PMA_Util
::sqlAddSlashes($db) . '\''
42 . ' AND table_name = \'' . PMA_Util
::sqlAddSlashes($table) . '\'';
44 } elseif ($display_field != '') {
45 $upd_query = 'INSERT INTO ' . PMA_Util
::backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_Util
::backquote($cfgRelation['table_info'])
46 . '(db_name, table_name, display_field) '
48 . '\'' . PMA_Util
::sqlAddSlashes($db) . '\','
49 . '\'' . PMA_Util
::sqlAddSlashes($table) . '\','
50 . '\'' . PMA_Util
::sqlAddSlashes($display_field) . '\')';
53 if (isset($upd_query)) {
54 $upd_rs = PMA_queryAsControlUser($upd_query);
58 header("Content-Type: text/xml; charset=utf-8");
59 header("Cache-Control: no-cache");
60 die("<root act='save_pos' return='" . __('Modifications have been saved') . "'></root>");