Fix typos (bug #1597137).
[phpmyadmin/last10db.git] / libraries / tbl_links.inc.php
blob2cca105aee3e8fcb9a4ef180dfcf9bd6c782405c
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
5 // Check parameters
7 require_once('./libraries/common.lib.php');
9 PMA_checkParameters(array('db', 'table'));
11 /**
12 * Prepares links
14 require_once('./libraries/bookmark.lib.php');
17 /**
18 * Set parameters for links
20 if (empty($url_query)
21 || (isset($_POST['table']) && isset($_POST['new_name']) && $_POST['table'] != $_POST['new_name'])) {
22 $url_query = PMA_generate_common_url($db, $table);
24 $url_params['db'] = $db;
25 $url_params['table'] = $table;
27 /**
28 * Defines the urls to return to in case of error in a sql statement
30 $err_url_0 = $cfg['DefaultTabDatabase'] . PMA_generate_common_url( array( 'db' => $db, ) );
31 $err_url = $cfg['DefaultTabTable'] . PMA_generate_common_url( $url_params );
33 /**
34 * Displays headers
36 $js_to_run = 'functions.js';
37 require_once('./libraries/header.inc.php');
39 /**
40 * Displays links
42 $tabs = array();
44 $tabs['browse']['icon'] = 'b_browse.png';
45 $tabs['browse']['text'] = $strBrowse;
46 $tabs['browse']['link'] = 'sql.php';
47 $tabs['browse']['args']['pos'] = 0;
49 $tabs['structure']['icon'] = 'b_props.png';
50 $tabs['structure']['link'] = 'tbl_structure.php';
51 $tabs['structure']['text'] = $strStructure;
53 $tabs['sql']['icon'] = 'b_sql.png';
54 $tabs['sql']['link'] = 'tbl_sql.php';
55 $tabs['sql']['text'] = $strSQL;
57 $tabs['search']['icon'] = 'b_search.png';
58 $tabs['search']['text'] = $strSearch;
59 $tabs['search']['link'] = 'tbl_select.php';
61 if ( ! (isset($db_is_information_schema) && $db_is_information_schema) ) {
62 $tabs['insert']['icon'] = 'b_insrow.png';
63 $tabs['insert']['link'] = 'tbl_change.php';
64 $tabs['insert']['text'] = $strInsert;
67 $tabs['export']['icon'] = 'b_tblexport.png';
68 $tabs['export']['link'] = 'tbl_export.php';
69 $tabs['export']['args']['single_table'] = 'true';
70 $tabs['export']['text'] = $strExport;
72 /**
73 * Don't display "Import", "Operations" and "Empty"
74 * for views and information_schema
76 if ( ! $tbl_is_view && ! (isset($db_is_information_schema) && $db_is_information_schema )) {
77 $tabs['import']['icon'] = 'b_tblimport.png';
78 $tabs['import']['link'] = 'tbl_import.php';
79 $tabs['import']['text'] = $strImport;
81 $tabs['operation']['icon'] = 'b_tblops.png';
82 $tabs['operation']['link'] = 'tbl_operations.php';
83 $tabs['operation']['text'] = $strOperations;
85 $ln8_stt = (PMA_MYSQL_INT_VERSION >= 40000)
86 ? 'TRUNCATE TABLE '
87 : 'DELETE FROM ';
88 $tabs['empty']['link'] = 'sql.php';
89 $tabs['empty']['args']['sql_query'] = $ln8_stt . PMA_backquote($table);
90 $tabs['empty']['args']['zero_rows'] = sprintf($strTableHasBeenEmptied, htmlspecialchars($table));
91 $tabs['empty']['attr'] = 'onclick="return confirmLink(this, \'' . $ln8_stt . PMA_jsFormat($table) . '\')"';
92 $tabs['empty']['args']['goto'] = 'tbl_structure.php';
93 $tabs['empty']['class'] = 'caution';
94 $tabs['empty']['icon'] = 'b_empty.png';
95 $tabs['empty']['text'] = $strEmpty;
96 if ($table_info_num_rows == 0) {
97 $tabs['empty']['warning'] = $strTableIsEmpty;
102 * no drop in information_schema
104 if ( ! (isset($db_is_information_schema) && $db_is_information_schema) ) {
105 $tabs['drop']['icon'] = 'b_deltbl.png';
106 $tabs['drop']['link'] = 'sql.php';
107 $tabs['drop']['text'] = $strDrop;
108 $tabs['drop']['args']['reload'] = 1;
109 $tabs['drop']['args']['purge'] = 1;
110 $drop_command = 'DROP ' . ($tbl_is_view ? 'VIEW' : 'TABLE');
111 $tabs['drop']['args']['sql_query'] = $drop_command . ' ' . PMA_backquote($table);
112 $tabs['drop']['args']['goto'] = 'db_structure.php';
113 $tabs['drop']['args']['zero_rows'] = sprintf(($tbl_is_view ? $strViewHasBeenDropped : $strTableHasBeenDropped), htmlspecialchars($table));
114 $tabs['drop']['attr'] = 'onclick="return confirmLink(this, \'' . $drop_command . ' ' . PMA_jsFormat($table) . '\')"';
115 unset($drop_command);
116 $tabs['drop']['class'] = 'caution';
119 if ($table_info_num_rows == 0 && !$tbl_is_view) {
120 $tabs['browse']['warning'] = $strTableIsEmpty;
121 $tabs['search']['warning'] = $strTableIsEmpty;
124 echo PMA_getTabs( $tabs );
125 unset( $tabs );
128 * Displays a message
130 if (!empty($message)) {
131 PMA_showMessage($message);
132 unset($message);
135 ?><br />