Add missing 'server' argument to PMA_reloadRecentTable
[phpmyadmin.git] / index.php
blob36a611878e5e03c2eaec9408b217daf1ba6a760e
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * forms frameset
6 * @uses $GLOBALS['cfg']['QueryHistoryDB']
7 * @uses $GLOBALS['cfg']['Server']['user']
8 * @uses $GLOBALS['cfg']['DefaultTabServer'] as src for the mainframe
9 * @uses $GLOBALS['cfg']['DefaultTabDatabase'] as src for the mainframe
10 * @uses $GLOBALS['cfg']['NaviWidth'] for navi frame width
11 * @uses $GLOBALS['collation_connection'] from $_REQUEST (grab_globals.lib.php)
12 * or common.inc.php
13 * @uses $GLOBALS['available_languages'] from common.inc.php (select_lang.lib.php)
14 * @uses $GLOBALS['db']
15 * @uses $GLOBALS['lang']
16 * @uses $GLOBALS['text_dir']
17 * @uses $_ENV['HTTP_HOST']
18 * @uses PMA_getRelationsParam()
19 * @uses PMA_purgeHistory()
20 * @uses PMA_generate_common_url()
21 * @uses PMA_VERSION
22 * @uses session_write_close()
23 * @uses time()
24 * @uses PMA_getenv()
25 * @uses header() to send charset
26 * @package phpMyAdmin
29 /**
30 * Gets core libraries and defines some variables
32 require_once './libraries/common.inc.php';
34 // free the session file, for the other frames to be loaded
35 session_write_close();
37 // Gets the host name
38 if (empty($HTTP_HOST)) {
39 if (PMA_getenv('HTTP_HOST')) {
40 $HTTP_HOST = PMA_getenv('HTTP_HOST');
41 } else {
42 $HTTP_HOST = '';
47 // purge querywindow history
48 $cfgRelation = PMA_getRelationsParam();
49 if ($GLOBALS['cfg']['QueryHistoryDB'] && $cfgRelation['historywork']) {
50 PMA_purgeHistory($GLOBALS['cfg']['Server']['user']);
52 unset($cfgRelation);
55 /**
56 * pass variables to child pages
58 $drops = array('lang', 'server', 'collation_connection',
59 'db', 'table');
61 foreach ($drops as $each_drop) {
62 if (array_key_exists($each_drop, $_GET)) {
63 unset($_GET[$each_drop]);
66 unset($drops, $each_drop);
68 if (! strlen($GLOBALS['db'])) {
69 $main_target = $GLOBALS['cfg']['DefaultTabServer'];
70 } elseif (! strlen($GLOBALS['table'])) {
71 $_GET['db'] = $GLOBALS['db'];
72 $main_target = $GLOBALS['cfg']['DefaultTabDatabase'];
73 } else {
74 $_GET['db'] = $GLOBALS['db'];
75 $_GET['table'] = $GLOBALS['table'];
76 $main_target = $GLOBALS['cfg']['DefaultTabTable'];
79 $url_query = PMA_generate_common_url($_GET);
81 if (isset($GLOBALS['target']) && is_string($GLOBALS['target']) && !empty($GLOBALS['target']) && in_array($GLOBALS['target'], $goto_whitelist)) {
82 $main_target = $GLOBALS['target'];
85 $main_target .= $url_query;
87 $lang_iso_code = $GLOBALS['available_languages'][$GLOBALS['lang']][1];
90 // start output
91 include ('./libraries/header_http.inc.php');
93 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
94 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
95 <html xmlns="http://www.w3.org/1999/xhtml"
96 xml:lang="<?php echo $lang_iso_code; ?>"
97 lang="<?php echo $lang_iso_code; ?>"
98 dir="<?php echo $GLOBALS['text_dir']; ?>">
99 <head>
100 <link rel="icon" href="./favicon.ico" type="image/x-icon" />
101 <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
102 <title>phpMyAdmin <?php echo PMA_VERSION; ?> -
103 <?php echo htmlspecialchars($HTTP_HOST); ?></title>
104 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
105 <meta name="robots" content="noindex,nofollow" />
106 <script type="text/javascript">
107 // <![CDATA[
108 // definitions used in common.js
109 var common_query = '<?php echo PMA_escapeJsString(PMA_generate_common_url('', '', '&'));?>';
110 var opendb_url = '<?php echo PMA_escapeJsString($GLOBALS['cfg']['DefaultTabDatabase']); ?>';
111 var safari_browser = <?php echo PMA_USR_BROWSER_AGENT == 'SAFARI' ? 'true' : 'false' ?>;
112 var querywindow_height = <?php echo PMA_escapeJsString($GLOBALS['cfg']['QueryWindowHeight']); ?>;
113 var querywindow_width = <?php echo PMA_escapeJsString($GLOBALS['cfg']['QueryWindowWidth']); ?>;
114 var collation_connection = '<?php echo PMA_escapeJsString($GLOBALS['collation_connection']); ?>';
115 var lang = '<?php echo PMA_escapeJsString($GLOBALS['lang']); ?>';
116 var server = '<?php echo PMA_escapeJsString($GLOBALS['server']); ?>';
117 var table = '<?php echo PMA_escapeJsString($GLOBALS['table']); ?>';
118 var db = '<?php echo PMA_escapeJsString($GLOBALS['db']); ?>';
119 var token = '<?php echo PMA_escapeJsString($_SESSION[' PMA_token ']); ?>';
120 var text_dir = '<?php echo PMA_escapeJsString($GLOBALS['text_dir']); ?>';
121 var pma_absolute_uri = '<?php echo PMA_escapeJsString($GLOBALS['cfg']['PmaAbsoluteUri']); ?>';
122 var pma_text_default_tab = '<?php echo PMA_escapeJsString(PMA_getTitleForTarget($GLOBALS['cfg']['DefaultTabTable'])); ?>';
123 var pma_text_left_default_tab = '<?php echo PMA_escapeJsString(PMA_getTitleForTarget($GLOBALS['cfg']['LeftDefaultTabTable'])); ?>';
125 // for content and navigation frames
127 var frame_content = 0;
128 var frame_navigation = 0;
129 function getFrames() {
130 <?php if ($GLOBALS['text_dir'] === 'ltr') { ?>
131 frame_content = window.frames[1];
132 frame_navigation = window.frames[0];
133 <?php } else { ?>
134 frame_content = window.frames[0];
135 frame_navigation = window.frames[1];
136 <?php } ?>
138 var onloadCnt = 0;
139 var onLoadHandler = window.onload;
140 window.onload = function() {
141 if (onloadCnt == 0) {
142 if (typeof(onLoadHandler) == "function") {
143 onLoadHandler();
145 if (typeof(getFrames) != 'undefined' && typeof(getFrames) == 'function') {
146 getFrames();
148 onloadCnt++;
151 // ]]>
152 </script>
153 <?php
154 echo PMA_includeJS('jquery/jquery-1.6.1.js');
155 echo PMA_includeJS('update-location.js');
156 echo PMA_includeJS('common.js');
158 </head>
159 <frameset cols="<?php
160 if ($GLOBALS['text_dir'] === 'rtl') {
161 echo '*,';
163 echo $GLOBALS['cfg']['NaviWidth'];
164 if ($GLOBALS['text_dir'] === 'ltr') {
165 echo ',*';
167 ?>" rows="*" id="mainFrameset">
168 <?php if ($GLOBALS['text_dir'] === 'ltr') { ?>
169 <frame frameborder="0" id="frame_navigation"
170 src="navigation.php<?php echo $url_query; ?>"
171 name="frame_navigation" />
172 <?php } ?>
173 <frame frameborder="0" id="frame_content"
174 src="<?php echo $main_target; ?>"
175 name="frame_content" />
176 <?php if ($GLOBALS['text_dir'] === 'rtl') { ?>
177 <frame frameborder="0" id="frame_navigation"
178 src="navigation.php<?php echo $url_query; ?>"
179 name="frame_navigation" />
180 <?php } ?>
181 <noframes>
182 <body>
183 <p><?php echo __('phpMyAdmin is more friendly with a <b>frames-capable</b> browser.'); ?></p>
184 </body>
185 </noframes>
186 </frameset>
187 </html>