Translated using Weblate (Catalan)
[phpmyadmin.git] / libraries / rte / rte_main.inc.php
blob93047ab6f4e4206e0b6c1b637b301dd73745435d
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_general.lib.php';
17 require_once './libraries/rte/rte_words.lib.php';
18 require_once './libraries/rte/rte_export.lib.php';
19 require_once './libraries/rte/rte_list.lib.php';
20 require_once './libraries/rte/rte_footer.lib.php';
22 if ($GLOBALS['is_ajax_request'] != true) {
23 /**
24 * Displays the header and tabs
26 if (! empty($table) && in_array($table, $GLOBALS['dbi']->getTables($db))) {
27 include_once './libraries/tbl_common.inc.php';
28 } else {
29 $table = '';
30 include_once './libraries/db_common.inc.php';
31 include_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 (/*overload*/mb_strlen($db)) {
40 $GLOBALS['dbi']->selectDb($db);
41 if (! isset($url_query)) {
42 $url_query = PMA_URL_getCommon(
43 array(
44 'db' => $db, 'table' => $table
51 /**
52 * Generate the conditional classes that will
53 * be used to attach jQuery events to links
55 $ajax_class = array(
56 'add' => 'class="ajax add_anchor"',
57 'edit' => 'class="ajax edit_anchor"',
58 'exec' => 'class="ajax exec_anchor"',
59 'drop' => 'class="ajax drop_anchor"',
60 'export' => 'class="ajax export_anchor"'
63 /**
64 * Create labels for the list
66 $titles = PMA_Util::buildActionTitles();
68 /**
69 * Keep a list of errors that occurred while
70 * processing an 'Add' or 'Edit' operation.
72 $errors = array();
75 /**
76 * Call the appropriate main function
78 switch ($_PMA_RTE) {
79 case 'RTN':
80 $type = null;
81 if (isset($_REQUEST['type'])) {
82 $type = $_REQUEST['type'];
84 PMA_RTN_main($type);
85 break;
86 case 'TRI':
87 PMA_TRI_main();
88 break;
89 case 'EVN':
90 PMA_EVN_main();
91 break;