sorry, wrong version checked in
[phpmyadmin/arisferyanto.git] / tbl_properties_links.php
blobaafcc5e4414f874a064d41e2288346d4c6c35a80
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');
15 $book_sql_query = PMA_queryBookmarks($db, $GLOBALS['cfg']['Bookmark'], '\'' . PMA_sqlAddslashes($table) . '\'', 'label');
17 /**
18 * Displays links
20 $tabs = array();
22 $tabs['browse']['icon'] = 'b_browse.png';
23 $tabs['browse']['text'] = $strBrowse;
25 $tabs['structure']['icon'] = 'b_props.png';
26 $tabs['structure']['link'] = 'tbl_properties_structure.php';
27 $tabs['structure']['text'] = $strStructure;
29 $tabs['sql']['icon'] = 'b_sql.png';
30 $tabs['sql']['link'] = 'tbl_properties.php';
31 $tabs['sql']['text'] = $strSQL;
33 $tabs['search']['icon'] = 'b_search.png';
34 $tabs['search']['text'] = $strSearch;
36 if ( ! (isset($db_is_information_schema) && $db_is_information_schema) ) {
37 $tabs['insert']['icon'] = 'b_insrow.png';
38 $tabs['insert']['link'] = 'tbl_change.php';
39 $tabs['insert']['text'] = $strInsert;
42 $tabs['export']['icon'] = 'b_tblexport.png';
43 $tabs['export']['link'] = 'tbl_properties_export.php';
44 $tabs['export']['args']['single_table'] = 'true';
45 $tabs['export']['text'] = $strExport;
47 /**
48 * Don't display , "Import", "Operations" and "Empty"
49 * for views and information_schema
51 if ( ! $tbl_is_view && ! (isset($db_is_information_schema) && $db_is_information_schema )) {
52 $tabs['import']['icon'] = 'b_tblimport.png';
53 $tabs['import']['link'] = 'tbl_import.php';
54 $tabs['import']['text'] = $strImport;
56 $tabs['operation']['icon'] = 'b_tblops.png';
57 $tabs['operation']['link'] = 'tbl_properties_operations.php';
58 $tabs['operation']['text'] = $strOperations;
60 if ($table_info_num_rows > 0) {
61 $ln8_stt = (PMA_MYSQL_INT_VERSION >= 40000)
62 ? 'TRUNCATE TABLE '
63 : 'DELETE FROM ';
64 $tabs['empty']['link'] = 'sql.php';
65 $tabs['empty']['args']['sql_query'] = $ln8_stt . PMA_backquote($table);
66 $tabs['empty']['args']['zero_rows'] = sprintf($strTableHasBeenEmptied, htmlspecialchars($table));
67 $tabs['empty']['attr'] = 'onclick="return confirmLink(this, \'' . $ln8_stt . PMA_jsFormat($table) . '\')"';
68 $tabs['empty']['args']['goto'] = 'tbl_properties_structure.php';
69 $tabs['empty']['class'] = 'caution';
71 $tabs['empty']['icon'] = 'b_empty.png';
72 $tabs['empty']['text'] = $strEmpty;
75 /**
76 * no drop in information_schema
78 if ( ! (isset($db_is_information_schema) && $db_is_information_schema) ) {
79 $tabs['drop']['icon'] = 'b_deltbl.png';
80 $tabs['drop']['link'] = 'sql.php';
81 $tabs['drop']['text'] = $strDrop;
82 $tabs['drop']['args']['reload'] = 1;
83 $tabs['drop']['args']['purge'] = 1;
84 $drop_command = 'DROP ' . ($tbl_is_view ? 'VIEW' : 'TABLE');
85 $tabs['drop']['args']['sql_query'] = $drop_command . ' ' . PMA_backquote($table);
86 $tabs['drop']['args']['goto'] = 'db_details_structure.php';
87 $tabs['drop']['args']['zero_rows'] = sprintf(($tbl_is_view ? $strViewHasBeenDropped : $strTableHasBeenDropped), htmlspecialchars($table));
88 $tabs['drop']['attr'] = 'onclick="return confirmLink(this, \'' . $drop_command . ' ' . PMA_jsFormat($table) . '\')"';
89 unset($drop_command);
90 $tabs['drop']['class'] = 'caution';
93 if ($table_info_num_rows > 0 || $tbl_is_view) {
94 $tabs['browse']['link'] = 'sql.php';
95 $tabs['browse']['args']['sql_query'] = isset($book_sql_query) && $book_sql_query != FALSE ? $book_sql_query : 'SELECT * FROM ' . PMA_backquote($table);
96 $tabs['browse']['args']['pos'] = 0;
97 $tabs['search']['link'] = 'tbl_select.php';
100 echo PMA_getTabs( $tabs );
101 unset( $tabs );
104 * Displays a message
106 if (!empty($message)) {
107 PMA_showMessage($message);
108 unset($message);
111 ?><br />