2 /* vim: set expandtab sw=4 ts=4 sts=4: */
7 if (! defined('PHPMYADMIN')) {
14 require_once './libraries/common.inc.php';
16 PMA_checkParameters(array('db', 'table'));
21 require_once './libraries/bookmark.lib.php';
25 * Set parameters for links
27 $url_params = array();
28 $url_params['db'] = $db;
29 $url_params['table'] = $table;
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);
40 require_once './libraries/header.inc.php';
43 * Ensure that $db_is_information_schema is not null
45 if (! isset($db_is_information_schema)) {
46 $db_is_information_schema = false;
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');
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);
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>');
133 if (!empty($message)) {
134 PMA_showMessage($message);