rte_main.inc.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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, $GLOBALS['dbi']->getTables($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. $GLOBALS['dbi']->selectDb($db);
  38. if (! isset($url_query)) {
  39. $url_query = PMA_URL_getCommon($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 occurred 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. $type = null;
  76. if (isset($_REQUEST['type'])) {
  77. $type = $_REQUEST['type'];
  78. }
  79. PMA_RTN_main($type);
  80. break;
  81. case 'TRI':
  82. PMA_TRI_main();
  83. break;
  84. case 'EVN':
  85. PMA_EVN_main();
  86. break;
  87. }
  88. ?>