2 /* vim: set expandtab sw=4 ts=4 sts=4: */
7 * @uses $GLOBALS['strNoFrames']
8 * @uses $GLOBALS['cfg']['QueryHistoryDB']
9 * @uses $GLOBALS['cfg']['Server']['user']
10 * @uses $GLOBALS['cfg']['DefaultTabServer'] as src for the mainframe
11 * @uses $GLOBALS['cfg']['DefaultTabDatabase'] as src for the mainframe
12 * @uses $GLOBALS['cfg']['NaviWidth'] for navi frame width
13 * @uses $GLOBALS['collation_connection'] from $_REQUEST (grab_globals.lib.php)
15 * @uses $GLOBALS['available_languages'] from common.inc.php (select_lang.lib.php)
16 * @uses $GLOBALS['db']
17 * @uses $GLOBALS['charset']
18 * @uses $GLOBALS['lang']
19 * @uses $GLOBALS['text_dir']
20 * @uses $_ENV['HTTP_HOST']
21 * @uses PMA_getRelationsParam()
22 * @uses PMA_purgeHistory()
23 * @uses PMA_generate_common_url()
25 * @uses session_write_close()
28 * @uses header() to send charset
32 * Gets core libraries and defines some variables
34 require_once './libraries/common.inc.php';
37 * Includes the ThemeManager if it hasn't been included yet
39 require_once './libraries/relation.lib.php';
41 // free the session file, for the other frames to be loaded
42 session_write_close();
45 if (empty($HTTP_HOST)) {
46 if (PMA_getenv('HTTP_HOST')) {
47 $HTTP_HOST = PMA_getenv('HTTP_HOST');
54 // purge querywindow history
55 $cfgRelation = PMA_getRelationsParam();
56 if ($GLOBALS['cfg']['QueryHistoryDB'] && $cfgRelation['historywork']) {
57 PMA_purgeHistory($GLOBALS['cfg']['Server']['user']);
63 * pass variables to child pages
65 $drops = array('lang', 'server', 'convcharset', 'collation_connection',
68 foreach ($drops as $each_drop) {
69 if (! array_key_exists($each_drop, $_GET)) {
70 unset($_GET[$each_drop]);
73 unset($drops, $each_drop);
75 if (! strlen($GLOBALS['db'])) {
76 $main_target = $GLOBALS['cfg']['DefaultTabServer'];
77 } elseif (! strlen($GLOBALS['table'])) {
78 $_GET['db'] = $GLOBALS['db'];
79 $main_target = $GLOBALS['cfg']['DefaultTabDatabase'];
81 $_GET['db'] = $GLOBALS['db'];
82 $_GET['table'] = $GLOBALS['table'];
83 $main_target = $GLOBALS['cfg']['DefaultTabTable'];
86 $url_query = PMA_generate_common_url($_GET);
88 if (isset($GLOBALS['target']) && is_string($GLOBALS['target']) && !empty($GLOBALS['target']) && in_array($GLOBALS['target'], $goto_whitelist)) {
89 $main_target = $GLOBALS['target'];
92 $main_target .= $url_query;
94 $lang_iso_code = $GLOBALS['available_languages'][$GLOBALS['lang']][2];
98 header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
100 <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
101 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
102 <html xmlns
="http://www.w3.org/1999/xhtml"
103 xml
:lang
="<?php echo $lang_iso_code; ?>"
104 lang
="<?php echo $lang_iso_code; ?>"
105 dir
="<?php echo $GLOBALS['text_dir']; ?>">
107 <link rel
="icon" href
="./favicon.ico" type
="image/x-icon" />
108 <link rel
="shortcut icon" href
="./favicon.ico" type
="image/x-icon" />
109 <title
>phpMyAdmin
<?php
echo PMA_VERSION
; ?
> -
110 <?php
echo htmlspecialchars($HTTP_HOST); ?
></title
>
111 <meta http
-equiv
="Content-Type"
112 content
="text/html; charset=<?php echo $GLOBALS['charset']; ?>" />
113 <meta name
="robots" content
="noindex,nofollow" />
114 <script type
="text/javascript">
116 // definitions used in common.js
117 var common_query
= '<?php echo PMA_escapeJsString(PMA_generate_common_url('', '', '&'));?>';
118 var opendb_url
= '<?php echo PMA_escapeJsString($GLOBALS['cfg
']['DefaultTabDatabase
']); ?>';
119 var safari_browser
= <?php
echo PMA_USR_BROWSER_AGENT
== 'SAFARI' ?
'true' : 'false' ?
>;
120 var querywindow_height
= <?php
echo PMA_escapeJsString($GLOBALS['cfg']['QueryWindowHeight']); ?
>;
121 var querywindow_width
= <?php
echo PMA_escapeJsString($GLOBALS['cfg']['QueryWindowWidth']); ?
>;
122 var collation_connection
= '<?php echo PMA_escapeJsString($GLOBALS['collation_connection
']); ?>';
123 var lang
= '<?php echo PMA_escapeJsString($GLOBALS['lang
']); ?>';
124 var server
= '<?php echo PMA_escapeJsString($GLOBALS['server
']); ?>';
125 var table
= '<?php echo PMA_escapeJsString($GLOBALS['table
']); ?>';
126 var db
= '<?php echo PMA_escapeJsString($GLOBALS['db
']); ?>';
127 var token
= '<?php echo PMA_escapeJsString($_SESSION[' PMA_token
']); ?>';
128 var text_dir
= '<?php echo PMA_escapeJsString($GLOBALS['text_dir
']); ?>';
129 var pma_absolute_uri
= '<?php echo PMA_escapeJsString($GLOBALS['cfg
']['PmaAbsoluteUri
']); ?>';
130 var pma_text_default_tab
= '<?php echo PMA_escapeJsString(PMA_getTitleForTarget($GLOBALS['cfg
']['DefaultTabTable
'])); ?>';
131 var pma_text_left_default_tab
= '<?php echo PMA_escapeJsString(PMA_getTitleForTarget($GLOBALS['cfg
']['LeftDefaultTabTable
'])); ?>';
133 // for content and navigation frames
135 var frame_content
= 0;
136 var frame_navigation
= 0;
137 function getFrames() {
138 <?php
if ($GLOBALS['text_dir'] === 'ltr') { ?
>
139 frame_content
= window
.frames
[1];
140 frame_navigation
= window
.frames
[0];
142 frame_content
= window
.frames
[0];
143 frame_navigation
= window
.frames
[1];
147 var onLoadHandler
= window
.onload
;
148 window
.onload
= function() {
149 if (onloadCnt
== 0) {
150 if (typeof(onLoadHandler
) == "function") {
153 if (typeof(getFrames
) != 'undefined' && typeof(getFrames
) == 'function') {
161 <script src
="./js/common.js" type
="text/javascript"></script
>
163 <frameset cols
="<?php
164 if ($GLOBALS['text_dir'] === 'rtl') {
167 echo $GLOBALS['cfg']['NaviWidth'];
168 if ($GLOBALS['text_dir'] === 'ltr') {
171 ?>" rows
="*" id
="mainFrameset">
172 <?php
if ($GLOBALS['text_dir'] === 'ltr') { ?
>
173 <frame frameborder
="0" id
="frame_navigation"
174 src
="navigation.php<?php echo $url_query; ?>"
175 name
="frame_navigation" />
177 <frame frameborder
="0" id
="frame_content"
178 src
="<?php echo $main_target; ?>"
179 name
="frame_content" />
180 <?php
if ($GLOBALS['text_dir'] === 'rtl') { ?
>
181 <frame frameborder
="0" id
="frame_navigation"
182 src
="navigation.php<?php echo $url_query; ?>"
183 name
="frame_navigation" />
187 <p
><?php
echo $GLOBALS['strNoFrames']; ?
></p
>