home *** CD-ROM | disk | FTP | other *** search
/ Freelog 70 / Freelog070.iso / Internet / EasyPHP / easyphp1-8_setup.exe / {app} / phpmyadmin / db_details_links.php < prev    next >
Encoding:
PHP Script  |  2004-10-21  |  4.3 KB  |  106 lines

  1. <?php
  2. /* $Id: db_details_links.php,v 2.12 2004/10/21 10:18:12 nijel Exp $ */
  3. // vim: expandtab sw=4 ts=4 sts=4:
  4.  
  5.  
  6. /**
  7.  * Counts amount of navigation tabs
  8.  */
  9. $db_details_links_count_tabs = 0;
  10.  
  11.  
  12. /**
  13.  * If coming from a Show MySQL link on the home page,
  14.  * put something in $sub_part
  15.  */
  16. if (empty($sub_part)) {
  17.     $sub_part = '_structure';
  18. }
  19.  
  20.  
  21. /**
  22.  * Prepares links
  23.  */
  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;
  30. }
  31. else {
  32.     $lnk3 = '';
  33.     $arg3 = '';
  34.     $lnk4 = '';
  35.     $arg4 = '';
  36. }
  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);
  42. }
  43. if ($cfg['AllowUserDropDatabase']) {
  44.     $lnk5 = 'sql.php';
  45.     $arg5 = $url_query . '&sql_query='
  46.           . urlencode('DROP DATABASE ' . PMA_backquote($db))
  47.           . '&zero_rows='
  48.           . urlencode(sprintf($strDatabaseHasBeenDropped, htmlspecialchars(PMA_backquote($db))))
  49.           . '&goto=main.php&back=db_details' . $sub_part . '.php&reload=1&purge=1';
  50.     $att5 = 'onclick="return confirmLinkDropDB(this, \'DROP DATABASE ' . PMA_jsFormat($db) . '\')"';
  51.     $class5 = 'Drop';
  52. }
  53. else {
  54.     $lnk5 = '';
  55.     $class5 = 'Drop';
  56. }
  57.  
  58.  
  59. /**
  60.  * Displays tab links
  61.  */
  62.  
  63. if ($cfg['LightTabs']) {
  64.     echo ' ';
  65. } else {
  66.     echo '<table border="0" cellspacing="0" cellpadding="0" width="100%" id="topmenu">' . "\n"
  67.        . '    <tr>' . "\n"
  68.        . '        <td class="nav" align="left" nowrap="nowrap" valign="bottom">'
  69.        . '            <table border="0" cellpadding="0" cellspacing="0"><tr>'
  70.        . '                <td nowrap="nowrap"><img src="' . $GLOBALS['pmaThemeImage'] . 'spacer.png' . '" width="2" height="1" border="0" alt="" /></td>'
  71.        . '                <td class="navSpacer"><img src="' . $GLOBALS['pmaThemeImage'] . 'spacer.png' . '" width="1" height="1" border="0" alt="" /></td>';
  72. }
  73.  
  74. 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);
  75. 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 . '&db_query_force=1');
  76. 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);
  77. 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);
  78. 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);
  79. 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);
  80.  
  81. // Displays drop link
  82. if ($lnk5) {
  83.    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);
  84. } // end if
  85. echo "\n";
  86.  
  87. if (!$cfg['LightTabs']) {
  88.     echo '                <td nowrap="nowrap"><img src="' .$GLOBALS['pmaThemeImage'] . 'spacer.png'  . '" width="2" height="1" border="0" alt="" /></td>'
  89.        . '            </tr></table>' . "\n"
  90.        . '        </td>' . "\n"
  91.        . '    </tr>' . "\n"
  92.        . '</table>';
  93. } else {
  94.     echo '<br />';
  95. }
  96.  
  97. /**
  98.  * Displays a message
  99.  */
  100. if (!empty($message)) {
  101.     PMA_showMessage($message);
  102.     unset($message);
  103. }
  104. ?>
  105. <br />
  106.