Fixed: Not selecting a datalabel used to issue a notice(undefined offset)
[phpmyadmin/ammaryasirr.git] / libraries / rte / rte_main.inc.php
blob988cf6b86c4c5dbd7deee39b2aef5c959be209e9
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 require_once './libraries/tbl_common.php';
27 require_once './libraries/tbl_links.inc.php';
28 } else {
29 $table = '';
30 require_once './libraries/db_common.inc.php';
31 require_once './libraries/db_info.inc.php';
33 } else {
34 /**
35 * Since we did not include some libraries, we need
36 * to manually select the required database and
37 * create the missing $url_query variable
39 if (strlen($db)) {
40 PMA_DBI_select_db($db);
41 if (! isset($url_query)) {
42 $url_query = PMA_generate_common_url($db, $table);
47 /**
48 * Generate the conditional classes that will
49 * be used to attach jQuery events to links
51 $ajax_class = array('add' => '',
52 'edit' => '',
53 'exec' => '',
54 'drop' => '',
55 'export' => '');
56 if ($GLOBALS['cfg']['AjaxEnable']) {
57 $ajax_class = array('add' => 'class="ajax_add_anchor"',
58 'edit' => 'class="ajax_edit_anchor"',
59 'exec' => 'class="ajax_exec_anchor"',
60 'drop' => 'class="ajax_drop_anchor"',
61 'export' => 'class="ajax_export_anchor"');
64 /**
65 * Create labels for the list
67 $titles = PMA_buildActionTitles();
69 /**
70 * Keep a list of errors that occured while
71 * processing an 'Add' or 'Edit' operation.
73 $errors = array();
76 /**
77 * Call the appropriate main function
79 switch ($_PMA_RTE) {
80 case 'RTN':
81 PMA_RTN_main();
82 break;
83 case 'TRI':
84 PMA_TRI_main();
85 break;
86 case 'EVN':
87 PMA_EVN_main();
88 break;
91 /**
92 * Display the footer, if necessary
94 if ($GLOBALS['is_ajax_request'] != true) {
95 require './libraries/footer.inc.php';