3 // vim: expandtab sw=4 ts=4 sts=4:
5 if (empty($GLOBALS['is_header_sent'])) {
8 * Gets a core script and starts output buffering work
10 require_once('./libraries/common.lib.php');
11 require_once('./libraries/ob.lib.php');
12 if ($GLOBALS['cfg']['OBGzip']) {
13 $GLOBALS['ob_mode'] = PMA_outBufferModeGet();
14 if ($GLOBALS['ob_mode']) {
15 PMA_outBufferPre($GLOBALS['ob_mode']);
19 // garvin: For re-usability, moved http-headers and stylesheets
20 // to a seperate file. It can now be included by header.inc.php,
21 // queryframe.php, querywindow.php.
23 require_once('./libraries/header_http.inc.php');
24 require_once('./libraries/header_meta_style.inc.php');
25 /* replaced 2004-05-05 by Michael Keck (mkkeck)
27 if (isset($GLOBALS['db'])) {
28 $title .= str_replace('\'', '\\\'', $GLOBALS['db']);
30 if (isset($GLOBALS['table'])) {
31 $title .= (empty($title) ? '' : '.') . str_replace('\'', '\\\'', $GLOBALS['table']);
33 if (!empty($GLOBALS['cfg']['Server']) && isset($GLOBALS['cfg']['Server']['host'])) {
34 $title .= (empty($title) ? 'phpMyAdmin ' : ' ')
35 . sprintf($GLOBALS['strRunning'], (empty($GLOBALS['cfg']['Server']['verbose']) ? str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['host']) : str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['verbose'])));
37 $title .= (empty($title) ? '' : ' - ') . 'phpMyAdmin ' . PMA_VERSION;
40 * 2004-05-05: replaced by Michael Keck (mkkeck)
43 if ($cfg['ShowHttpHostTitle']) {
44 $title .= (empty($GLOBALS['cfg']['SetHttpHostTitle']) && isset($_SERVER['HTTP_HOST']) ?
$_SERVER['HTTP_HOST'] : $GLOBALS['cfg']['SetHttpHostTitle']) . ' >> ';
46 if (!empty($GLOBALS['cfg']['Server']) && isset($GLOBALS['cfg']['Server']['host'])) {
47 $title.=str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['host']);
49 if (isset($GLOBALS['db'])) {
50 $title .= ' >> ' . str_replace('\'', '\\\'', $GLOBALS['db']);
52 if (isset($GLOBALS['table'])) {
53 $title .= (empty($title) ?
'' : ' ') . ' >> ' . str_replace('\'', '\\\'', $GLOBALS['table']);
55 $title .= ' | phpMyAdmin ' . PMA_VERSION
;
57 <script type
="text/javascript" language
="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 $title; ?>';
65 document
.write('<style type="text/css">');
66 document
.write('img.lightbulb { cursor: pointer; }');
67 document
.write('<\/style>');
70 // Add some javascript instructions if required
71 if (isset($js_to_run) && $js_to_run == 'functions.js') {
74 // js form validation stuff
75 var errorMsg0
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strFormEmpty
']); ?>';
76 var errorMsg1
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strNotNumber
']); ?>';
77 var noDropDbMsg
= '<?php echo((!$GLOBALS['cfg
']['AllowUserDropDatabase
']) ? str_replace('\'
', '\\\'
', $GLOBALS['strNoDropDatabases
']) : ''); ?>';
78 var confirmMsg
= '<?php echo(($GLOBALS['cfg
']['Confirm
']) ? str_replace('\'
', '\\\'
', $GLOBALS['strDoYouReally
']) : ''); ?>';
79 var confirmMsgDropDB
= '<?php echo(($GLOBALS['cfg
']['Confirm
']) ? str_replace('\'
', '\\\'
', $GLOBALS['strDropDatabaseStrongWarning
']) : ''); ?>';
82 <script src
="libraries/functions.js" type
="text/javascript" language
="javascript"></script
>
84 } else if (isset($js_to_run) && $js_to_run == 'user_password.js') {
87 // js form validation stuff
88 var jsHostEmpty
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strHostEmpty
']); ?>';
89 var jsUserEmpty
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strUserEmpty
']); ?>';
90 var jsPasswordEmpty
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strPasswordEmpty
']); ?>';
91 var jsPasswordNotSame
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strPasswordNotSame
']); ?>';
94 <script src
="libraries/user_password.js" type
="text/javascript" language
="javascript"></script
>
96 } else if (isset($js_to_run) && $js_to_run == 'server_privileges.js') {
99 // js form validation stuff
100 var jsHostEmpty
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strHostEmpty
']); ?>';
101 var jsUserEmpty
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strUserEmpty
']); ?>';
102 var jsPasswordEmpty
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strPasswordEmpty
']); ?>';
103 var jsPasswordNotSame
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strPasswordNotSame
']); ?>';
106 <script src
="libraries/server_privileges.js" type
="text/javascript" language
="javascript"></script
>
108 } else if (isset($js_to_run) && $js_to_run == 'indexes.js') {
111 // js index validation stuff
112 var errorMsg0
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strFormEmpty
']); ?>';
113 var errorMsg1
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strNotNumber
']); ?>';
116 <script src
="libraries/indexes.js" type
="text/javascript" language
="javascript"></script
>
118 } else if (isset($js_to_run) && $js_to_run == 'tbl_change.js') {
123 <script src
="libraries/tbl_change.js" type
="text/javascript" language
="javascript"></script
>
134 // Reloads the navigation frame via JavaScript if required
135 PMA_reloadNavigation();
137 <meta name
="OBGZip" content
="<?php echo ($cfg['OBGzip'] ? 'true' : 'false'); ?>" />
142 if ($GLOBALS['cfg']['RightBgImage'] != '') {
143 $bkg_img = ' background="' . $GLOBALS['cfg']['RightBgImage'] . '"';
148 <body bgcolor
="<?php echo $GLOBALS['cfg']['RightBgColor'] . '"' . $bkg_img; ?>>
149 <div id="TooltipContainer" name="TooltipContainer" onmouseover="holdTooltip();" onmouseout="swapTooltip('default');"></div>
151 include('./config
.header
.inc
.php
');
153 if (!defined('PMA_DISPLAY_HEADING
')) {
154 define('PMA_DISPLAY_HEADING
', 1);
158 * Display heading if needed. Design can be set in css file.
161 if (PMA_DISPLAY_HEADING) {
162 echo '<table border
="0" cellpadding
="0" cellspacing
="0" id
="serverinfo">' . "\n"
164 $header_url_qry = '?
' . PMA_generate_common_url();
165 $server_info = (!empty($cfg['Server
']['verbose
'])
166 ? $cfg['Server
']['verbose
']
167 : $server_info = $cfg['Server
']['host
'] . (empty($cfg['Server
']['port
'])
169 : ':' . $cfg['Server
']['port
']
173 . '<td
class="serverinfo">' . $GLOBALS['strServer
'] . ': 
;'
174 . '<a href
="' . $GLOBALS['cfg']['DefaultTabServer'] . '?' . PMA_generate_common_url() . '">';
175 if ($GLOBALS['cfg
']['MainPageIconic
']) {
176 echo '<img src
="' . $GLOBALS['pmaThemeImage'] . 's_host.png" width
="16" height
="16" border
="0" alt
="' . htmlspecialchars($server_info) . '" />';
178 echo htmlspecialchars($server_info) . '</a
>' . "\n"
181 if (!empty($GLOBALS['db
'])) {
183 . '<td
class="serverinfo"><div
></div
></td
>' . "\n" . ' '
184 . '<td
class="serverinfo">' . $GLOBALS['strDatabase
'] . ': 
;'
185 . '<a href
="' . $GLOBALS['cfg']['DefaultTabDatabase'] . '?' . PMA_generate_common_url($GLOBALS['db']) . '">';
186 if ($GLOBALS['cfg
']['MainPageIconic
']) {
187 echo '<img src
="' . $GLOBALS['pmaThemeImage'] . 's_db.png" width
="16" height
="16" border
="0" alt
="' . htmlspecialchars($GLOBALS['db']) . '" />';
189 echo htmlspecialchars($GLOBALS['db
']) . '</a
>' . "\n"
192 if (!empty($GLOBALS['table
'])) {
193 if (PMA_MYSQL_INT_VERSION >= 50000) {
194 require_once('./tbl_properties_table_info
.php
');
196 $tbl_is_view = FALSE;
199 . '<td
class="serverinfo"><div
></div
></td
>' . "\n" . ' '
200 . '<td
class="serverinfo">' . (isset($GLOBALS['tbl_is_view
']) && $GLOBALS['tbl_is_view
'] ? $GLOBALS['strView
'] : $GLOBALS['strTable
']) . ': 
;'
201 . '<a href
="' . $GLOBALS['cfg']['DefaultTabTable'] . '?' . PMA_generate_common_url($GLOBALS['db'], $GLOBALS['table']) . '">';
202 if ($GLOBALS['cfg
']['MainPageIconic
']) {
203 echo '<img src
="' . $GLOBALS['pmaThemeImage'] . (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ? 'b_views' : 's_tbl') . '.png" width
="16" height
="16" border
="0" alt
="' . htmlspecialchars($GLOBALS['table']) . '" />';
205 echo htmlspecialchars($GLOBALS['table
']) . '</a
>' . "\n"
209 echo ' </tr
>' . "\n" . '</table
>';
212 * Sets a variable to remember headers have been sent
214 $GLOBALS['is_header_sent
'] = TRUE;