3 // vim: expandtab sw=4 ts=4 sts=4:
6 * Gets a core script and starts output buffering work
8 if (!defined('PMA_COMMON_LIB_INCLUDED')) {
9 include('./libraries/common.lib.php3');
11 if (!defined('PMA_OB_LIB_INCLUDED')) {
12 include('./libraries/ob.lib.php3');
14 if ($GLOBALS['cfg']['OBGzip']) {
15 $GLOBALS['ob_mode'] = PMA_outBufferModeGet();
16 if ($GLOBALS['ob_mode']) {
17 PMA_outBufferPre($GLOBALS['ob_mode']);
21 // garvin: For re-usability, moved http-headers and stylesheets
22 // to a seperate file. It can now be included by header.inc.php3,
23 // queryframe.php3, querywindow.php3.
25 include('./libraries/header_http.inc.php3');
26 include('./libraries/header_meta_style.inc.php3');
29 if (isset($GLOBALS['db'])) {
30 $title .= str_replace('\'', '\\\'', $GLOBALS['db']);
32 if (isset($GLOBALS['table'])) {
33 $title .= (empty($title) ?
'' : '.') . str_replace('\'', '\\\'', $GLOBALS['table']);
35 if (!empty($GLOBALS['cfg']['Server']) && isset($GLOBALS['cfg']['Server']['host'])) {
36 $title .= (empty($title) ?
'phpMyAdmin ' : ' ')
37 . sprintf($GLOBALS['strRunning'], (empty($GLOBALS['cfg']['Server']['verbose']) ?
str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['host']) : str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['verbose'])));
39 $title .= (empty($title) ?
'' : ' - ') . 'phpMyAdmin ' . PMA_VERSION
;
41 <script type
="text/javascript" language
="javascript">
43 // Updates the title of the frameset if possible (ns4 does not allow this)
44 if (typeof(parent
.document
) != 'undefined' && typeof(parent
.document
) != 'unknown'
45 && typeof(parent
.document
.title
) == 'string') {
46 parent
.document
.title
= '<?php echo $title; ?>';
49 // Add some javascript instructions if required
50 if (isset($js_to_run) && $js_to_run == 'functions.js') {
53 // js form validation stuff
54 var errorMsg0
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strFormEmpty
']); ?>';
55 var errorMsg1
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strNotNumber
']); ?>';
56 var errorMsg2
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strNotValidNumber
']); ?>';
57 var noDropDbMsg
= '<?php echo((!$GLOBALS['cfg
']['AllowUserDropDatabase
']) ? str_replace('\'
', '\\\'
', $GLOBALS['strNoDropDatabases
']) : ''); ?>';
58 var confirmMsg
= '<?php echo(($GLOBALS['cfg
']['Confirm
']) ? str_replace('\'
', '\\\'
', $GLOBALS['strDoYouReally
']) : ''); ?>';
61 <script src
="libraries/functions.js" type
="text/javascript" language
="javascript"></script
>
63 } else if (isset($js_to_run) && $js_to_run == 'user_password.js') {
66 // js form validation stuff
67 var jsHostEmpty
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strHostEmpty
']); ?>';
68 var jsUserEmpty
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strUserEmpty
']); ?>';
69 var jsPasswordEmpty
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strPasswordEmpty
']); ?>';
70 var jsPasswordNotSame
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strPasswordNotSame
']); ?>';
73 <script src
="libraries/user_password.js" type
="text/javascript" language
="javascript"></script
>
75 } else if (isset($js_to_run) && $js_to_run == 'server_privileges.js') {
78 // js form validation stuff
79 var jsHostEmpty
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strHostEmpty
']); ?>';
80 var jsUserEmpty
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strUserEmpty
']); ?>';
81 var jsPasswordEmpty
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strPasswordEmpty
']); ?>';
82 var jsPasswordNotSame
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strPasswordNotSame
']); ?>';
85 <script src
="libraries/server_privileges.js" type
="text/javascript" language
="javascript"></script
>
87 } else if (isset($js_to_run) && $js_to_run == 'indexes.js') {
90 // js index validation stuff
91 var errorMsg0
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strFormEmpty
']); ?>';
92 var errorMsg1
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strNotNumber
']); ?>';
93 var errorMsg2
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strNotValidNumber
']); ?>';
96 <script src
="libraries/indexes.js" type
="text/javascript" language
="javascript"></script
>
98 } else if (isset($js_to_run) && $js_to_run == 'tbl_change.js') {
103 <script src
="libraries/tbl_change.js" type
="text/javascript" language
="javascript"></script
>
114 <meta name
="OBGZip" value
="<?php echo ($cfg['OBGzip'] ? 'true' : 'false'); ?>" />
119 if ($GLOBALS['cfg']['RightBgImage'] != '') {
120 $bkg_img = ' background="' . $GLOBALS['cfg']['RightBgImage'] . '"';
125 <body bgcolor
="<?php echo $GLOBALS['cfg']['RightBgColor'] . '"' . $bkg_img; ?>>
127 if (!defined('PMA_DISPLAY_HEADING
')) {
128 define('PMA_DISPLAY_HEADING
', 1);
130 if (PMA_DISPLAY_HEADING) {
131 $header_url_qry = '?
' . PMA_generate_common_url();
133 $server_info = (!empty($cfg['Server
']['verbose
'])
134 ? $cfg['Server
']['verbose
']
135 : $server_info = $cfg['Server
']['host
'] . (empty($cfg['Server
']['port
'])
137 : ':' . $cfg['Server
']['port
']
140 if (isset($GLOBALS['db
'])) {
141 echo ' ' . $GLOBALS['strDatabase
'] . ' <i
><a
class="h1" href
="' . $GLOBALS['cfg']['DefaultTabDatabase'] . $header_url_qry . '&db=' . urlencode($GLOBALS['db']) . '">' . htmlspecialchars($GLOBALS['db
']) . '</a
></i
>' . "\n";
142 if (!empty($GLOBALS['table
'])) {
143 echo ' - ' . $GLOBALS['strTable
'] . ' <i
><a
class="h1" href
="' . $GLOBALS['cfg']['DefaultTabTable'] . $header_url_qry . '&db=' . urlencode($GLOBALS['db']) . '&table=' . urlencode($GLOBALS['table']) . '">' . htmlspecialchars($GLOBALS['table
']) . '</a
></i
>' . "\n";
145 echo ' ' . sprintf($GLOBALS['strRunning
'], '<i
><a
class="h1" href
="' . $GLOBALS['cfg']['DefaultTabServer'] . $header_url_qry . '">' . htmlspecialchars($server_info) . '</a
></i
>');
147 echo ' ' . sprintf($GLOBALS['strServer
'], '<i
><a
class="h1" href
="' . $GLOBALS['cfg']['DefaultTabServer'] . $header_url_qry . '">' . htmlspecialchars($server_info) . '</a
></i
>');
149 echo "\n" . '</h1
>' . "\n";
155 * Sets a variable to remember headers have been sent
157 $GLOBALS['is_header_sent
'] = TRUE;