RFE #1177459, BOOL column type
[phpmyadmin/crack.git] / db_details_links.php
blob8880cb85b9e036ddf4cab75dc9ba7a1db9971aaf
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
6 /**
7 * Counts amount of navigation tabs
8 */
9 $db_details_links_count_tabs = 0;
12 /**
13 * If coming from a Show MySQL link on the home page,
14 * put something in $sub_part
16 if (empty($sub_part)) {
17 $sub_part = '_structure';
21 /**
22 * Prepares links
24 // Export link if there is at least one table
25 if ($num_tables > 0) {
26 $lnk3 = 'db_details_export.php';
27 $arg3 = $url_query;
28 $lnk4 = 'db_search.php';
29 $arg4 = $url_query;
31 else {
32 $lnk3 = '';
33 $arg3 = '';
34 $lnk4 = '';
35 $arg4 = '';
37 // Drop link if allowed
38 if (!$cfg['AllowUserDropDatabase']) {
39 // Check if the user is a Superuser
40 $cfg['AllowUserDropDatabase'] = PMA_DBI_select_db('mysql');
41 PMA_DBI_select_db($db);
43 // rabus: Don't even try to drop information_schema. You won't be able to.
44 // Believe me. You won't.
45 $cfg['AllowUserDropDatabase'] = $cfg['AllowUserDropDatabase'] && !(PMA_MYSQL_INT_VERSION >= 50000 && $db == 'information_schema');
46 if ($cfg['AllowUserDropDatabase']) {
47 $lnk5 = 'sql.php';
48 $arg5 = $url_query . '&amp;sql_query='
49 . urlencode('DROP DATABASE ' . PMA_backquote($db))
50 . '&amp;zero_rows='
51 . urlencode(sprintf($strDatabaseHasBeenDropped, htmlspecialchars(PMA_backquote($db))))
52 . '&amp;goto=main.php&amp;back=db_details' . $sub_part . '.php&amp;reload=1&amp;purge=1';
53 $att5 = 'onclick="return confirmLinkDropDB(this, \'DROP DATABASE ' . PMA_jsFormat($db) . '\')"';
54 $class5 = 'Drop';
56 else {
57 $lnk5 = '';
58 $class5 = 'Drop';
62 /**
63 * Displays tab links
66 if ($cfg['LightTabs']) {
67 echo '&nbsp;';
68 } else {
69 echo '<table border="0" cellspacing="0" cellpadding="0" width="100%" id="topmenu">' . "\n"
70 . ' <tr>' . "\n"
71 . ' <td class="nav" align="left" nowrap="nowrap" valign="bottom">'
72 . ' <table border="0" cellpadding="0" cellspacing="0"><tr>'
73 . ' <td nowrap="nowrap"><img src="' . $GLOBALS['pmaThemeImage'] . 'spacer.png' . '" width="2" height="1" border="0" alt="" /></td>'
74 . ' <td class="navSpacer"><img src="' . $GLOBALS['pmaThemeImage'] . 'spacer.png' . '" width="1" height="1" border="0" alt="" /></td>';
77 echo PMA_printTab(($GLOBALS['cfg']['MainPageIconic'] ? '<img src="' . $GLOBALS['pmaThemeImage'] . 'b_props.png" width="16" height="16" border="0" hspace="2" align="middle" alt="'.$strStructure.'" />' : '') . $strStructure, 'db_details_structure.php', $url_query);
78 echo PMA_printTab(($GLOBALS['cfg']['MainPageIconic'] ? '<img src="' . $GLOBALS['pmaThemeImage'] . 'b_sql.png" width="16" height="16" border="0" hspace="2" align="middle" alt="'.$strSQL.'" />' : '') . $strSQL, 'db_details.php', $url_query . '&amp;db_query_force=1');
79 echo PMA_printTab(($GLOBALS['cfg']['MainPageIconic'] ? '<img src="' . $GLOBALS['pmaThemeImage'] . 'b_search.png" width="16" height="16" border="0" hspace="2" align="middle" alt="'.$strSearch.'" />' : '') . $strSearch, $lnk4, $arg4);
80 echo PMA_printTab(($GLOBALS['cfg']['MainPageIconic'] ? '<img src="' . $GLOBALS['pmaThemeImage'] . 's_db.png" width="16" height="16" border="0" hspace="2" align="middle" alt="'.$strQBE.'" />' : '') . $strQBE, ($num_tables > 0) ? 'db_details_qbe.php' : '', $url_query);
81 echo PMA_printTab(($GLOBALS['cfg']['MainPageIconic'] ? '<img src="' . $GLOBALS['pmaThemeImage'] . 'b_export.png" width="16" height="16" border="0" hspace="2" align="middle" alt="'.$strExport.'" />' : '') . $strExport, $lnk3, $arg3);
82 echo PMA_printTab(($GLOBALS['cfg']['MainPageIconic'] ? '<img src="' . $GLOBALS['pmaThemeImage'] . 'b_tblops.png" width="16" height="16" border="0" hspace="2" align="middle" alt="'.$strOperations.'" />' : '') . $strOperations,'db_operations.php', $url_query);
84 // Displays drop link
85 if ($lnk5) {
86 echo PMA_printTab(($GLOBALS['cfg']['MainPageIconic'] ? '<img src="' . $GLOBALS['pmaThemeImage'] . 'b_deltbl.png" width="16" height="16" border="0" hspace="2" align="middle" alt="'.$strDrop.'" />' : '') . $strDrop, $lnk5, $arg5, $att5, $class5);
87 } // end if
88 echo "\n";
90 if (!$cfg['LightTabs']) {
91 echo ' <td nowrap="nowrap"><img src="' .$GLOBALS['pmaThemeImage'] . 'spacer.png' . '" width="2" height="1" border="0" alt="" /></td>'
92 . ' </tr></table>' . "\n"
93 . ' </td>' . "\n"
94 . ' </tr>' . "\n"
95 . '</table>';
96 } else {
97 echo '<br />';
101 * Settings for relations stuff
103 require_once('./libraries/relation.lib.php');
104 $cfgRelation = PMA_getRelationsParam();
106 // Get additional information about tables for tooltip is done in db_details_db_info.php only once
107 if ($cfgRelation['commwork']) {
108 $comment = PMA_getComments($db);
111 * Displays table comment
113 if (is_array($comment)) {
115 <!-- DB comment -->
116 <p id="dbComment"><i>
117 <?php echo htmlspecialchars(implode(' ', $comment)) . "\n"; ?>
118 </i></p>
119 <?php
120 } // end if
124 * Displays a message
126 if (!empty($message)) {
127 PMA_showMessage($message);
128 unset($message);
131 <br />