PageRenderTime 72ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/phpmyadmin/libraries/navigation_header.inc.php

https://bitbucket.org/adarshj/convenient_website
PHP | 134 lines | 105 code | 11 blank | 18 comment | 28 complexity | fb27b128c89c9d28c07aa10156b0fd0a MD5 | raw file
Possible License(s): Apache-2.0, MPL-2.0-no-copyleft-exception, LGPL-2.1, BSD-2-Clause, GPL-2.0, 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 href="main.php?' . $query_url . '"'
  54. .' title="' . __('Home') . '">'
  55. .($GLOBALS['cfg']['MainPageIconic']
  56. ? PMA_getImage('b_home.png', __('Home'))
  57. : __('Home'))
  58. .'</a>' . "\n";
  59. // if we have chosen server
  60. if ($server != 0) {
  61. // Logout for advanced authentication
  62. if ($GLOBALS['cfg']['Server']['auth_type'] != 'config') {
  63. echo ($GLOBALS['cfg']['MainPageIconic'] ? '' : ' - ');
  64. echo '<a href="index.php?' . $query_url . '&amp;old_usr='
  65. .urlencode($PHP_AUTH_USER) . '" target="_parent"'
  66. .' title="' . __('Log out') . '" >'
  67. .($GLOBALS['cfg']['MainPageIconic']
  68. ? PMA_getImage('s_loggoff.png', __('Log out'))
  69. : __('Log out'))
  70. .'</a>' . "\n";
  71. } // end if ($GLOBALS['cfg']['Server']['auth_type'] != 'config'
  72. $anchor = 'querywindow.php?' . PMA_generate_common_url($db, $table);
  73. if ($GLOBALS['cfg']['MainPageIconic']) {
  74. $query_frame_link_text = PMA_getImage('b_selboard.png', __('Query window'));
  75. } else {
  76. echo '<br />' . "\n";
  77. $query_frame_link_text = __('Query window');
  78. }
  79. echo '<a href="' . $anchor . '&amp;no_js=true"'
  80. .' title="' . __('Query window') . '"';
  81. echo ' onclick="if (window.parent.open_querywindow()) return false;"';
  82. echo '>' . $query_frame_link_text . '</a>' . "\n";
  83. } // end if ($server != 0)
  84. echo ' <a href="Documentation.html" target="documentation"'
  85. .' title="' . __('phpMyAdmin documentation') . '" >';
  86. if ($GLOBALS['cfg']['MainPageIconic']) {
  87. echo PMA_getImage('b_docs.png', __('phpMyAdmin documentation'));
  88. } else {
  89. echo '<br />' . __('phpMyAdmin documentation');
  90. }
  91. echo '</a>';
  92. $documentation_link = PMA_showMySQLDocu('', '', true);
  93. if ($GLOBALS['cfg']['MainPageIconic']) {
  94. echo $documentation_link . "\n";
  95. } else {
  96. preg_match('/<a[^>]*>/', $documentation_link, $matches);
  97. $link = $matches[0];
  98. echo substr($link, 0, strlen($link) - 1) . ' title="' . __('Documentation') . '" >'
  99. . '<br />' . __('Documentation') . '</a>';
  100. }
  101. $params = array('uniqid' => uniqid());
  102. if (!empty($GLOBALS['db'])) {
  103. $params['db'] = $GLOBALS['db'];
  104. }
  105. echo '<a href="navigation.php?' . PMA_generate_common_url($params)
  106. . '" title="' . __('Reload navigation frame') . '" target="frame_navigation">';
  107. if ($GLOBALS['cfg']['MainPageIconic']) {
  108. echo PMA_getImage('s_reload.png', __('Reload navigation frame'));
  109. } else {
  110. echo '<br />' . __('Reload navigation frame');
  111. }
  112. echo '</a>';
  113. echo '</div>' . "\n";
  114. /**
  115. * Displays the MySQL servers choice form
  116. */
  117. if ($GLOBALS['cfg']['LeftDisplayServers'] && (count($GLOBALS['cfg']['Servers']) > 1 || $server == 0 && count($GLOBALS['cfg']['Servers']) == 1)) {
  118. echo '<div id="serverinfo">';
  119. include './libraries/select_server.lib.php';
  120. PMA_select_server(true, true);
  121. echo '</div><br />';
  122. } // end if LeftDisplayServers
  123. ?>