going rc2
[phpmyadmin/crack.git] / db_details_links.php3
blob008bd0ac7b7a73c03af59a0ab073c4f6dafdf4f3
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.php3';
27 $arg3 = $url_query;
28 $lnk4 = 'db_search.php3';
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 $links_result = @PMA_mysql_query('USE mysql');
41 $cfg['AllowUserDropDatabase'] = (!PMA_mysql_error());
43 if ($cfg['AllowUserDropDatabase']) {
44 $lnk5 = 'sql.php3';
45 $arg5 = $url_query . '&amp;sql_query='
46 . urlencode('DROP DATABASE ' . PMA_backquote($db))
47 . '&amp;zero_rows='
48 . urlencode(sprintf($strDatabaseHasBeenDropped, htmlspecialchars(PMA_backquote($db))))
49 . '&amp;goto=main.php3&amp;back=db_details' . $sub_part . '.php3&amp;reload=1&amp;purge=1';
50 $att5 = 'class="drop" '
51 . 'onclick="return confirmLink(this, \'DROP DATABASE ' . PMA_jsFormat($db) . '\')"';
53 else {
54 $lnk5 = '';
58 /**
59 * Displays tab links
62 if ($cfg['LightTabs']) {
63 echo '&nbsp;';
64 } else {
65 echo '<table border="0" cellspacing="0" cellpadding="3" width="100%" class="tabs">
66 <tr>
67 <td width="8">&nbsp;</td>';
70 echo PMA_printTab($strStructure, 'db_details_structure.php3', $url_query);
71 echo PMA_printTab($strSQL, 'db_details.php3', $url_query . '&amp;db_query_force=1');
72 echo PMA_printTab($strExport, $lnk3, $arg3);
73 echo PMA_printTab($strSearch, $lnk4, $arg4);
75 // Query by example and dump of the db are only displayed if there is at least
76 // one table in the db
77 if ($num_tables > 0) {
78 echo PMA_printTab($strQBE, 'db_details_qbe.php3', $url_query);
79 } // end if
81 // Displays drop link
82 if ($lnk5) {
83 echo PMA_printTab($strDrop, $lnk5, $arg5, $att5);
84 } // end if
85 echo "\n";
87 if (!$cfg['LightTabs']) {
88 echo '</tr></table>';
89 } else {
90 echo '<br />';
93 <br />