Action should always be displayed here
[phpmyadmin/dkf.git] / libraries / header.inc.php
blob932fb80e457116db8e88ca1b080be5e98844e075
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @version $Id$
6 * @package phpMyAdmin
7 */
8 if (! defined('PHPMYADMIN')) {
9 exit;
12 /**
15 require_once './libraries/common.inc.php';
17 if (empty($GLOBALS['is_header_sent'])) {
19 /**
20 * Gets a core script and starts output buffering work
22 require_once './libraries/ob.lib.php';
23 PMA_outBufferPre();
25 // garvin: For re-usability, moved http-headers and stylesheets
26 // to a seperate file. It can now be included by header.inc.php,
27 // querywindow.php.
29 require_once './libraries/header_http.inc.php';
30 require_once './libraries/header_meta_style.inc.php';
31 require_once './libraries/header_scripts.inc.php';
33 <meta name="OBGZip" content="<?php echo ($GLOBALS['cfg']['OBGzip'] ? 'true' : 'false'); ?>" />
34 <?php /* remove vertical scroll bar bug in ie */ ?>
35 <!--[if IE 6]>
36 <style type="text/css">
37 /* <![CDATA[ */
38 html {
39 overflow-y: scroll;
41 /* ]]> */
42 </style>
43 <![endif]-->
44 </head>
46 <body>
47 <?php
49 // Include possible custom headers
50 if (file_exists('./config.header.inc.php')) {
51 require './config.header.inc.php';
55 // message of "Cookies required" displayed for auth_type http or config
56 // note: here, the decoration won't work because without cookies,
57 // our standard CSS is not operational
58 if (empty($_COOKIE)) {
59 PMA_Message::notice('strCookiesRequired')->display();
62 if (!defined('PMA_DISPLAY_HEADING')) {
63 define('PMA_DISPLAY_HEADING', 1);
66 /**
67 * Display heading if needed. Design can be set in css file.
70 if (PMA_DISPLAY_HEADING && $GLOBALS['server'] > 0) {
71 $server_info = (!empty($GLOBALS['cfg']['Server']['verbose'])
72 ? $GLOBALS['cfg']['Server']['verbose']
73 : $GLOBALS['cfg']['Server']['host'] . (empty($GLOBALS['cfg']['Server']['port'])
74 ? ''
75 : ':' . $GLOBALS['cfg']['Server']['port']
78 $item = '<a href="%1$s?%2$s" class="item">';
79 if ($GLOBALS['cfg']['NavigationBarIconic']) {
80 $separator = ' <span class="separator"><img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 'item_ltr.png" width="5" height="9" alt="-" /></span>' . "\n";
81 $item .= ' <img class="icon" src="' . $GLOBALS['pmaThemeImage'] . '%5$s" width="16" height="16" alt="" /> ' . "\n";
82 } else {
83 $separator = ' <span class="separator"> - </span>' . "\n";
86 if ($GLOBALS['cfg']['NavigationBarIconic'] !== true) {
87 $item .= '%4$s: ';
89 $item .= '%3$s</a>' . "\n";
91 echo '<div id="serverinfo">' . "\n";
92 printf($item,
93 $GLOBALS['cfg']['DefaultTabServer'],
94 PMA_generate_common_url(),
95 htmlspecialchars($server_info),
96 $GLOBALS['strServer'],
97 's_host.png');
99 if (strlen($GLOBALS['db'])) {
101 echo $separator;
102 printf($item,
103 $GLOBALS['cfg']['DefaultTabDatabase'],
104 PMA_generate_common_url($GLOBALS['db']),
105 htmlspecialchars($GLOBALS['db']),
106 $GLOBALS['strDatabase'],
107 's_db.png');
109 if (strlen($GLOBALS['table'])) {
110 require_once './libraries/tbl_info.inc.php';
112 echo $separator;
113 printf($item,
114 $GLOBALS['cfg']['DefaultTabTable'],
115 PMA_generate_common_url($GLOBALS['db'], $GLOBALS['table']),
116 str_replace(' ', '&nbsp;', htmlspecialchars($GLOBALS['table'])),
117 (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ? $GLOBALS['strView'] : $GLOBALS['strTable']),
118 (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ? 'b_views' : 's_tbl') . '.png');
121 * Displays table comment
122 * @uses $show_comment from libraries/tbl_info.inc.php
123 * @uses $GLOBALS['avoid_show_comment'] from tbl_relation.php
125 if (!empty($show_comment) && !isset($GLOBALS['avoid_show_comment'])) {
126 if (strstr($show_comment, '; InnoDB free')) {
127 $show_comment = preg_replace('@; InnoDB free:.*?$@', '', $show_comment);
129 echo '<span class="table_comment" id="span_table_comment">'
130 .'&quot;' . htmlspecialchars($show_comment)
131 .'&quot;</span>' . "\n";
132 } // end if
133 } else {
134 // no table selected, display database comment if present
136 * Settings for relations stuff
138 require_once './libraries/relation.lib.php';
139 $cfgRelation = PMA_getRelationsParam();
141 // Get additional information about tables for tooltip is done
142 // in libraries/db_info.inc.php only once
143 if ($cfgRelation['commwork']) {
144 $comment = PMA_getDbComment($GLOBALS['db']);
146 * Displays table comment
148 if (! empty($comment)) {
149 echo '<span class="table_comment"'
150 . ' id="span_table_comment">&quot;'
151 . htmlspecialchars($comment)
152 . '&quot;</span>' . "\n";
153 } // end if
157 echo '</div>';
161 * Sets a variable to remember headers have been sent
163 $GLOBALS['is_header_sent'] = true;