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']);
25 // Don't use cache (required for Opera)
26 $GLOBALS['now'] = gmdate('D, d M Y H:i:s') . ' GMT';
27 header('Expires: ' . $GLOBALS['now']); // rfc2616 - Section 14.21
28 header('Last-Modified: ' . $GLOBALS['now']);
29 header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
30 header('Pragma: no-cache'); // HTTP/1.0
31 // Define the charset to be used
32 header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
36 * Sends the beginning of the html page then returns to the calling script
38 // Gets the font sizes to use
40 // Defines the cell alignment values depending on text direction
41 if ($GLOBALS['text_dir'] == 'ltr') {
42 $GLOBALS['cell_align_left'] = 'left';
43 $GLOBALS['cell_align_right'] = 'right';
45 $GLOBALS['cell_align_left'] = 'right';
46 $GLOBALS['cell_align_right'] = 'left';
49 <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
50 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
51 <html xmlns
="http://www.w3.org/1999/xhtml" xml
:lang
="<?php echo $GLOBALS['available_languages'][$GLOBALS['lang']][2]; ?>" lang
="<?php echo $GLOBALS['available_languages'][$GLOBALS['lang']][2]; ?>" dir
="<?php echo $GLOBALS['text_dir']; ?>">
54 <title
>phpMyAdmin
</title
>
55 <meta http
-equiv
="Content-Type" content
="text/html; charset=<?php echo $GLOBALS['charset']; ?>" />
57 if (!empty($GLOBALS['cfg']['PmaAbsoluteUri'])) {
58 echo '<base href="' . $GLOBALS['cfg']['PmaAbsoluteUri'] . '" />' . "\n";
61 <style type
="text/css">
64 font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>;
65 font
-size
: <?php
echo $GLOBALS['font_size']; ?
>;
68 if ($GLOBALS['cfg']['RightBgImage'] == '') {
69 echo ' background-image: url(\'./images/vertical_line.png\');' . "\n"
70 . ' background-repeat: repeat-y;' . "\n";
72 echo ' background-image: url(\'' . $GLOBALS['cfg']['RightBgImage'] . '\');' . "\n";
73 } // end if... else...
75 background
-color
: <?php
echo $GLOBALS['cfg']['RightBgColor'] . "\n"; ?
>
77 pre
, tt
{font
-size
: <?php
echo $GLOBALS['font_size']; ?
>}
78 th
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; font
-size
: <?php
echo $GLOBALS['font_size']; ?
>; font
-weight
: bold
; color
: #000000; background-color: <?php echo $GLOBALS['cfg']['ThBgcolor']; ?>}
79 td
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; font
-size
: <?php
echo $GLOBALS['font_size']; ?
>}
80 form
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; font
-size
: <?php
echo $GLOBALS['font_size']; ?
>}
81 input
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; font
-size
: <?php
echo $GLOBALS['font_size']; ?
>}
82 input
.textfield
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; font
-size
: <?php
echo $GLOBALS['font_size']; ?
>; color
: #000000; background-color: #FFFFFF}
83 select
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; font
-size
: <?php
echo $GLOBALS['font_size']; ?
>; color
: #000000; background-color: #FFFFFF}
84 textarea
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; font
-size
: <?php
echo $GLOBALS['font_size']; ?
>; color
: #000000; background-color: #FFFFFF}
85 h1
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; font
-size
: <?php
echo $GLOBALS['font_biggest']; ?
>; font
-weight
: bold
}
86 h2
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; font
-size
: <?php
echo $GLOBALS['font_bigger']; ?
>; font
-weight
: bold
}
87 h3
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; font
-size
: <?php
echo $GLOBALS['font_size']; ?
>; font
-weight
: bold
}
88 a
:link
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; font
-size
: <?php
echo $GLOBALS['font_size']; ?
>; text
-decoration
: none
; color
: #0000FF}
89 a
:visited
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; font
-size
: <?php
echo $GLOBALS['font_size']; ?
>; text
-decoration
: none
; color
: #0000FF}
90 a
:hover
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; font
-size
: <?php
echo $GLOBALS['font_size']; ?
>; text
-decoration
: underline
; color
: #FF0000}
91 a
.nav
:link
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; color
: #000000}
92 a
.nav
:visited
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; color
: #000000}
93 a
.nav
:hover
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; color
: #FF0000}
94 a
.h1
:link
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; font
-size
: <?php
echo $GLOBALS['font_biggest']; ?
>; font
-weight
: bold
; color
: #000000}
95 a
.h1
:active
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; font
-size
: <?php
echo $GLOBALS['font_biggest']; ?
>; font
-weight
: bold
; color
: #000000}
96 a
.h1
:visited
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; font
-size
: <?php
echo $GLOBALS['font_biggest']; ?
>; font
-weight
: bold
; color
: #000000}
97 a
.h1
:hover
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; font
-size
: <?php
echo $GLOBALS['font_biggest']; ?
>; font
-weight
: bold
; color
: #FF0000}
98 a
.h2
:link
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; font
-size
: <?php
echo $GLOBALS['font_bigger']; ?
>; font
-weight
: bold
; color
: #000000}
99 a
.h2
:active
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; font
-size
: <?php
echo $GLOBALS['font_bigger']; ?
>; font
-weight
: bold
; color
: #000000}
100 a
.h2
:visited
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; font
-size
: <?php
echo $GLOBALS['font_bigger']; ?
>; font
-weight
: bold
; color
: #000000}
101 a
.h2
:hover
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; font
-size
: <?php
echo $GLOBALS['font_bigger']; ?
>; font
-weight
: bold
; color
: #FF0000}
102 a
.drop
:link
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; color
: #ff0000}
103 a
.drop
:visited
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; color
: #ff0000}
104 a
.drop
:hover
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; color
: #ffffff; background-color:#ff0000; text-decoration: none}
105 dfn
{font
-style
: normal
}
106 dfn
:hover
{font
-style
: normal
; cursor
: help
}
107 .nav
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; color
: #000000}
108 .warning
{font
-family
: <?php
echo $GLOBALS['right_font_family']; ?
>; font
-size
: <?php
echo $GLOBALS['font_size']; ?
>; font
-weight
: bold
; color
: #FF0000}
109 td
.topline
{font
-size
: 1px
}
111 border
-top
: 1px solid
#999;
112 border
-right
: 1px solid
#666;
113 border
-left
: 1px solid
#999;
116 -moz
-border
-radius
: 2px
;
122 border
-bottom
: 1px solid
#666;
125 .print{font
-family
:arial
;font
-size
:8pt
;}
127 .syntax
{font
-family
: sans
-serif
; font
-size
: <?php
echo $font_smaller; ?
>;}
131 .syntax_digit_integer
{}
132 .syntax_digit_float
{}
134 .syntax_alpha
{text
-transform
: lowercase
;}
135 .syntax_alpha_columnType
{text
-transform
: uppercase
;}
136 .syntax_alpha_columnAttrib
{text
-transform
: uppercase
;}
137 .syntax_alpha_reservedWord
{text
-transform
: uppercase
; font
-weight
: bold
;}
138 .syntax_alpha_functionName
{text
-transform
: uppercase
;}
139 .syntax_alpha_identifier
{}
140 .syntax_alpha_variable
{}
142 .syntax_quote_backtick
{}
144 echo PMA_SQP_buildCssData();
151 if (isset($GLOBALS['db'])) {
152 $title .= str_replace('\'', '\\\'', $GLOBALS['db']);
154 if (isset($GLOBALS['table'])) {
155 $title .= (empty($title) ?
'' : '.') . str_replace('\'', '\\\'', $GLOBALS['table']);
157 if (!empty($GLOBALS['cfg']['Server']) && isset($GLOBALS['cfg']['Server']['host'])) {
158 $title .= (empty($title) ?
'phpMyAdmin ' : ' ')
159 . sprintf($GLOBALS['strRunning'], (empty($GLOBALS['cfg']['Server']['verbose']) ?
str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['host']) : str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['verbose'])));
161 $title .= (empty($title) ?
'' : ' - ') . 'phpMyAdmin ' . PMA_VERSION
;
163 <script type
="text/javascript" language
="javascript">
165 // Updates the title of the frameset if possible (ns4 does not allow this)
166 if (typeof(parent
.document
) != 'undefined' && typeof(parent
.document
) != 'unknown'
167 && typeof(parent
.document
.title
) == 'string') {
168 parent
.document
.title
= '<?php echo $title; ?>';
171 // Add some javascript instructions if required
172 if (isset($js_to_run) && $js_to_run == 'functions.js') {
175 // js form validation stuff
176 var errorMsg0
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strFormEmpty
']); ?>';
177 var errorMsg1
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strNotNumber
']); ?>';
178 var errorMsg2
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strNotValidNumber
']); ?>';
179 var noDropDbMsg
= '<?php echo((!$GLOBALS['cfg
']['AllowUserDropDatabase
']) ? str_replace('\'
', '\\\'
', $GLOBALS['strNoDropDatabases
']) : ''); ?>';
180 var confirmMsg
= '<?php echo(($GLOBALS['cfg
']['Confirm
']) ? str_replace('\'
', '\\\'
', $GLOBALS['strDoYouReally
']) : ''); ?>';
183 <script src
="libraries/functions.js" type
="text/javascript" language
="javascript"></script
>
185 } else if (isset($js_to_run) && $js_to_run == 'user_details.js') {
188 // js form validation stuff
189 var jsHostEmpty
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strHostEmpty
']); ?>';
190 var jsUserEmpty
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strUserEmpty
']); ?>';
191 var jsPasswordEmpty
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strPasswordEmpty
']); ?>';
192 var jsPasswordNotSame
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strPasswordNotSame
']); ?>';
195 <script src
="libraries/user_details.js" type
="text/javascript" language
="javascript"></script
>
197 } else if (isset($js_to_run) && $js_to_run == 'server_privileges.js') {
200 // js form validation stuff
201 var jsHostEmpty
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strHostEmpty
']); ?>';
202 var jsUserEmpty
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strUserEmpty
']); ?>';
203 var jsPasswordEmpty
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strPasswordEmpty
']); ?>';
204 var jsPasswordNotSame
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strPasswordNotSame
']); ?>';
207 <script src
="libraries/server_privileges.js" type
="text/javascript" language
="javascript"></script
>
209 } else if (isset($js_to_run) && $js_to_run == 'indexes.js') {
212 // js index validation stuff
213 var errorMsg0
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strFormEmpty
']); ?>';
214 var errorMsg1
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strNotNumber
']); ?>';
215 var errorMsg2
= '<?php echo str_replace('\'
', '\\\'
', $GLOBALS['strNotValidNumber
']); ?>';
218 <script src
="libraries/indexes.js" type
="text/javascript" language
="javascript"></script
>
220 } else if (isset($js_to_run) && $js_to_run == 'tbl_change.js') {
225 <script src
="libraries/tbl_change.js" type
="text/javascript" language
="javascript"></script
>
236 // If query window is wanted and open, update with latest selected db/table.
237 if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
241 if ($cfg['QueryFrameDebug']) {
243 document
.writeln("Updating query window. DB: <?php echo (isset($db) ? $db : 'FALSE'); ?>, Table: <?php echo (isset($table) ? $table : 'FALSE'); ?><br>");
244 document
.writeln("Window: " + top
.frames
.queryframe
.querywindow
.location +
"<br>");
249 if (top
.frames
.queryframe
) {
250 <?php
echo (isset($db) ?
'top.frames.queryframe.document.queryframeform.db.value = "' . htmlspecialchars($db) . '";' : ''); ?
>
251 <?php
echo (isset($table) ?
'top.frames.queryframe.document.queryframeform.table.value = "' . htmlspecialchars($table) . '";' : ''); ?
>
254 function reload_querywindow () {
255 if (top
.frames
.queryframe
&& !top
.frames
.queryframe
.querywindow
.closed
&& top
.frames
.queryframe
.querywindow
.location
) {
256 <?php
echo ($cfg['QueryFrameDebug'] ?
'document.writeln("<a href=\'#\' onClick=\'top.frames.queryframe.querywindow.focus(); return false;\'>Query Window</a> can be updated.<br>");' : ''); ?
>
258 top
.frames
.queryframe
.querywindow
.document
.querywindow
.db
.value
= "<?php echo (isset($db) ? htmlspecialchars($db) : '') ?>";
259 top
.frames
.queryframe
.querywindow
.document
.querywindow
.query_history_latest_db
.value
= "<?php echo (isset($db) ? htmlspecialchars($db) : '') ?>";
260 top
.frames
.queryframe
.querywindow
.document
.querywindow
.table
.value
= "<?php echo (isset($table) ? htmlspecialchars($table) : '') ?>";
261 top
.frames
.queryframe
.querywindow
.document
.querywindow
.query_history_latest_table
.value
= "<?php echo (isset($table) ? htmlspecialchars($table) : '') ?>";
263 <?php
echo (isset($sql_query) ?
'top.frames.queryframe.querywindow.document.querywindow.query_history_latest.value = "' . urlencode($sql_query) . '";' : ''); ?
>
265 <?php
echo ($cfg['QueryFrameDebug'] ?
'alert(\'Querywindow submits. Last chance to check variables.\');' : ''); ?
>
266 top
.frames
.queryframe
.querywindow
.document
.querywindow
.submit();
270 function focus_querywindow() {
271 if (top
.frames
.queryframe
.querywindow
&& !top
.frames
.queryframe
.querywindow
.closed
&& top
.frames
.queryframe
.querywindow
.location
) {
272 top
.frames
.queryframe
.querywindow
.focus();
274 top
.frames
.queryframe
.querywindow
=window
.open('querywindow.php3?<?php echo PMA_generate_common_url('', ''); ?>&db=<?php echo (isset($db) ? htmlspecialchars($db) : ''); ?>&table=<?php echo (isset($table) ? htmlspecialchars($table) : ''); ?>', 'js_querywindow','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=yes,resizable=yes,width=<?php echo $cfg['QueryWindowWidth
']; ?>,height=<?php echo $cfg['QueryWindowHeight
']; ?>');
276 if (!top
.frames
.queryframe
.querywindow
.opener
) {
277 top
.frames
.queryframe
.querywindow
.opener
= top
.frames
.queryframe
;
280 reload_querywindow();
284 reload_querywindow();
296 if ($GLOBALS['cfg']['RightBgImage'] != '') {
297 $bkg_img = ' background="' . $GLOBALS['cfg']['RightBgImage'] . '"';
302 <body bgcolor
="<?php echo $GLOBALS['cfg']['RightBgColor'] . '"' . $bkg_img; ?>>
304 if (!defined('PMA_DISPLAY_HEADING
')) {
305 define('PMA_DISPLAY_HEADING
', 1);
307 if (PMA_DISPLAY_HEADING) {
308 $header_url_qry = '?
' . PMA_generate_common_url();
310 $server_info = (!empty($cfg['Server
']['verbose
'])
311 ? $cfg['Server
']['verbose
']
312 : $server_info = $cfg['Server
']['host
'] . (empty($cfg['Server
']['port
'])
314 : ':' . $cfg['Server
']['port
']
317 if (isset($GLOBALS['db
'])) {
318 echo ' ' . $GLOBALS['strDatabase
'] . ' <i
><a
class="h1" href
="' . $GLOBALS['cfg']['DefaultTabDatabase'] . $header_url_qry . '&db=' . urlencode($GLOBALS['db']) . '">' . htmlspecialchars($GLOBALS['db
']) . '</a
></i
>' . "\n";
319 if (!empty($GLOBALS['table
'])) {
320 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";
322 echo ' ' . sprintf($GLOBALS['strRunning
'], '<i
><a
class="h1" href
="' . $GLOBALS['cfg']['DefaultTabServer'] . $header_url_qry . '">' . htmlspecialchars($server_info) . '</a
></i
>');
324 echo ' ' . sprintf($GLOBALS['strServer
'], '<i
><a
class="h1" href
="' . $GLOBALS['cfg']['DefaultTabServer'] . $header_url_qry . '">' . htmlspecialchars($server_info) . '</a
></i
>');
326 echo "\n" . '</h1
>' . "\n";
332 * Sets a variable to remember headers have been sent
334 $GLOBALS['is_header_sent
'] = TRUE;