sorry, wrong version checked in
[phpmyadmin/arisferyanto.git] / index.php
blobf7a0a1d132550622ff53e5a72f176fe8b3958907
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
4 /**
5 * forms frameset
6 *
7 * @uses libraries/common.lib.php global fnctions
8 * @uses libraries/select_theme.lib.php theme manager
9 * @uses libraries/relation.lib.php table relations
10 * @uses $GLOBALS['strNoFrames']
11 * @uses $GLOBALS['cfg']['QueryHistoryDB']
12 * @uses $GLOBALS['cfg']['Server']['user']
13 * @uses $GLOBALS['cfg']['DefaultTabServer'] as src for the mainframe
14 * @uses $GLOBALS['cfg']['DefaultTabDatabase'] as src for the mainframe
15 * @uses $GLOBALS['cfg']['LeftWidth'] for left frame width
16 * @uses $GLOBALS['collation_connection'] from $_REQUEST (grab_globals.lib.php)
17 * or common.lib.php
18 * @uses $GLOBALS['available_languages'] from common.lib.php (select_lang.lib.php)
19 * @uses $GLOBALS['cookie_path'] from common.lib.php
20 * @uses $GLOBALS['is_https'] from common.lib.php
21 * @uses $GLOBALS['db']
22 * @uses $GLOBALS['charset']
23 * @uses $GLOBALS['lang']
24 * @uses $GLOBALS['text_dir']
25 * @uses $_ENV['HTTP_HOST']
26 * @uses PMA_getRelationsParam()
27 * @uses PMA_purgeHistory()
28 * @uses PMA_generate_common_url()
29 * @uses PMA_VERSION
30 * @uses setcookie()
31 * @uses session_write_close()
32 * @uses time()
33 * @uses getenv()
34 * @uses header() to send charset
37 /**
38 * Gets core libraries and defines some variables
40 require_once('./libraries/common.lib.php');
41 /**
42 * Includes the ThemeManager if it hasn't been included yet
44 require_once('./libraries/select_theme.lib.php');
45 require_once('./libraries/relation.lib.php');
47 // hash for the window names, against window hijacking
48 $_SESSION['window_name_hash'] = time();
50 // free the session file, for the other frames to be loaded
51 session_write_close();
53 /**
54 * Saves collation_connection (coming from main.php) in a cookie
56 // (from grab_globals)
57 // TODO: move into common.lib.php line #360
58 if ( isset( $collation_connection ) ) {
59 setcookie( 'pma_collation_connection', $collation_connection,
60 time() + 60*60*24*30, $cookie_path, '', $is_https );
64 // Gets the host name
65 // loic1 - 2001/25/11: use the new globals arrays defined with php 4.1+
66 if (empty($HTTP_HOST)) {
67 if (!empty($_ENV) && isset($_ENV['HTTP_HOST'])) {
68 $HTTP_HOST = $_ENV['HTTP_HOST'];
70 else if (@getenv('HTTP_HOST')) {
71 $HTTP_HOST = getenv('HTTP_HOST');
73 else {
74 $HTTP_HOST = '';
79 // purge querywindow history
80 $cfgRelation = PMA_getRelationsParam();
81 if ( $GLOBALS['cfg']['QueryHistoryDB'] && $cfgRelation['historywork'] ) {
82 PMA_purgeHistory( $GLOBALS['cfg']['Server']['user'] );
85 $drops = array( 'lang', 'server', 'convcharset', 'collation_connection',
86 'db', 'table' );
88 $url_querys = array();
89 // pass variables to child pages
90 foreach( $_GET as $key => $val ) {
91 if ( ! in_array( $key, $drops ) ) {
92 $url_querys[] = urlencode( $key ) . '=' . urlencode( $val );
95 unset( $drops );
97 if ( count( $url_querys ) ) {
98 $url_query = implode( '&amp;', $url_querys ) . '&amp;';
99 } else {
100 $url_query = '';
102 unset( $url_querys );
104 if ( empty( $GLOBALS['db'] ) ) {
105 $url_query .= PMA_generate_common_url();
106 $main_target = $GLOBALS['cfg']['DefaultTabServer'];
107 } elseif ( empty( $GLOBALS['table'] ) ) {
108 $url_query .= PMA_generate_common_url( $GLOBALS['db'] );
109 $main_target = $GLOBALS['cfg']['DefaultTabDatabase'];
110 } else {
111 $url_query .= PMA_generate_common_url( $GLOBALS['db'], $GLOBALS['table'] );
112 $main_target = $GLOBALS['cfg']['DefaultTabTable'];
115 $main_target .= '?' . $url_query;
117 $lang_iso_code = $GLOBALS['available_languages'][$GLOBALS['lang']][2];
120 // start output
121 header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
123 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
124 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
125 <html xmlns="http://www.w3.org/1999/xhtml"
126 xml:lang="<?php echo $lang_iso_code; ?>"
127 lang="<?php echo $lang_iso_code; ?>"
128 dir="<?php echo $GLOBALS['text_dir']; ?>">
129 <head>
130 <link rel="icon" href="./favicon.ico" type="image/x-icon" />
131 <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
132 <title>phpMyAdmin <?php echo PMA_VERSION; ?> - <?php echo $HTTP_HOST; ?></title>
133 <meta http-equiv="Content-Type"
134 content="text/html; charset=<?php echo $GLOBALS['charset']; ?>" />
135 <script type="text/javascript" language="javascript">
136 //<![CDATA[
137 // definitions used in querywindow.js
138 var common_query = '<?php echo PMA_generate_common_url('','','&');?>';
139 var opendb_url = '<?php echo $GLOBALS['cfg']['DefaultTabDatabase']; ?>';
140 var safari_browser = <?php echo PMA_USR_BROWSER_AGENT != 'SAFARI' ? 'true' : 'false' ?>;
141 var querywindow_height = <?php echo $GLOBALS['cfg']['QueryWindowHeight']; ?>;
142 var querywindow_width = <?php echo $GLOBALS['cfg']['QueryWindowWidth']; ?>;
143 var collation_connection = '<?php echo $GLOBALS['collation_connection']; ?>';
144 var lang = '<?php echo $GLOBALS['lang']; ?>';
145 var server = '<?php echo $GLOBALS['server']; ?>';
146 var table = '<?php echo $GLOBALS['table']; ?>';
147 var db = '<?php echo $GLOBALS['db']; ?>';
148 var pma_absolute_uri = '<?php echo $GLOBALS['cfg']['PmaAbsoluteUri']; ?>';
149 //]]>
150 </script>
151 <script src="libraries/querywindow.js" type="text/javascript"
152 language="javascript"></script>
153 </head>
154 <frameset cols="<?php echo $GLOBALS['cfg']['LeftWidth']; ?>,*" rows="*" id="mainFrameset">
155 <frame frameborder="0" id="leftFrame"
156 src="left.php?<?php echo $url_query; ?>"
157 name="nav<?php echo $_SESSION['window_name_hash']; ?>" />
158 <frame frameborder="0" id="rightFrame"
159 src="<?php echo $main_target; ?>"
160 name="phpmain<?php echo $_SESSION['window_name_hash']; ?>" />
161 <noframes>
162 <body>
163 <p><?php echo $GLOBALS['strNoFrames']; ?></p>
164 </body>
165 </noframes>
166 </frameset>
167 </html>