2 /* vim: set expandtab sw=4 ts=4 sts=4: */
7 if (! defined('PHPMYADMIN')) {
14 require_once './libraries/common.inc.php';
16 if (empty($GLOBALS['is_header_sent'])) {
19 * Gets a core script and starts output buffering work
21 require_once './libraries/ob.lib.php';
24 // if database storage for user preferences is transient, offer to load
25 // exported settings from localStorage (detection will be done in JavaScript)
26 $userprefs_offer_import = $GLOBALS['PMA_Config']->get('user_preferences') == 'session'
27 && !isset($_SESSION['userprefs_autoload']);
28 if ($userprefs_offer_import) {
29 $GLOBALS['js_include'][] = 'config.js';
32 // For re-usability, moved http-headers and stylesheets
33 // to a seperate file. It can now be included by header.inc.php,
36 require_once './libraries/header_http.inc.php';
37 require_once './libraries/header_meta_style.inc.php';
38 require_once './libraries/header_scripts.inc.php';
40 <meta name
="OBGZip" content
="<?php echo ($GLOBALS['cfg']['OBGzip'] ? 'true' : 'false'); ?>" />
41 <?php
/* remove vertical scroll bar bug in ie */ ?
>
43 <style type
="text/css">
56 // Include possible custom headers
57 if (file_exists(CUSTOM_HEADER_FILE
)) {
58 require CUSTOM_HEADER_FILE
;
62 // message of "Cookies required" displayed for auth_type http or config
63 // note: here, the decoration won't work because without cookies,
64 // our standard CSS is not operational
65 if (empty($_COOKIE)) {
66 PMA_Message
::notice(__('Cookies must be enabled past this point.'))->display();
69 // offer to load user preferences from localStorage
70 if ($userprefs_offer_import) {
71 require_once './libraries/user_preferences.lib.php';
72 PMA_userprefs_autoload_header();
75 if (!defined('PMA_DISPLAY_HEADING')) {
76 define('PMA_DISPLAY_HEADING', 1);
80 * Display heading if needed. Design can be set in css file.
83 if (PMA_DISPLAY_HEADING
&& $GLOBALS['server'] > 0) {
84 $server_info = (!empty($GLOBALS['cfg']['Server']['verbose'])
85 ?
$GLOBALS['cfg']['Server']['verbose']
86 : $GLOBALS['cfg']['Server']['host'] . (empty($GLOBALS['cfg']['Server']['port'])
88 : ':' . $GLOBALS['cfg']['Server']['port']
91 $item = '<a href="%1$s?%2$s" class="item">';
92 if ($GLOBALS['cfg']['NavigationBarIconic']) {
93 $separator = ' <span class="separator"><img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 'item_ltr.png" width="5" height="9" alt="-" /></span>' . "\n";
94 $item .= ' <img class="icon" src="' . $GLOBALS['pmaThemeImage'] . '%5$s" width="16" height="16" alt="" /> ' . "\n";
96 $separator = ' <span class="separator"> - </span>' . "\n";
99 if ($GLOBALS['cfg']['NavigationBarIconic'] !== true) {
102 $item .= '%3$s</a>' . "\n";
104 echo '<div id="serverinfo">' . "\n";
106 $GLOBALS['cfg']['DefaultTabServer'],
107 PMA_generate_common_url(),
108 htmlspecialchars($server_info),
112 if (strlen($GLOBALS['db'])) {
116 $GLOBALS['cfg']['DefaultTabDatabase'],
117 PMA_generate_common_url($GLOBALS['db']),
118 htmlspecialchars($GLOBALS['db']),
122 if (isset($GLOBALS['action']) && $GLOBALS['action'] == 'tbl_create.php') {
123 /* We're creating a new table */
127 PMA_generate_common_url($GLOBALS['db']),
131 // if the table is being dropped, $_REQUEST['purge'] is set
132 // (it always contains "1")
133 // so do not display the table name in upper div
134 } elseif (strlen($GLOBALS['table']) && ! (isset($_REQUEST['purge']))) {
135 require_once './libraries/tbl_info.inc.php';
139 $GLOBALS['cfg']['DefaultTabTable'],
140 PMA_generate_common_url($GLOBALS['db'], $GLOBALS['table']),
141 str_replace(' ', ' ', htmlspecialchars($GLOBALS['table'])),
142 (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ?
__('View') : __('Table')),
143 (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ?
'b_views' : 's_tbl') . '.png');
146 * Displays table comment
147 * @uses $show_comment from libraries/tbl_info.inc.php
148 * @uses $GLOBALS['avoid_show_comment'] from tbl_relation.php
150 if (!empty($show_comment) && !isset($GLOBALS['avoid_show_comment'])) {
151 if (strstr($show_comment, '; InnoDB free')) {
152 $show_comment = preg_replace('@; InnoDB free:.*?$@', '', $show_comment);
154 echo '<span class="table_comment" id="span_table_comment">'
155 .'"' . htmlspecialchars($show_comment)
156 .'"</span>' . "\n";
159 // no table selected, display database comment if present
161 * Settings for relations stuff
163 $cfgRelation = PMA_getRelationsParam();
165 // Get additional information about tables for tooltip is done
166 // in libraries/db_info.inc.php only once
167 if ($cfgRelation['commwork']) {
168 $comment = PMA_getDbComment($GLOBALS['db']);
170 * Displays table comment
172 if (! empty($comment)) {
173 echo '<span class="table_comment"'
174 . ' id="span_table_comment">"'
175 . htmlspecialchars($comment)
176 . '"</span>' . "\n";
185 * Sets a variable to remember headers have been sent
187 $GLOBALS['is_header_sent'] = true;