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