rte_main.inc.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Common code for Routines, Triggers and Events.
  5. *
  6. * @package PhpMyAdmin
  7. */
  8. if (! defined('PHPMYADMIN')) {
  9. exit;
  10. }
  11. /**
  12. * Include all other files that are common
  13. * to routines, triggers and events.
  14. */
  15. require_once './libraries/rte/rte_words.lib.php';
  16. require_once './libraries/rte/rte_export.lib.php';
  17. require_once './libraries/rte/rte_list.lib.php';
  18. require_once './libraries/rte/rte_footer.lib.php';
  19. if ($GLOBALS['is_ajax_request'] != true) {
  20. /**
  21. * Displays the header and tabs
  22. */
  23. if (! empty($table) && in_array($table, PMA_DBI_get_tables($db))) {
  24. include_once './libraries/tbl_common.inc.php';
  25. } else {
  26. $table = '';
  27. include_once './libraries/db_common.inc.php';
  28. include_once './libraries/db_info.inc.php';
  29. }
  30. } else {
  31. /**
  32. * Since we did not include some libraries, we need
  33. * to manually select the required database and
  34. * create the missing $url_query variable
  35. */
  36. if (strlen($db)) {
  37. PMA_DBI_select_db($db);
  38. if (! isset($url_query)) {
  39. $url_query = PMA_generate_common_url($db, $table);
  40. }
  41. }
  42. }
  43. /**
  44. * Generate the conditional classes that will
  45. * be used to attach jQuery events to links
  46. */
  47. $ajax_class = array(
  48. 'add' => '',
  49. 'edit' => '',
  50. 'exec' => '',
  51. 'drop' => '',
  52. 'export' => ''
  53. );
  54. $ajax_class = array(
  55. 'add' => 'class="ajax add_anchor"',
  56. 'edit' => 'class="ajax edit_anchor"',
  57. 'exec' => 'class="ajax exec_anchor"',
  58. 'drop' => 'class="ajax drop_anchor"',
  59. 'export' => 'class="ajax export_anchor"'
  60. );
  61. /**
  62. * Create labels for the list
  63. */
  64. $titles = PMA_Util::buildActionTitles();
  65. /**
  66. * Keep a list of errors that occured while
  67. * processing an 'Add' or 'Edit' operation.
  68. */
  69. $errors = array();
  70. /**
  71. * Call the appropriate main function
  72. */
  73. switch ($_PMA_RTE) {
  74. case 'RTN':
  75. PMA_RTN_main();
  76. break;
  77. case 'TRI':
  78. PMA_TRI_main();
  79. break;
  80. case 'EVN':
  81. PMA_EVN_main();
  82. break;
  83. }
  84. ?>