Translation update done using Pootle.
[phpmyadmin/crack.git] / index.php
blob3b16ec7d2eb741726b997c44d499f24e63c8aa65
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['charset']
16 * @uses $GLOBALS['lang']
17 * @uses $GLOBALS['text_dir']
18 * @uses $_ENV['HTTP_HOST']
19 * @uses PMA_getRelationsParam()
20 * @uses PMA_purgeHistory()
21 * @uses PMA_generate_common_url()
22 * @uses PMA_VERSION
23 * @uses session_write_close()
24 * @uses time()
25 * @uses PMA_getenv()
26 * @uses header() to send charset
27 * @package phpMyAdmin
30 /**
31 * Gets core libraries and defines some variables
33 require_once './libraries/common.inc.php';
35 /**
36 * Includes the ThemeManager if it hasn't been included yet
38 require_once './libraries/relation.lib.php';
40 // free the session file, for the other frames to be loaded
41 session_write_close();
43 // Gets the host name
44 if (empty($HTTP_HOST)) {
45 if (PMA_getenv('HTTP_HOST')) {
46 $HTTP_HOST = PMA_getenv('HTTP_HOST');
47 } else {
48 $HTTP_HOST = '';
53 // purge querywindow history
54 $cfgRelation = PMA_getRelationsParam();
55 if ($GLOBALS['cfg']['QueryHistoryDB'] && $cfgRelation['historywork']) {
56 PMA_purgeHistory($GLOBALS['cfg']['Server']['user']);
58 unset($cfgRelation);
61 /**
62 * pass variables to child pages
64 $drops = array('lang', 'server', 'collation_connection',
65 'db', 'table');
67 foreach ($drops as $each_drop) {
68 if (array_key_exists($each_drop, $_GET)) {
69 unset($_GET[$each_drop]);
72 unset($drops, $each_drop);
74 if (! strlen($GLOBALS['db'])) {
75 $main_target = $GLOBALS['cfg']['DefaultTabServer'];
76 } elseif (! strlen($GLOBALS['table'])) {
77 $_GET['db'] = $GLOBALS['db'];
78 $main_target = $GLOBALS['cfg']['DefaultTabDatabase'];
79 } else {
80 $_GET['db'] = $GLOBALS['db'];
81 $_GET['table'] = $GLOBALS['table'];
82 $main_target = $GLOBALS['cfg']['DefaultTabTable'];
85 $url_query = PMA_generate_common_url($_GET);
87 if (isset($GLOBALS['target']) && is_string($GLOBALS['target']) && !empty($GLOBALS['target']) && in_array($GLOBALS['target'], $goto_whitelist)) {
88 $main_target = $GLOBALS['target'];
91 $main_target .= $url_query;
93 $lang_iso_code = $GLOBALS['available_languages'][$GLOBALS['lang']][1];
96 // start output
97 header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
99 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
100 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
101 <html xmlns="http://www.w3.org/1999/xhtml"
102 xml:lang="<?php echo $lang_iso_code; ?>"
103 lang="<?php echo $lang_iso_code; ?>"
104 dir="<?php echo $GLOBALS['text_dir']; ?>">
105 <head>
106 <link rel="icon" href="./favicon.ico" type="image/x-icon" />
107 <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
108 <title>phpMyAdmin <?php echo PMA_VERSION; ?> -
109 <?php echo htmlspecialchars($HTTP_HOST); ?></title>
110 <meta http-equiv="Content-Type"
111 content="text/html; charset=<?php echo $GLOBALS['charset']; ?>" />
112 <meta name="robots" content="noindex,nofollow" />
113 <script type="text/javascript">
114 // <![CDATA[
115 // definitions used in common.js
116 var common_query = '<?php echo PMA_escapeJsString(PMA_generate_common_url('', '', '&'));?>';
117 var opendb_url = '<?php echo PMA_escapeJsString($GLOBALS['cfg']['DefaultTabDatabase']); ?>';
118 var safari_browser = <?php echo PMA_USR_BROWSER_AGENT == 'SAFARI' ? 'true' : 'false' ?>;
119 var querywindow_height = <?php echo PMA_escapeJsString($GLOBALS['cfg']['QueryWindowHeight']); ?>;
120 var querywindow_width = <?php echo PMA_escapeJsString($GLOBALS['cfg']['QueryWindowWidth']); ?>;
121 var collation_connection = '<?php echo PMA_escapeJsString($GLOBALS['collation_connection']); ?>';
122 var lang = '<?php echo PMA_escapeJsString($GLOBALS['lang']); ?>';
123 var server = '<?php echo PMA_escapeJsString($GLOBALS['server']); ?>';
124 var table = '<?php echo PMA_escapeJsString($GLOBALS['table']); ?>';
125 var db = '<?php echo PMA_escapeJsString($GLOBALS['db']); ?>';
126 var token = '<?php echo PMA_escapeJsString($_SESSION[' PMA_token ']); ?>';
127 var text_dir = '<?php echo PMA_escapeJsString($GLOBALS['text_dir']); ?>';
128 var pma_absolute_uri = '<?php echo PMA_escapeJsString($GLOBALS['cfg']['PmaAbsoluteUri']); ?>';
129 var pma_text_default_tab = '<?php echo PMA_escapeJsString(PMA_getTitleForTarget($GLOBALS['cfg']['DefaultTabTable'])); ?>';
130 var pma_text_left_default_tab = '<?php echo PMA_escapeJsString(PMA_getTitleForTarget($GLOBALS['cfg']['LeftDefaultTabTable'])); ?>';
132 // for content and navigation frames
134 var frame_content = 0;
135 var frame_navigation = 0;
136 function getFrames() {
137 <?php if ($GLOBALS['text_dir'] === 'ltr') { ?>
138 frame_content = window.frames[1];
139 frame_navigation = window.frames[0];
140 <?php } else { ?>
141 frame_content = window.frames[0];
142 frame_navigation = window.frames[1];
143 <?php } ?>
145 var onloadCnt = 0;
146 var onLoadHandler = window.onload;
147 window.onload = function() {
148 if (onloadCnt == 0) {
149 if (typeof(onLoadHandler) == "function") {
150 onLoadHandler();
152 if (typeof(getFrames) != 'undefined' && typeof(getFrames) == 'function') {
153 getFrames();
155 onloadCnt++;
158 // ]]>
159 </script>
160 <script src="./js/jquery/jquery-1.4.2.js" type="text/javascript"></script>
161 <script src="./js/update-location.js" type="text/javascript"></script>
162 <script src="./js/common.js" type="text/javascript"></script>
163 </head>
164 <frameset cols="<?php
165 if ($GLOBALS['text_dir'] === 'rtl') {
166 echo '*,';
168 echo $GLOBALS['cfg']['NaviWidth'];
169 if ($GLOBALS['text_dir'] === 'ltr') {
170 echo ',*';
172 ?>" rows="*" id="mainFrameset">
173 <?php if ($GLOBALS['text_dir'] === 'ltr') { ?>
174 <frame frameborder="0" id="frame_navigation"
175 src="navigation.php<?php echo $url_query; ?>"
176 name="frame_navigation" />
177 <?php } ?>
178 <frame frameborder="0" id="frame_content"
179 src="<?php echo $main_target; ?>"
180 name="frame_content" />
181 <?php if ($GLOBALS['text_dir'] === 'rtl') { ?>
182 <frame frameborder="0" id="frame_navigation"
183 src="navigation.php<?php echo $url_query; ?>"
184 name="frame_navigation" />
185 <?php } ?>
186 <noframes>
187 <body>
188 <p><?php echo __('phpMyAdmin is more friendly with a <b>frames-capable</b> browser.'); ?></p>
189 </body>
190 </noframes>
191 </frameset>
192 </html>