2 /* vim: set expandtab sw=4 ts=4 sts=4: */
7 if (! defined('PHPMYADMIN')) {
14 require_once './libraries/common.inc.php';
18 * If this is an Ajax request, we do not need to generate all this output.
20 if (!$GLOBALS['is_ajax_request']) {
22 if (empty($GLOBALS['is_header_sent'])) {
25 * Gets a core script and starts output buffering work
27 require_once './libraries/ob.lib.php';
30 // if database storage for user preferences is transient, offer to load
31 // exported settings from localStorage (detection will be done in JavaScript)
32 $userprefs_offer_import = $GLOBALS['PMA_Config']->get('user_preferences') == 'session'
33 && !isset($_SESSION['userprefs_autoload']);
34 if ($userprefs_offer_import) {
35 $GLOBALS['js_include'][] = 'config.js';
38 // For re-usability, moved http-headers and stylesheets
39 // to a seperate file. It can now be included by header.inc.php,
42 require_once './libraries/header_http.inc.php';
43 require_once './libraries/header_meta_style.inc.php';
44 require_once './libraries/header_scripts.inc.php';
46 <meta name
="OBGZip" content
="<?php echo ($GLOBALS['cfg']['OBGzip'] ? 'true' : 'false'); ?>" />
47 <?php
/* remove vertical scroll bar bug in ie */ ?
>
49 <style type
="text/css">
62 // Include possible custom headers
63 if (file_exists(CUSTOM_HEADER_FILE
)) {
64 require CUSTOM_HEADER_FILE
;
68 // message of "Cookies required" displayed for auth_type http or config
69 // note: here, the decoration won't work because without cookies,
70 // our standard CSS is not operational
71 if (empty($_COOKIE)) {
72 PMA_Message
::notice(__('Cookies must be enabled past this point.'))->display();
75 // offer to load user preferences from localStorage
76 if ($userprefs_offer_import) {
77 require_once './libraries/user_preferences.lib.php';
78 PMA_userprefs_autoload_header();
81 if (!defined('PMA_DISPLAY_HEADING')) {
82 define('PMA_DISPLAY_HEADING', 1);
86 * Display heading if needed. Design can be set in css file.
89 if (PMA_DISPLAY_HEADING
&& $GLOBALS['server'] > 0) {
90 $server_info = (!empty($GLOBALS['cfg']['Server']['verbose'])
91 ?
$GLOBALS['cfg']['Server']['verbose']
92 : $GLOBALS['cfg']['Server']['host'] . (empty($GLOBALS['cfg']['Server']['port'])
94 : ':' . $GLOBALS['cfg']['Server']['port']
97 $item = '<a href="%1$s?%2$s" class="item">';
98 if ($GLOBALS['cfg']['NavigationBarIconic']) {
99 $separator = ' <span class="separator"><img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 'item_ltr.png" width="5" height="9" alt="-" /></span>' . "\n";
100 $item .= ' <img class="icon" src="' . $GLOBALS['pmaThemeImage'] . '%5$s" width="16" height="16" alt="" /> ' . "\n";
102 $separator = ' <span class="separator"> - </span>' . "\n";
105 if ($GLOBALS['cfg']['NavigationBarIconic'] !== true) {
108 $item .= '%3$s</a>' . "\n";
110 echo '<div id="serverinfo">' . "\n";
112 $GLOBALS['cfg']['DefaultTabServer'],
113 PMA_generate_common_url(),
114 htmlspecialchars($server_info),
118 if (strlen($GLOBALS['db'])) {
122 $GLOBALS['cfg']['DefaultTabDatabase'],
123 PMA_generate_common_url($GLOBALS['db']),
127 // if the table is being dropped, $_REQUEST['purge'] is set
128 // (it always contains "1")
129 // so do not display the table name in upper div
130 if (strlen($GLOBALS['table']) && ! (isset($_REQUEST['purge']))) {
131 require_once './libraries/tbl_info.inc.php';
135 $GLOBALS['cfg']['DefaultTabTable'],
136 PMA_generate_common_url($GLOBALS['db'], $GLOBALS['table']),
137 str_replace(' ', ' ', htmlspecialchars($GLOBALS['table'])),
138 (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ?
__('View') : __('Table')),
139 (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ?
'b_views' : 's_tbl') . '.png');
142 * Displays table comment
143 * @uses $show_comment from libraries/tbl_info.inc.php
144 * @uses $GLOBALS['avoid_show_comment'] from tbl_relation.php
146 if (!empty($show_comment) && !isset($GLOBALS['avoid_show_comment'])) {
147 if (strstr($show_comment, '; InnoDB free')) {
148 $show_comment = preg_replace('@; InnoDB free:.*?$@', '', $show_comment);
150 echo '<span class="table_comment" id="span_table_comment">'
151 .'"' . htmlspecialchars($show_comment)
152 .'"</span>' . "\n";
155 // no table selected, display database comment if present
157 * Settings for relations stuff
159 require_once './libraries/relation.lib.php';
160 $cfgRelation = PMA_getRelationsParam();
162 // Get additional information about tables for tooltip is done
163 // in libraries/db_info.inc.php only once
164 if ($cfgRelation['commwork']) {
165 $comment = PMA_getDbComment($GLOBALS['db']);
167 * Displays table comment
169 if (! empty($comment)) {
170 echo '<span class="table_comment"'
171 . ' id="span_table_comment">"'
172 . htmlspecialchars($comment)
173 . '"</span>' . "\n";
182 * Sets a variable to remember headers have been sent
184 $GLOBALS['is_header_sent'] = true;
185 } //end if(!$GLOBALS['is_ajax_request'])