Czech translation update.
[phpmyadmin/last10db.git] / libraries / header.inc.php
blobf6c3e6f0beb135705421b38e39546882df89dbd1
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @version $Id$
6 */
8 /**
11 require_once './libraries/common.inc.php';
13 if (empty($GLOBALS['is_header_sent'])) {
15 /**
16 * Gets a core script and starts output buffering work
18 require_once './libraries/common.inc.php';
19 require_once './libraries/ob.lib.php';
20 PMA_outBufferPre();
22 // garvin: For re-usability, moved http-headers and stylesheets
23 // to a seperate file. It can now be included by header.inc.php,
24 // querywindow.php.
26 require_once './libraries/header_http.inc.php';
27 require_once './libraries/header_meta_style.inc.php';
28 require_once './libraries/header_scripts.inc.php';
30 <meta name="OBGZip" content="<?php echo ($GLOBALS['cfg']['OBGzip'] ? 'true' : 'false'); ?>" />
31 <?php /* remove vertical scroll bar bug in ie */ ?>
32 <!--[if IE 6]>
33 <style type="text/css">
34 /* <![CDATA[ */
35 html {
36 overflow-y: scroll;
38 /* ]]> */
39 </style>
40 <![endif]-->
41 </head>
43 <body>
44 <?php
46 // Include possible custom headers
47 if (file_exists('./config.header.inc.php')) {
48 require './config.header.inc.php';
52 // message of "Cookies required" displayed for auth_type http or config
53 // note: here, the decoration won't work because without cookies,
54 // our standard CSS is not operational
55 if (empty($_COOKIE)) {
56 PMA_Message::notice('strCookiesRequired')->display();
59 if (!defined('PMA_DISPLAY_HEADING')) {
60 define('PMA_DISPLAY_HEADING', 1);
63 /**
64 * Display heading if needed. Design can be set in css file.
67 if (PMA_DISPLAY_HEADING && $server > 0) {
68 $server_info = (!empty($GLOBALS['cfg']['Server']['verbose'])
69 ? $GLOBALS['cfg']['Server']['verbose']
70 : $GLOBALS['cfg']['Server']['host'] . (empty($GLOBALS['cfg']['Server']['port'])
71 ? ''
72 : ':' . $GLOBALS['cfg']['Server']['port']
75 $item = '<a href="%1$s?%2$s" class="item">';
76 if ($GLOBALS['cfg']['NavigationBarIconic']) {
77 $separator = ' <span class="separator"><img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 'item_ltr.png" width="5" height="9" alt="-" /></span>' . "\n";
78 $item .= ' <img class="icon" src="' . $GLOBALS['pmaThemeImage'] . '%5$s" width="16" height="16" alt="" /> ' . "\n";
79 } else {
80 $separator = ' <span class="separator"> - </span>' . "\n";
83 if ($GLOBALS['cfg']['NavigationBarIconic'] !== true) {
84 $item .= '%4$s: ';
86 $item .= '%3$s</a>' . "\n";
88 echo '<div id="serverinfo">' . "\n";
89 printf($item,
90 $GLOBALS['cfg']['DefaultTabServer'],
91 PMA_generate_common_url(),
92 htmlspecialchars($server_info),
93 $GLOBALS['strServer'],
94 's_host.png');
96 if (strlen($GLOBALS['db'])) {
98 echo $separator;
99 printf($item,
100 $GLOBALS['cfg']['DefaultTabDatabase'],
101 PMA_generate_common_url($GLOBALS['db']),
102 htmlspecialchars($GLOBALS['db']),
103 $GLOBALS['strDatabase'],
104 's_db.png');
106 if (strlen($GLOBALS['table'])) {
107 require_once './libraries/tbl_info.inc.php';
109 echo $separator;
110 printf($item,
111 $GLOBALS['cfg']['DefaultTabTable'],
112 PMA_generate_common_url($GLOBALS['db'], $GLOBALS['table']),
113 str_replace(' ', '&nbsp;', htmlspecialchars($GLOBALS['table'])),
114 (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ? $GLOBALS['strView'] : $GLOBALS['strTable']),
115 (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ? 'b_views' : 's_tbl') . '.png');
118 * Displays table comment
119 * @uses $show_comment from libraries/tbl_info.inc.php
120 * @uses $GLOBALS['avoid_show_comment'] from tbl_relation.php
122 if (!empty($show_comment) && !isset($GLOBALS['avoid_show_comment'])) {
123 if (strstr($show_comment, '; InnoDB free')) {
124 $show_comment = preg_replace('@; InnoDB free:.*?$@', '', $show_comment);
126 echo '<span class="table_comment" id="span_table_comment">'
127 .'&quot;' . htmlspecialchars($show_comment)
128 .'&quot;</span>' . "\n";
129 } // end if
130 } else {
131 // no table selected, display database comment if present
133 * Settings for relations stuff
135 require_once './libraries/relation.lib.php';
136 $cfgRelation = PMA_getRelationsParam();
138 // Get additional information about tables for tooltip is done
139 // in libraries/db_info.inc.php only once
140 if ($cfgRelation['commwork']) {
141 $comment = PMA_getDbComment($GLOBALS['db']);
143 * Displays table comment
145 if (! empty($comment)) {
146 echo '<span class="table_comment"'
147 . ' id="span_table_comment">&quot;'
148 . htmlspecialchars($comment)
149 . '&quot;</span>' . "\n";
150 } // end if
154 echo '</div>';
158 * Sets a variable to remember headers have been sent
160 $GLOBALS['is_header_sent'] = true;