tbl_indexes.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Displays index edit/creation form and handles it
  5. *
  6. * @package PhpMyAdmin
  7. */
  8. /**
  9. * Gets some core libraries
  10. */
  11. require_once 'libraries/common.inc.php';
  12. require_once 'libraries/Index.class.php';
  13. require_once 'libraries/tbl_common.inc.php';
  14. require_once 'libraries/tbl_indexes.lib.php';
  15. $index = PMA_prepareFormValues($db, $table);
  16. /**
  17. * Process the data from the edit/create index form,
  18. * run the query to build the new index
  19. * and moves back to "tbl_sql.php"
  20. */
  21. if (isset($_REQUEST['do_save_data'])) {
  22. PMA_handleCreateOrEditIndex($db, $table, $index);
  23. } // end builds the new index
  24. /**
  25. * Display the form to edit/create an index
  26. */
  27. require_once 'libraries/tbl_info.inc.php';
  28. $add_fields = PMA_getNumberOfFieldsForForm($index);
  29. $form_params = PMA_getFormParameters($db, $table);
  30. // Get fields and stores their name/type
  31. $fields = PMA_getNameAndTypeOfTheColumns($db, $table);
  32. $html = PMA_getHtmlForIndexForm($fields, $index, $form_params, $add_fields);
  33. $response = PMA_Response::getInstance();
  34. $response->addHTML($html);
  35. $header = $response->getHeader();
  36. $scripts = $header->getScripts();
  37. $scripts->addFile('indexes.js');
  38. ?>