3.3.6-rc1
[phpmyadmin/dkf.git] / libraries / navigation_header.inc.php
blob4e90938f139211d15a7f8311902d57742f7592ec
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
6 * @version $Id$
7 * @package phpMyAdmin
8 */
9 if (! defined('PHPMYADMIN')) {
10 exit;
13 /**
16 if (empty($query_url)) {
17 // avoid putting here $db because it could display a db name
18 // to which the next user does not have access
19 $query_url = PMA_generate_common_url();
22 // display Logo, depending on $GLOBALS['cfg']['LeftDisplayLogo']
23 if ($GLOBALS['cfg']['LeftDisplayLogo']) {
24 $logo = 'phpMyAdmin';
25 if (@file_exists($GLOBALS['pmaThemeImage'] . 'logo_left.png')) {
26 $logo = '<img src="' . $GLOBALS['pmaThemeImage'] . 'logo_left.png" '
27 .'alt="' . $logo . '" id="imgpmalogo" />';
28 } elseif (@file_exists($GLOBALS['pmaThemeImage'] . 'pma_logo2.png')) {
29 $logo = '<img src="' . $GLOBALS['pmaThemeImage'] . 'pma_logo2.png" '
30 .'alt="' . $logo . '" id="imgpmalogo" />';
33 echo '<div id="pmalogo">' . "\n"
34 .'<a href="' . $GLOBALS['cfg']['LeftLogoLink'];
35 switch ($GLOBALS['cfg']['LeftLogoLinkWindow']) {
36 case 'new':
37 echo '" target="_blank"';
38 break;
39 case 'main':
40 // do not add our parameters for an external link
41 if (substr(strtolower($GLOBALS['cfg']['LeftLogoLink']), 0, 4) !== 'http') {
42 echo '?' . $query_url . '" target="frame_content"';
43 } else {
44 echo '"';
47 echo '>' . $logo . '</a>' . "\n"
48 .'</div>' . "\n";
49 } // end of display logo
51 <div id="leftframelinks">
52 <?php
53 echo '<a href="main.php?' . $query_url . '"'
54 .' title="' . $strHome . '">'
55 .($GLOBALS['cfg']['MainPageIconic']
56 ? '<img class="icon" src="' . $pmaThemeImage . 'b_home.png" width="16" '
57 .' height="16" alt="' . $strHome . '" />'
58 : $strHome)
59 .'</a>' . "\n";
60 // if we have chosen server
61 if ($server != 0) {
62 // Logout for advanced authentication
63 if ($GLOBALS['cfg']['Server']['auth_type'] != 'config') {
64 echo ($GLOBALS['cfg']['MainPageIconic'] ? '' : ' - ');
65 echo '<a href="index.php?' . $query_url . '&amp;old_usr='
66 .urlencode($PHP_AUTH_USER) . '" target="_parent"'
67 .' title="' . $strLogout . '" >'
68 .($GLOBALS['cfg']['MainPageIconic']
69 ? '<img class="icon" src="' . $pmaThemeImage . 's_loggoff.png" '
70 .' width="16" height="16" alt="' . $strLogout . '" />'
71 : $strLogout)
72 .'</a>' . "\n";
73 } // end if ($GLOBALS['cfg']['Server']['auth_type'] != 'config'
75 $anchor = 'querywindow.php?' . PMA_generate_common_url($db, $table);
77 if ($GLOBALS['cfg']['MainPageIconic']) {
78 $query_frame_link_text =
79 '<img class="icon" src="' . $pmaThemeImage . 'b_selboard.png"'
80 .' width="16" height="16" alt="' . $strQueryFrame . '" />';
81 } else {
82 echo '<br />' . "\n";
83 $query_frame_link_text = $strQueryFrame;
85 echo '<a href="' . $anchor . '&amp;no_js=true"'
86 .' title="' . $strQueryFrame . '"';
87 echo ' onclick="javascript:if (window.parent.open_querywindow()) return false;"';
88 echo '>' . $query_frame_link_text . '</a>' . "\n";
89 } // end if ($server != 0)
91 if ($GLOBALS['cfg']['MainPageIconic']) {
92 echo ' <a href="Documentation.html" target="documentation"'
93 .' title="' . $strPmaDocumentation . '" >'
94 .'<img class="icon" src="' . $pmaThemeImage . 'b_docs.png" width="16" height="16"'
95 .' alt="' . $strPmaDocumentation . '" /></a>' . "\n";
96 echo ' ' . PMA_showMySQLDocu('', '', TRUE) . "\n";
98 echo '</div>' . "\n";
101 * Displays the MySQL servers choice form
103 if ($GLOBALS['cfg']['LeftDisplayServers'] && (count($GLOBALS['cfg']['Servers']) > 1 || $server == 0 && count($GLOBALS['cfg']['Servers']) == 1)) {
104 echo '<div id="serverinfo">';
105 include './libraries/select_server.lib.php';
106 PMA_select_server(true, true);
107 echo '</div><br />';
108 } // end if LeftDisplayServers