Translated using Weblate.
[phpmyadmin.git] / libraries / tbl_links.inc.php
blobbdc7adc260309bf8996312bcf6bcc7229fd46653
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @package PhpMyAdmin
6 */
7 if (! defined('PHPMYADMIN')) {
8 exit;
11 /**
12 * Check parameters
14 require_once './libraries/common.inc.php';
16 PMA_checkParameters(array('db', 'table'));
18 /**
19 * Prepares links
21 require_once './libraries/bookmark.lib.php';
24 /**
25 * Set parameters for links
27 $url_params = array();
28 $url_params['db'] = $db;
29 $url_params['table'] = $table;
31 /**
32 * Defines the urls to return to in case of error in a sql statement
34 $err_url_0 = $cfg['DefaultTabDatabase'] . PMA_generate_common_url(array('db' => $db,));
35 $err_url = $cfg['DefaultTabTable'] . PMA_generate_common_url($url_params);
37 /**
38 * Displays headers
40 require_once './libraries/header.inc.php';
42 /**
43 * Ensure that $db_is_information_schema is not null
45 if (! isset($db_is_information_schema)) {
46 $db_is_information_schema = false;
49 /**
50 * Displays links
52 $tabs = array();
54 $tabs['browse']['icon'] = 'b_browse.png';
55 $tabs['browse']['text'] = __('Browse');
56 $tabs['browse']['link'] = 'sql.php';
57 $tabs['browse']['args']['pos'] = 0;
59 $tabs['structure']['icon'] = 'b_props.png';
60 $tabs['structure']['link'] = 'tbl_structure.php';
61 $tabs['structure']['text'] = __('Structure');
63 $tabs['sql']['icon'] = 'b_sql.png';
64 $tabs['sql']['link'] = 'tbl_sql.php';
65 $tabs['sql']['text'] = __('SQL');
67 $tabs['search']['icon'] = 'b_search.png';
68 $tabs['search']['text'] = __('Search');
69 $tabs['search']['link'] = 'tbl_select.php';
71 if (!$db_is_information_schema) {
72 $tabs['insert']['icon'] = 'b_insrow.png';
73 $tabs['insert']['link'] = 'tbl_change.php';
74 $tabs['insert']['text'] = __('Insert');
77 $tabs['export']['icon'] = 'b_tblexport.png';
78 $tabs['export']['link'] = 'tbl_export.php';
79 $tabs['export']['args']['single_table'] = 'true';
80 $tabs['export']['text'] = __('Export');
82 /**
83 * Don't display "Import" and "Operations"
84 * for views and information_schema
86 if (! $tbl_is_view && !$db_is_information_schema) {
87 $tabs['import']['icon'] = 'b_tblimport.png';
88 $tabs['import']['link'] = 'tbl_import.php';
89 $tabs['import']['text'] = __('Import');
91 $tabs['operation']['icon'] = 'b_tblops.png';
92 $tabs['operation']['link'] = 'tbl_operations.php';
93 $tabs['operation']['text'] = __('Operations');
95 if (PMA_Tracker::isActive()) {
96 $tabs['tracking']['icon'] = 'eye.png';
97 $tabs['tracking']['text'] = __('Tracking');
98 $tabs['tracking']['link'] = 'tbl_tracking.php';
100 if (!$db_is_information_schema && !PMA_DRIZZLE) {
101 if (PMA_currentUserHasPrivilege('TRIGGER', $db, $table) && ! PMA_Table::isView($db, $table)) {
102 $tabs['triggers']['link'] = 'tbl_triggers.php';
103 $tabs['triggers']['text'] = __('Triggers');
104 $tabs['triggers']['icon'] = 'b_triggers.png';
109 * Views support a limited number of operations
111 if ($tbl_is_view && !$db_is_information_schema) {
112 $tabs['operation']['icon'] = 'b_tblops.png';
113 $tabs['operation']['link'] = 'view_operations.php';
114 $tabs['operation']['text'] = __('Operations');
117 if ($table_info_num_rows == 0 && !$tbl_is_view) {
118 $tabs['browse']['warning'] = __('Table seems to be empty!');
119 $tabs['search']['warning'] = __('Table seems to be empty!');
122 echo PMA_generate_html_tabs($tabs, $url_params);
123 unset($tabs);
125 if (PMA_Tracker::isActive() and PMA_Tracker::isTracked($GLOBALS["db"], $GLOBALS["table"])) {
126 $msg = PMA_Message::notice('<a href="tbl_tracking.php?'.$url_query.'">'.sprintf(__('Tracking of %s.%s is activated.'), htmlspecialchars($GLOBALS["db"]), htmlspecialchars($GLOBALS["table"])).'</a>');
127 $msg->display();
131 * Displays a message
133 if (!empty($message)) {
134 PMA_showMessage($message);
135 unset($message);