PageRenderTime 39ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/libraries/navigation_header.inc.php

http://github.com/phpmyadmin/phpmyadmin
PHP | 107 lines | 78 code | 11 blank | 18 comment | 20 complexity | 8eb2ca92b7b4003bd7323bb06c5a377f MD5 | raw file
Possible License(s): GPL-2.0, MIT, LGPL-3.0
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * displays the pma logo, links and db and server selection in left frame
  5. *
  6. * @package PhpMyAdmin
  7. */
  8. if (! defined('PHPMYADMIN')) {
  9. exit;
  10. }
  11. /**
  12. *
  13. */
  14. if (empty($query_url)) {
  15. // avoid putting here $db because it could display a db name
  16. // to which the next user does not have access
  17. $query_url = PMA_generate_common_url();
  18. }
  19. // display Logo, depending on $GLOBALS['cfg']['LeftDisplayLogo']
  20. if ($GLOBALS['cfg']['LeftDisplayLogo']) {
  21. $logo = 'phpMyAdmin';
  22. if (@file_exists($GLOBALS['pmaThemeImage'] . 'logo_left.png')) {
  23. $logo = '<img src="' . $GLOBALS['pmaThemeImage'] . 'logo_left.png" '
  24. .'alt="' . $logo . '" id="imgpmalogo" />';
  25. } elseif (@file_exists($GLOBALS['pmaThemeImage'] . 'pma_logo2.png')) {
  26. $logo = '<img src="' . $GLOBALS['pmaThemeImage'] . 'pma_logo2.png" '
  27. .'alt="' . $logo . '" id="imgpmalogo" />';
  28. }
  29. echo '<div id="pmalogo">' . "\n";
  30. if ($GLOBALS['cfg']['LeftLogoLink']) {
  31. echo '<a href="' . htmlspecialchars($GLOBALS['cfg']['LeftLogoLink']);
  32. switch ($GLOBALS['cfg']['LeftLogoLinkWindow']) {
  33. case 'new':
  34. echo '" target="_blank"';
  35. break;
  36. case 'main':
  37. // do not add our parameters for an external link
  38. if (substr(strtolower($GLOBALS['cfg']['LeftLogoLink']), 0, 4) !== '://') {
  39. echo '?' . $query_url . '" target="frame_content"';
  40. } else {
  41. echo '" target="_blank"';
  42. }
  43. }
  44. echo '>' . $logo . '</a>' . "\n";
  45. } else {
  46. echo $logo . "\n";
  47. }
  48. echo '</div>' . "\n";
  49. } // end of display logo
  50. ?>
  51. <div id="leftframelinks">
  52. <?php
  53. echo '<a target="frame_content" href="main.php?' . $query_url . '"'
  54. .' title="' . __('Home') . '">'
  55. . PMA_getImage('b_home.png', __('Home'))
  56. .'</a>' . "\n";
  57. // if we have chosen server
  58. if ($server != 0) {
  59. // Logout for advanced authentication
  60. if ($GLOBALS['cfg']['Server']['auth_type'] != 'config') {
  61. echo '<a href="index.php?' . $query_url . '&amp;old_usr='
  62. .urlencode($PHP_AUTH_USER) . '" target="_parent"'
  63. .' title="' . __('Log out') . '" >'
  64. . PMA_getImage('s_loggoff.png', __('Log out'))
  65. .'</a>' . "\n";
  66. } // end if ($GLOBALS['cfg']['Server']['auth_type'] != 'config'
  67. $anchor = 'querywindow.php?' . PMA_generate_common_url($db, $table);
  68. echo '<a href="' . $anchor . '&amp;no_js=true"'
  69. .' title="' . __('Query window') . '"';
  70. echo ' onclick="if (window.parent.open_querywindow()) return false;"';
  71. echo '>' . PMA_getImage('b_selboard.png', __('Query window')) . '</a>' . "\n";
  72. } // end if ($server != 0)
  73. echo ' <a href="Documentation.html" target="documentation"'
  74. .' title="' . __('phpMyAdmin documentation') . '" >';
  75. echo PMA_getImage('b_docs.png', __('phpMyAdmin documentation'));
  76. echo '</a>';
  77. echo PMA_showMySQLDocu('', '', true) . "\n";
  78. $params = array('uniqid' => uniqid());
  79. if (!empty($GLOBALS['db'])) {
  80. $params['db'] = $GLOBALS['db'];
  81. }
  82. echo '<a href="navigation.php?' . PMA_generate_common_url($params)
  83. . '" title="' . __('Reload navigation frame') . '" target="frame_navigation">';
  84. echo PMA_getImage('s_reload.png', __('Reload navigation frame'));
  85. echo '</a>';
  86. echo '</div>' . "\n";
  87. /**
  88. * Displays the MySQL servers choice form
  89. */
  90. if ($GLOBALS['cfg']['LeftDisplayServers'] && (count($GLOBALS['cfg']['Servers']) > 1 || $server == 0 && count($GLOBALS['cfg']['Servers']) == 1)) {
  91. echo '<div id="serverinfo">';
  92. include './libraries/select_server.lib.php';
  93. PMA_selectServer(true, true);
  94. echo '</div><br />';
  95. } // end if LeftDisplayServers
  96. ?>