2 /* vim: set expandtab sw=4 ts=4 sts=4: */
11 require_once './libraries/common.inc.php';
13 if (empty($GLOBALS['is_header_sent'])) {
16 * Gets a core script and starts output buffering work
18 require_once './libraries/common.inc.php';
19 require_once './libraries/ob.lib.php';
22 // garvin: For re-usability, moved http-headers and stylesheets
23 // to a seperate file. It can now be included by header.inc.php,
26 require_once './libraries/header_http.inc.php';
27 require_once './libraries/header_meta_style.inc.php';
41 PMA_getenv('HTTP_HOST') ?
PMA_getenv('HTTP_HOST') : '',
42 isset($GLOBALS['cfg']['Server']['host']) ?
$GLOBALS['cfg']['Server']['host'] : '',
43 isset($GLOBALS['cfg']['Server']['verbose']) ?
$GLOBALS['cfg']['Server']['verbose'] : '',
44 !empty($GLOBALS['cfg']['Server']['verbose']) ?
$GLOBALS['cfg']['Server']['verbose'] : (isset($GLOBALS['cfg']['Server']['host']) ?
$GLOBALS['cfg']['Server']['host'] : ''),
47 'phpMyAdmin ' . PMA_VERSION
,
49 !empty($GLOBALS['table']) ?
$GLOBALS['cfg']['TitleTable'] :
50 (!empty($GLOBALS['db']) ?
$GLOBALS['cfg']['TitleDatabase'] :
51 (!empty($GLOBALS['cfg']['Server']['host']) ?
$GLOBALS['cfg']['TitleServer'] :
52 $GLOBALS['cfg']['TitleDefault']))
54 // here, the function does not exist with this configuration: $cfg['ServerDefault'] = 0;
55 $is_superuser = function_exists('PMA_isSuperuser') && PMA_isSuperuser();
57 <script type
="text/javascript">
59 // Updates the title of the frameset if possible (ns4 does not allow this)
60 if (typeof(parent
.document
) != 'undefined' && typeof(parent
.document
) != 'unknown'
61 && typeof(parent
.document
.title
) == 'string') {
62 parent
.document
.title
= '<?php echo PMA_sanitize(str_replace('\'
', '\\\'
', $title)); ?>';
65 // Add some javascript instructions if required
66 if (isset($js_to_run) && $js_to_run == 'functions.js') {
69 // js form validation stuff
70 var errorMsg0
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strFormEmpty
']); ?>';
71 var errorMsg1
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strNotNumber
']); ?>';
72 var noDropDbMsg
= '<?php echo (!$is_superuser && !$GLOBALS['cfg
']['AllowUserDropDatabase
'])
73 ? str_replace('\'
', '\\\'
', $GLOBALS['strNoDropDatabases
']) : ''; ?>';
74 var confirmMsg
= '<?php echo(($GLOBALS['cfg
']['Confirm
']) ? str_replace('\'
', '\\\'
', $GLOBALS['strDoYouReally
']) : ''); ?>';
75 var confirmMsgDropDB
= '<?php echo(($GLOBALS['cfg
']['Confirm
']) ? str_replace('\'
', '\\\'
', $GLOBALS['strDropDatabaseStrongWarning
']) : ''); ?>';
78 <script src
="./js/functions.js" type
="text/javascript"></script
>
80 } elseif (isset($js_to_run) && $js_to_run == 'user_password.js') {
83 // js form validation stuff
84 var jsHostEmpty
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strHostEmpty
']); ?>';
85 var jsUserEmpty
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strUserEmpty
']); ?>';
86 var jsPasswordEmpty
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strPasswordEmpty
']); ?>';
87 var jsPasswordNotSame
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strPasswordNotSame
']); ?>';
90 <script src
="./js/user_password.js" type
="text/javascript"></script
>
92 } elseif (isset($js_to_run) && $js_to_run == 'server_privileges.js') {
95 // js form validation stuff
96 var jsHostEmpty
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strHostEmpty
']); ?>';
97 var jsUserEmpty
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strUserEmpty
']); ?>';
98 var jsPasswordEmpty
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strPasswordEmpty
']); ?>';
99 var jsPasswordNotSame
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strPasswordNotSame
']); ?>';
102 <script src
="./js/server_privileges.js" type
="text/javascript"></script
>
103 <script src
="./js/functions.js" type
="text/javascript"></script
>
105 } elseif (isset($js_to_run) && $js_to_run == 'indexes.js') {
108 // js index validation stuff
109 var errorMsg0
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strFormEmpty
']); ?>';
110 var errorMsg1
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strNotNumber
']); ?>';
113 <script src
="./js/indexes.js" type
="text/javascript"></script
>
115 } elseif (isset($js_to_run) && $js_to_run == 'tbl_change.js') {
120 <script src
="./js/tbl_change.js" type
="text/javascript"></script
>
131 // Reloads the navigation frame via JavaScript if required
132 PMA_reloadNavigation();
134 <script src
="./js/tooltip.js" type
="text/javascript"></script
>
135 <meta name
="OBGZip" content
="<?php echo ($GLOBALS['cfg']['OBGzip'] ? 'true' : 'false'); ?>" />
136 <?php
/* remove vertical scroll bar bug in ie */ ?
>
138 <style type
="text/css">
149 <div id
="TooltipContainer" onmouseover
="holdTooltip();" onmouseout
="swapTooltip('default');"></div
>
152 // Include possible custom headers
153 if (file_exists('./config.header.inc.php')) {
154 require './config.header.inc.php';
158 // message of "Cookies required" displayed for auth_type http or config
159 // note: here, the decoration won't work because without cookies,
160 // our standard CSS is not operational
161 if (empty($_COOKIE)) {
162 echo '<div class="notice">' . $GLOBALS['strCookiesRequired'] . '</div>' . "\n";
165 if (!defined('PMA_DISPLAY_HEADING')) {
166 define('PMA_DISPLAY_HEADING', 1);
170 * Display heading if needed. Design can be set in css file.
173 if (PMA_DISPLAY_HEADING
) {
174 $server_info = (!empty($GLOBALS['cfg']['Server']['verbose'])
175 ?
$GLOBALS['cfg']['Server']['verbose']
176 : $GLOBALS['cfg']['Server']['host'] . (empty($GLOBALS['cfg']['Server']['port'])
178 : ':' . $GLOBALS['cfg']['Server']['port']
181 $item = '<a href="%1$s?%2$s" class="item">';
182 if ($GLOBALS['cfg']['NavigationBarIconic']) {
183 $separator = ' <span class="separator"><img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 'item_ltr.png" width="5" height="9" alt="-" /></span>' . "\n";
184 $item .= ' <img class="icon" src="' . $GLOBALS['pmaThemeImage'] . '%5$s" width="16" height="16" alt="" /> ' . "\n";
186 $separator = ' <span class="separator"> - </span>' . "\n";
189 if ($GLOBALS['cfg']['NavigationBarIconic'] !== true) {
192 $item .= '%3$s</a>' . "\n";
194 echo '<div id="serverinfo">' . "\n";
196 $GLOBALS['cfg']['DefaultTabServer'],
197 PMA_generate_common_url(),
198 htmlspecialchars($server_info),
199 $GLOBALS['strServer'],
202 if (strlen($GLOBALS['db'])) {
206 $GLOBALS['cfg']['DefaultTabDatabase'],
207 PMA_generate_common_url($GLOBALS['db']),
208 htmlspecialchars($GLOBALS['db']),
209 $GLOBALS['strDatabase'],
212 if (strlen($GLOBALS['table'])) {
213 require_once './libraries/tbl_info.inc.php';
217 $GLOBALS['cfg']['DefaultTabTable'],
218 PMA_generate_common_url($GLOBALS['db'], $GLOBALS['table']),
219 str_replace(' ', ' ', htmlspecialchars($GLOBALS['table'])),
220 (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ?
$GLOBALS['strView'] : $GLOBALS['strTable']),
221 (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ?
'b_views' : 's_tbl') . '.png');
224 * Displays table comment
225 * @uses $show_comment from libraries/tbl_info.inc.php
226 * @uses $GLOBALS['avoid_show_comment'] from tbl_relation.php
228 if (!empty($show_comment) && !isset($GLOBALS['avoid_show_comment'])) {
229 if (strstr($show_comment, '; InnoDB free')) {
230 $show_comment = preg_replace('@; InnoDB free:.*?$@', '', $show_comment);
232 echo '<span class="table_comment" id="span_table_comment">'
233 .'"' . htmlspecialchars($show_comment)
234 .'"</span>' . "\n";
237 // no table selected, display database comment if present
239 * Settings for relations stuff
241 require_once './libraries/relation.lib.php';
242 $cfgRelation = PMA_getRelationsParam();
244 // Get additional information about tables for tooltip is done
245 // in libraries/db_info.inc.php only once
246 if ($cfgRelation['commwork']) {
247 $comment = PMA_getComments($GLOBALS['db']);
250 * Displays table comment
252 if (is_array($comment) && ! empty($comment)) {
253 echo '<span class="table_comment"'
254 .' id="span_table_comment">"'
255 .htmlspecialchars(implode(' ', $comment))
256 .'"</span>' . "\n";
265 * Sets a variable to remember headers have been sent
267 $GLOBALS['is_header_sent'] = true;