Translation update done using Pootle.
[phpmyadmin.git] / libraries / db_links.inc.php
blobed30283ef4f772ee9fcb40e070aa864fcf7b12f2
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @package phpMyAdmin
6 */
7 if (! defined('PHPMYADMIN')) {
8 exit;
11 /**
14 require_once './libraries/common.inc.php';
16 /**
17 * Gets the relation settings
19 $cfgRelation = PMA_getRelationsParam();
21 /**
22 * If coming from a Show MySQL link on the home page,
23 * put something in $sub_part
25 if (empty($sub_part)) {
26 $sub_part = '_structure';
29 /**
30 * Checks for superuser privileges
32 $is_superuser = PMA_isSuperuser();
34 /**
35 * Prepares links
38 /**
39 * export, search and qbe links if there is at least one table
41 if ($num_tables == 0) {
42 $tab_qbe['warning'] = __('Database seems to be empty!');
43 $tab_search['warning'] = __('Database seems to be empty!');
44 $tab_export['warning'] = __('Database seems to be empty!');
47 $tab_structure['link'] = 'db_structure.php';
48 $tab_structure['text'] = __('Structure');
49 $tab_structure['icon'] = 'ic_b_props';
51 $tab_sql['link'] = 'db_sql.php';
52 $tab_sql['args']['db_query_force'] = 1;
53 $tab_sql['text'] = __('SQL');
54 $tab_sql['icon'] = 'ic_b_sql';
56 $tab_export['text'] = __('Export');
57 $tab_export['icon'] = 'ic_b_export';
58 $tab_export['link'] = 'db_export.php';
60 $tab_search['text'] = __('Search');
61 $tab_search['icon'] = 'ic_b_search';
62 $tab_search['link'] = 'db_search.php';
64 if (PMA_Tracker::isActive()) {
65 $tab_tracking['text'] = __('Tracking');
66 $tab_tracking['icon'] = 'ic_eye';
67 $tab_tracking['link'] = 'db_tracking.php';
70 $tab_qbe['text'] = __('Query');
71 $tab_qbe['icon'] = 'ic_s_db';
72 $tab_qbe['link'] = 'db_qbe.php';
74 if ($cfgRelation['designerwork']) {
75 $tab_designer['text'] = __('Designer');
76 $tab_designer['icon'] = 'ic_b_relations';
77 $tab_designer['link'] = 'pmd_general.php';
80 if (! $db_is_information_schema) {
81 $tab_import['link'] = 'db_import.php';
82 $tab_import['text'] = __('Import');
83 $tab_import['icon'] = 'ic_b_import';
84 $tab_operation['link'] = 'db_operations.php';
85 $tab_operation['text'] = __('Operations');
86 $tab_operation['icon'] = 'ic_b_tblops';
87 if ($is_superuser && !PMA_DRIZZLE) {
88 $tab_privileges['link'] = 'server_privileges.php';
89 $tab_privileges['args']['checkprivs'] = $db;
90 // stay on database view
91 $tab_privileges['args']['viewing_mode'] = 'db';
92 $tab_privileges['text'] = __('Privileges');
93 $tab_privileges['icon'] = 'ic_s_rights';
95 $tab_routines['link'] = 'db_routines.php';
96 $tab_routines['text'] = __('Routines');
97 $tab_routines['icon'] = 'ic_b_routines';
99 $tab_events['link'] = 'db_events.php';
100 $tab_events['text'] = __('Events');
101 $tab_events['icon'] = 'ic_b_events';
103 $tab_triggers['link'] = 'db_triggers.php';
104 $tab_triggers['text'] = __('Triggers');
105 $tab_triggers['icon'] = 'ic_b_triggers';
109 * Displays tab links
111 $tabs = array();
112 $tabs[] =& $tab_structure;
113 $tabs[] =& $tab_sql;
114 $tabs[] =& $tab_search;
115 $tabs[] =& $tab_qbe;
116 $tabs[] =& $tab_export;
117 if (! $db_is_information_schema) {
118 $tabs[] =& $tab_import;
119 $tabs[] =& $tab_operation;
120 if ($is_superuser && !PMA_DRIZZLE) {
121 $tabs[] =& $tab_privileges;
123 if (!PMA_DRIZZLE) {
124 $tabs[] =& $tab_routines;
126 if (PMA_MYSQL_INT_VERSION >= 50106 && ! PMA_DRIZZLE) {
127 if (PMA_currentUserHasPrivilege('EVENT', $db)) {
128 $tabs[] =& $tab_events;
131 if (!PMA_DRIZZLE) {
132 if (PMA_currentUserHasPrivilege('TRIGGER', $db)) {
133 $tabs[] =& $tab_triggers;
137 if (PMA_Tracker::isActive()) {
138 $tabs[] =& $tab_tracking;
140 if (! $db_is_information_schema) {
141 if ($cfgRelation['designerwork']) {
142 $tabs[] =& $tab_designer;
146 $url_params['db'] = $db;
148 echo PMA_generate_html_tabs($tabs, $url_params);
149 unset($tabs);
152 * Displays a message
154 if (!empty($message)) {
155 PMA_showMessage($message);
156 unset($message);