Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshutosh Dhundhara <ashutoshdhundhara@yahoo.com>2014-07-19 10:50:50 +0400
committerAshutosh Dhundhara <ashutoshdhundhara@yahoo.com>2014-07-22 13:59:06 +0400
commit91e9a4d46c5c8299ed80e1bb3ad129bb1a5fdbb7 (patch)
treecda30bafbc428b928c1fe01b7b259416c0a2672a /tbl_indexes.php
parent4193989efedaf52ad2805453de30f6a9e2f1cbe6 (diff)
RFE#908: Improvements for the table editor (index creation).
Signed-off-by: Ashutosh Dhundhara <ashutoshdhundhara@yahoo.com> Fix coding styles. Signed-off-by: Ashutosh Dhundhara <ashutoshdhundhara@yahoo.com> Make index columns sortable. Signed-off-by: Ashutosh Dhundhara <ashutoshdhundhara@yahoo.com> Fix failing test. Signed-off-by: Ashutosh Dhundhara <ashutoshdhundhara@yahoo.com> Fix drag icon in Firefox. Signed-off-by: Ashutosh Dhundhara <ashutoshdhundhara@yahoo.com>
Diffstat (limited to 'tbl_indexes.php')
-rw-r--r--tbl_indexes.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/tbl_indexes.php b/tbl_indexes.php
index e095ded833..52d0348a78 100644
--- a/tbl_indexes.php
+++ b/tbl_indexes.php
@@ -11,9 +11,12 @@
*/
require_once 'libraries/common.inc.php';
require_once 'libraries/Index.class.php';
-require_once 'libraries/tbl_common.inc.php';
require_once 'libraries/tbl_indexes.lib.php';
+if (! isset($_REQUEST['create_edit_table'])) {
+ include_once 'libraries/tbl_common.inc.php';
+}
+
$index = PMA_prepareFormValues($db, $table);
/**
@@ -36,7 +39,16 @@ $add_fields = PMA_getNumberOfFieldsForForm($index);
$form_params = PMA_getFormParameters($db, $table);
// Get fields and stores their name/type
-$fields = PMA_getNameAndTypeOfTheColumns($db, $table);
+if (isset($_REQUEST['create_edit_table'])) {
+ $fields = json_decode($_REQUEST['columns'], true);
+ $index_params = array(
+ 'Non_unique' => ($_REQUEST['index']['Index_type'] == 'UNIQUE') ? '0' : '1'
+ );
+ $index->set($index_params);
+ $add_fields = count($fields);
+} else {
+ $fields = PMA_getNameAndTypeOfTheColumns($db, $table);
+}
$html = PMA_getHtmlForIndexForm($fields, $index, $form_params, $add_fields);