2 /* vim: set expandtab sw=4 ts=4 sts=4: */
11 * Gets core libraries and defines some variables
13 require_once 'libraries/common.inc.php';
15 // free the session file, for the other frames to be loaded
16 session_write_close();
19 if (empty($HTTP_HOST)) {
21 if (PMA_getenv('HTTP_HOST')) {
22 $HTTP_HOST = PMA_getenv('HTTP_HOST');
27 // purge querywindow history
28 $cfgRelation = PMA_getRelationsParam();
29 if ($GLOBALS['cfg']['QueryHistoryDB'] && $cfgRelation['historywork']) {
30 PMA_purgeHistory($GLOBALS['cfg']['Server']['user']);
36 * pass variables to child pages
38 $drops = array('lang', 'server', 'collation_connection',
41 foreach ($drops as $each_drop) {
42 if (array_key_exists($each_drop, $_GET)) {
43 unset($_GET[$each_drop]);
46 unset($drops, $each_drop);
48 if (! strlen($GLOBALS['db'])) {
49 $main_target = $GLOBALS['cfg']['DefaultTabServer'];
50 } elseif (! strlen($GLOBALS['table'])) {
51 $_GET['db'] = $GLOBALS['db'];
52 $main_target = $GLOBALS['cfg']['DefaultTabDatabase'];
54 $_GET['db'] = $GLOBALS['db'];
55 $_GET['table'] = $GLOBALS['table'];
56 $main_target = ! empty($GLOBALS['goto']) ?
$GLOBALS['goto'] : $GLOBALS['cfg']['DefaultTabTable'];
59 $url_query = PMA_generate_common_url($_GET);
61 if (! empty($_REQUEST['target']) && is_string($_REQUEST['target']) && in_array($_REQUEST['target'], $goto_whitelist)) {
62 $main_target = $_REQUEST['target'];
65 $main_target .= $url_query;
67 $lang_iso_code = $GLOBALS['available_languages'][$GLOBALS['lang']][1];
71 require 'libraries/header_http.inc.php';
73 <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
74 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
75 <html xmlns
="http://www.w3.org/1999/xhtml"
76 xml
:lang
="<?php echo $lang_iso_code; ?>"
77 lang
="<?php echo $lang_iso_code; ?>"
78 dir
="<?php echo $GLOBALS['text_dir']; ?>">
80 <link rel
="icon" href
="favicon.ico" type
="image/x-icon" />
81 <link rel
="shortcut icon" href
="favicon.ico" type
="image/x-icon" />
82 <title
>phpMyAdmin
<?php
echo PMA_VERSION
; ?
> -
83 <?php
echo htmlspecialchars($HTTP_HOST); ?
></title
>
84 <meta http
-equiv
="Content-Type" content
="text/html; charset=utf-8" />
85 <meta name
="robots" content
="noindex,nofollow" />
86 <script type
="text/javascript">
88 // definitions used in common.js
89 var common_query
= '<?php echo PMA_escapeJsString(PMA_generate_common_url('', '', '&'));?>';
90 var opendb_url
= '<?php echo PMA_escapeJsString($GLOBALS['cfg
']['DefaultTabDatabase
']); ?>';
91 var safari_browser
= <?php
echo PMA_USR_BROWSER_AGENT
== 'SAFARI' ?
'true' : 'false' ?
>;
92 var querywindow_height
= <?php
echo PMA_escapeJsString($GLOBALS['cfg']['QueryWindowHeight']); ?
>;
93 var querywindow_width
= <?php
echo PMA_escapeJsString($GLOBALS['cfg']['QueryWindowWidth']); ?
>;
94 var collation_connection
= '<?php echo PMA_escapeJsString($GLOBALS['collation_connection
']); ?>';
95 var lang
= '<?php echo PMA_escapeJsString($GLOBALS['lang
']); ?>';
96 var server
= '<?php echo PMA_escapeJsString($GLOBALS['server
']); ?>';
97 var table
= '<?php echo PMA_escapeJsString($GLOBALS['table
']); ?>';
98 var db
= '<?php echo PMA_escapeJsString($GLOBALS['db
']); ?>';
99 var token
= '<?php echo PMA_escapeJsString($_SESSION[' PMA_token
']); ?>';
100 var text_dir
= '<?php echo PMA_escapeJsString($GLOBALS['text_dir
']); ?>';
101 var pma_absolute_uri
= '<?php echo PMA_escapeJsString($GLOBALS['cfg
']['PmaAbsoluteUri
']); ?>';
102 var pma_text_default_tab
= '<?php echo PMA_escapeJsString(PMA_getTitleForTarget($GLOBALS['cfg
']['DefaultTabTable
'])); ?>';
103 var pma_text_left_default_tab
= '<?php echo PMA_escapeJsString(PMA_getTitleForTarget($GLOBALS['cfg
']['LeftDefaultTabTable
'])); ?>';
105 // for content and navigation frames
107 var frame_content
= 0;
108 var frame_navigation
= 0;
109 function getFrames() {
110 <?php
if ($GLOBALS['text_dir'] === 'ltr') { ?
>
111 frame_content
= window
.frames
[1];
112 frame_navigation
= window
.frames
[0];
114 frame_content
= window
.frames
[0];
115 frame_navigation
= window
.frames
[1];
119 var onLoadHandler
= window
.onload
;
120 window
.onload
= function() {
121 if (onloadCnt
== 0) {
122 if (typeof(onLoadHandler
) == "function") {
125 if (typeof(getFrames
) != 'undefined' && typeof(getFrames
) == 'function') {
134 echo PMA_includeJS('jquery/jquery-1.6.2.js');
135 echo PMA_includeJS('update-location.js');
136 echo PMA_includeJS('common.js');
139 <frameset cols
="<?php
140 if ($GLOBALS['text_dir'] === 'rtl') {
143 echo $GLOBALS['cfg']['NaviWidth'];
144 if ($GLOBALS['text_dir'] === 'ltr') {
147 ?>" rows
="*" id
="mainFrameset">
148 <?php
if ($GLOBALS['text_dir'] === 'ltr') { ?
>
149 <frame frameborder
="0" id
="frame_navigation"
150 src
="navigation.php<?php echo $url_query; ?>"
151 name
="frame_navigation" />
153 <frame frameborder
="0" id
="frame_content"
154 src
="<?php echo $main_target; ?>"
155 name
="frame_content" />
156 <?php
if ($GLOBALS['text_dir'] === 'rtl') { ?
>
157 <frame frameborder
="0" id
="frame_navigation"
158 src
="navigation.php<?php echo $url_query; ?>"
159 name
="frame_navigation" />
163 <p
><?php
echo __('phpMyAdmin is more friendly with a <b>frames-capable</b> browser.'); ?
></p
>