diff --git a/libraries/mult_submits.inc.php b/libraries/mult_submits.inc.php index bf4678808..5e4b2448b 100644 --- a/libraries/mult_submits.inc.php +++ b/libraries/mult_submits.inc.php @@ -117,14 +117,18 @@ if (! empty($submit_mult) if (!empty($submit_mult) && !empty($what)) { $js_to_run = 'functions.js'; unset($message); + + require_once './libraries/header.inc.php'; if (strlen($table)) { require './libraries/tbl_common.php'; $url_query .= '&goto=tbl_sql.php&back=tbl_sql.php'; require './libraries/tbl_info.inc.php'; + require_once './libraries/tbl_links.inc.php'; } elseif (strlen($db)) { require './libraries/db_common.inc.php'; require './libraries/db_info.inc.php'; } + // Builds the query $full_query = ''; if ($what == 'drop_tbl') { @@ -214,36 +218,34 @@ if (!empty($submit_mult) && !empty($what)) { unset($full_query_views); } - // Displays the form - ?> - -
- - $what, + 'reload' => (isset($reload) ? PMA_sanitize($reload) : 0), + ); if (strpos(' ' . $action, 'db_') == 1) { - echo PMA_generate_common_hidden_inputs($db); - } elseif (strpos(' ' . $action, 'tbl_') == 1 - || $what == 'row_delete') { - echo PMA_generate_common_hidden_inputs($db, $table); - } else { - echo PMA_generate_common_hidden_inputs(); + $_url_params['db']= $db; + } elseif (strpos(' ' . $action, 'tbl_') == 1 || $what == 'row_delete') { + $_url_params['db']= $db; + $_url_params['table']= $table; } -?> - - $sval) { - echo '' . "\n"; + $_url_params['selected'][] = $sval; } if ($what == 'drop_tbl' && !empty($views)) { foreach ($views as $current) { - echo '' . "\n"; + $_url_params['views'][] = $current; } } if ($what == 'row_delete') { - echo '' . "\n"; - echo '' . "\n"; + $_url_params['original_sql_query'] = $original_sql_query; + $_url_params['original_url_query'] = $original_url_query; } ?> + +
: @@ -258,7 +260,7 @@ if (!empty($submit_mult) && !empty($what)) { /** - * Executes the query + * Executes the query - dropping rows, columns/fields, tables or dbs */ elseif ($mult_btn == $strYes) { diff --git a/tbl_structure.php b/tbl_structure.php index 455a0194a..06d5c773d 100644 --- a/tbl_structure.php +++ b/tbl_structure.php @@ -1,7 +1,8 @@ is used */ -$cfgRelation = PMA_getRelationsParam(); - - -/** - * Drop multiple fields if required - */ - -// workaround for IE problem: -if (isset($submit_mult_change_x)) { +if (isset($_REQUEST['submit_mult_change_x'])) { $submit_mult = $strChange; -} elseif (isset($submit_mult_drop_x)) { +} elseif (isset($_REQUEST['submit_mult_drop_x'])) { $submit_mult = $strDrop; -} elseif (isset($submit_mult_primary_x)) { +} elseif (isset($_REQUEST['submit_mult_primary_x'])) { $submit_mult = $strPrimary; -} elseif (isset($submit_mult_index_x)) { +} elseif (isset($_REQUEST['submit_mult_index_x'])) { $submit_mult = $strIndex; -} elseif (isset($submit_mult_unique_x)) { +} elseif (isset($_REQUEST['submit_mult_unique_x'])) { $submit_mult = $strUnique; -} elseif (isset($submit_mult_fulltext_x)) { +} elseif (isset($_REQUEST['submit_mult_fulltext_x'])) { $submit_mult = $strIdxFulltext; -} elseif (isset($submit_mult_browse_x)) { +} elseif (isset($_REQUEST['submit_mult_browse_x'])) { $submit_mult = $strBrowse; +} elseif (isset($_REQUEST['submit_mult'])) { + $submit_mult = $_REQUEST['submit_mult']; +} elseif (isset($_REQUEST['mult_btn']) && $_REQUEST['mult_btn'] == $strYes) { + $submit_mult = 'row_delete'; + if (isset($_REQUEST['selected'])) { + $_REQUEST['selected_fld'] = $_REQUEST['selected']; + } } -if ((!empty($submit_mult) && isset($selected_fld)) || isset($mult_btn)) { +if (! empty($submit_mult) && isset($_REQUEST['selected_fld'])) { $err_url = 'tbl_structure.php?' . PMA_generate_common_url($db, $table); if ($submit_mult == $strBrowse) { + // browsing the table displaying only selected fields/columns $GLOBALS['active_page'] = 'sql.php'; $sql_query = ''; foreach ($_REQUEST['selected_fld'] as $idx => $sval) { @@ -54,17 +57,26 @@ if ((!empty($submit_mult) && isset($selected_fld)) || isset($mult_btn)) { // what is this htmlspecialchars() for?? //$sql_query .= ' FROM ' . PMA_backquote(htmlspecialchars($table)); - $sql_query .= ' FROM ' . PMA_backquote($table); + $sql_query .= ' FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table); require './sql.php'; + exit; } else { + // handle multiple field commands + // handle confirmation of deleting multiple fields/columns $action = 'tbl_structure.php'; - require_once './libraries/header.inc.php'; - require_once './libraries/tbl_links.inc.php'; require './libraries/mult_submits.inc.php'; + //require_once './libraries/header.inc.php'; + //require_once './libraries/tbl_links.inc.php'; + + $message = $strSuccess; } - exit; } +/** + * Gets the relation settings + */ +$cfgRelation = PMA_getRelationsParam(); + /** * Runs common work */ @@ -75,26 +87,19 @@ $url_query .= '&goto=tbl_structure.php&back=tbl_structure.php'; * Prepares the table structure display */ + /** * Gets tables informations */ require_once './libraries/tbl_info.inc.php'; -/** - * Show result of multi submit operation - */ -if ((!empty($submit_mult) && isset($selected_fld)) - || isset($mult_btn)) { - $message = $strSuccess; -} - /** * Displays top menu links */ require_once './libraries/tbl_links.inc.php'; // 2. Gets table keys and retains them -$result = PMA_DBI_query('SHOW INDEX FROM ' . PMA_backquote($table) . ';'); +$result = PMA_DBI_query('SHOW INDEX FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table) . ';'); $primary = ''; $ret_keys = array(); $pk_array = array(); // will be use to emphasis prim. keys in the table view @@ -133,79 +138,18 @@ $analyzed_sql = PMA_SQP_analyze(PMA_SQP_parse($show_create_table)); */ // action titles (image or string) $titles = array(); -if ($cfg['PropertiesIconic'] == true) { - if ($cfg['PropertiesIconic'] === 'both') { - $iconic_spacer = '
'; - } else { - $iconic_spacer = ''; - } - - // images replaced 2004-05-08 by mkkeck - $titles['Change'] = $iconic_spacer - . '' . $strChange . ''; - $titles['Drop'] = $iconic_spacer - . '' . $strDrop . ''; - $titles['NoDrop'] = $iconic_spacer - . '' . $strDrop . ''; - $titles['Primary'] = $iconic_spacer - . '' . $strPrimary . ''; - $titles['Index'] = $iconic_spacer - . '' . $strIndex . ''; - $titles['Unique'] = $iconic_spacer - . '' . $strUnique . ''; - $titles['IdxFulltext'] = $iconic_spacer - . '' . $strIdxFulltext . ''; - $titles['NoPrimary'] = $iconic_spacer - . '' . $strPrimary . ''; - $titles['NoIndex'] = $iconic_spacer - . '' . $strIndex . ''; - $titles['NoUnique'] = $iconic_spacer - . '' . $strUnique . ''; - $titles['NoIdxFulltext'] = $iconic_spacer - . '' . $strIdxFulltext . ''; - $titles['BrowseDistinctValues'] = $iconic_spacer - . '' . $strBrowseDistinctValues . ''; - - if ($cfg['PropertiesIconic'] === 'both') { - $titles['Change'] .= $strChange . '
'; - $titles['Drop'] .= $strDrop . ''; - $titles['NoDrop'] .= $strDrop . ''; - $titles['Primary'] .= $strPrimary . ''; - $titles['Index'] .= $strIndex . ''; - $titles['Unique'] .= $strUnique . ''; - $titles['IdxFulltext' ] .= $strIdxFulltext . ''; - $titles['NoPrimary'] .= $strPrimary . ''; - $titles['NoIndex'] .= $strIndex . ''; - $titles['NoUnique'] .= $strUnique . ''; - $titles['NoIdxFulltext'] .= $strIdxFulltext . ''; - $titles['BrowseDistinctValues'] .= $strBrowseDistinctValues . ''; - } -} else { - $titles['Change'] = $strChange; - $titles['Drop'] = $strDrop; - $titles['NoDrop'] = $strDrop; - $titles['Primary'] = $strPrimary; - $titles['Index'] = $strIndex; - $titles['Unique'] = $strUnique; - $titles['IdxFulltext'] = $strIdxFulltext; - $titles['NoPrimary'] = $strPrimary; - $titles['NoIndex'] = $strIndex; - $titles['NoUnique'] = $strUnique; - $titles['NoIdxFulltext'] = $strIdxFulltext; - $titles['BrowseDistinctValues'] = $strBrowseDistinctValues; -} +$titles['Change'] = PMA_getIcon('b_edit.png', $strChange, true); +$titles['Drop'] = PMA_getIcon('b_drop.png', $strDrop, true); +$titles['NoDrop'] = PMA_getIcon('b_drop.png', $strDrop, true); +$titles['Primary'] = PMA_getIcon('b_primary.png', $strPrimary, true); +$titles['Index'] = PMA_getIcon('b_index.png', $strIndex, true); +$titles['Unique'] = PMA_getIcon('b_unique.png', $strUnique, true); +$titles['IdxFulltext'] = PMA_getIcon('b_ftext.png', $strIdxFulltext, true); +$titles['NoPrimary'] = PMA_getIcon('bd_primary.png', $strPrimary, true); +$titles['NoIndex'] = PMA_getIcon('bd_index.png', $strIndex, true); +$titles['NoUnique'] = PMA_getIcon('bd_unique.png', $strUnique, true); +$titles['NoIdxFulltext'] = PMA_getIcon('bd_ftext.png', $strIdxFulltext, true); +$titles['BrowseDistinctValues'] = PMA_getIcon('b_browse.png', $strBrowseDistinctValues, true); /** * Displays the table structure ('show table' works correct since 3.23.03) @@ -249,7 +193,7 @@ if ($GLOBALS['cfg']['ShowPropertyComments']) { require_once './libraries/relation.lib.php'; require_once './libraries/transformations.lib.php'; - $cfgRelation = PMA_getRelationsParam(); + //$cfgRelation = PMA_getRelationsParam(); if ($cfgRelation['commwork'] || PMA_MYSQL_INT_VERSION >= 40100) { $comments_map = PMA_getComments($db, $table);