update
[phpmyadmin/crack.git] / header.inc.php3
blob26776446eb3cc382728a19bcb9309e875d77fa36
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
5 /**
6 * Gets a core script and starts output buffering work
7 */
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');
28 $title = '';
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">
42 <!--
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; ?>';
48 <?php
49 // Add some javascript instructions if required
50 if (isset($js_to_run) && $js_to_run == 'functions.js') {
51 echo "\n";
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']) : ''); ?>';
59 //-->
60 </script>
61 <script src="libraries/functions.js" type="text/javascript" language="javascript"></script>
62 <?php
63 } else if (isset($js_to_run) && $js_to_run == 'user_password.js') {
64 echo "\n";
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']); ?>';
71 //-->
72 </script>
73 <script src="libraries/user_password.js" type="text/javascript" language="javascript"></script>
74 <?php
75 } else if (isset($js_to_run) && $js_to_run == 'server_privileges.js') {
76 echo "\n";
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']); ?>';
83 //-->
84 </script>
85 <script src="libraries/server_privileges.js" type="text/javascript" language="javascript"></script>
86 <?php
87 } else if (isset($js_to_run) && $js_to_run == 'indexes.js') {
88 echo "\n";
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']); ?>';
94 //-->
95 </script>
96 <script src="libraries/indexes.js" type="text/javascript" language="javascript"></script>
97 <?php
98 } else if (isset($js_to_run) && $js_to_run == 'tbl_change.js') {
99 echo "\n";
101 //-->
102 </script>
103 <script src="libraries/tbl_change.js" type="text/javascript" language="javascript"></script>
104 <?php
105 } else {
106 echo "\n";
108 //-->
109 </script>
110 <?php
112 echo "\n";
114 </head>
117 <?php
118 if ($GLOBALS['cfg']['RightBgImage'] != '') {
119 $bkg_img = ' background="' . $GLOBALS['cfg']['RightBgImage'] . '"';
120 } else {
121 $bkg_img = '';
124 <body bgcolor="<?php echo $GLOBALS['cfg']['RightBgColor'] . '"' . $bkg_img; ?>>
125 <?php
126 if (!defined('PMA_DISPLAY_HEADING')) {
127 define('PMA_DISPLAY_HEADING', 1);
129 if (PMA_DISPLAY_HEADING) {
130 $header_url_qry = '?' . PMA_generate_common_url();
131 echo '<h1>' . "\n";
132 $server_info = (!empty($cfg['Server']['verbose'])
133 ? $cfg['Server']['verbose']
134 : $server_info = $cfg['Server']['host'] . (empty($cfg['Server']['port'])
135 ? ''
136 : ':' . $cfg['Server']['port']
139 if (isset($GLOBALS['db'])) {
140 echo ' ' . $GLOBALS['strDatabase'] . ' <i><a class="h1" href="' . $GLOBALS['cfg']['DefaultTabDatabase'] . $header_url_qry . '&amp;db=' . urlencode($GLOBALS['db']) . '">' . htmlspecialchars($GLOBALS['db']) . '</a></i>' . "\n";
141 if (!empty($GLOBALS['table'])) {
142 echo ' - ' . $GLOBALS['strTable'] . ' <i><a class="h1" href="' . $GLOBALS['cfg']['DefaultTabTable'] . $header_url_qry . '&amp;db=' . urlencode($GLOBALS['db']) . '&amp;table=' . urlencode($GLOBALS['table']) . '">' . htmlspecialchars($GLOBALS['table']) . '</a></i>' . "\n";
144 echo ' ' . sprintf($GLOBALS['strRunning'], '<i><a class="h1" href="' . $GLOBALS['cfg']['DefaultTabServer'] . $header_url_qry . '">' . htmlspecialchars($server_info) . '</a></i>');
145 } else {
146 echo ' ' . sprintf($GLOBALS['strServer'], '<i><a class="h1" href="' . $GLOBALS['cfg']['DefaultTabServer'] . $header_url_qry . '">' . htmlspecialchars($server_info) . '</a></i>');
148 echo "\n" . '</h1>' . "\n";
150 echo "\n";
154 * Sets a variable to remember headers have been sent
156 $GLOBALS['is_header_sent'] = TRUE;