Guest User

Untitled

a guest
Aug 5th, 2013
744
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.75 KB | None | 0 0
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * forms frameset
  5. *
  6. * or common.inc.php
  7. * @package PhpMyAdmin
  8. */
  9.  
  10. /**
  11. * Gets core libraries and defines some variables
  12. */
  13. require_once './libraries/common.inc.php';
  14.  
  15. // free the session file, for the other frames to be loaded
  16. session_write_close();
  17.  
  18. // Gets the host name
  19. if (empty($HTTP_HOST)) {
  20. if (PMA_getenv('HTTP_HOST')) {
  21. $HTTP_HOST = PMA_getenv('HTTP_HOST');
  22. } else {
  23. $HTTP_HOST = '';
  24. }
  25. }
  26.  
  27.  
  28. // purge querywindow history
  29. $cfgRelation = PMA_getRelationsParam();
  30. if ($GLOBALS['cfg']['QueryHistoryDB'] && $cfgRelation['historywork']) {
  31. PMA_purgeHistory($GLOBALS['cfg']['Server']['user']);
  32. }
  33. unset($cfgRelation);
  34.  
  35.  
  36. /**
  37. * pass variables to child pages
  38. */
  39. $drops = array('lang', 'server', 'collation_connection',
  40. 'db', 'table');
  41.  
  42. foreach ($drops as $each_drop) {
  43. if (array_key_exists($each_drop, $_GET)) {
  44. unset($_GET[$each_drop]);
  45. }
  46. }
  47. unset($drops, $each_drop);
  48.  
  49. if (! strlen($GLOBALS['db'])) {
  50. $main_target = $GLOBALS['cfg']['DefaultTabServer'];
  51. } elseif (! strlen($GLOBALS['table'])) {
  52. $_GET['db'] = $GLOBALS['db'];
  53. $main_target = $GLOBALS['cfg']['DefaultTabDatabase'];
  54. } else {
  55. $_GET['db'] = $GLOBALS['db'];
  56. $_GET['table'] = $GLOBALS['table'];
  57. $main_target = ! empty($GLOBALS['goto']) ? $GLOBALS['goto'] : $GLOBALS['cfg']['DefaultTabTable'];
  58. }
  59.  
  60. $url_query = PMA_generate_common_url($_GET);
  61.  
  62. if (isset($GLOBALS['target']) && is_string($GLOBALS['target']) && !empty($GLOBALS['target']) && in_array($GLOBALS['target'], $goto_whitelist)) {
  63. $main_target = $GLOBALS['target'];
  64. }
  65.  
  66. $main_target .= $url_query;
  67.  
  68. $lang_iso_code = $GLOBALS['available_languages'][$GLOBALS['lang']][1];
  69.  
  70.  
  71. // start output
  72. require './libraries/header_http.inc.php';
  73. ?>
  74. <!DOCTYPE html>
  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']; ?>">
  79. <head>
  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">
  87. // <![CDATA[
  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'])); ?>';
  104.  
  105. // for content and navigation frames
  106.  
  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];
  113. <?php } else { ?>
  114. frame_content = window.frames[0];
  115. frame_navigation = window.frames[1];
  116. <?php } ?>
  117. }
  118. var onloadCnt = 0;
  119. var onLoadHandler = window.onload;
  120. window.onload = function() {
  121. if (onloadCnt == 0) {
  122. if (typeof(onLoadHandler) == "function") {
  123. onLoadHandler();
  124. }
  125. if (typeof(getFrames) != 'undefined' && typeof(getFrames) == 'function') {
  126. getFrames();
  127. }
  128. onloadCnt++;
  129. }
  130. };
  131. // ]]>
  132. </script>
  133. <?php
  134. echo PMA_includeJS('jquery/jquery-1.6.2+fix-9521.js');
  135. echo PMA_includeJS('update-location.js');
  136. echo PMA_includeJS('common.js');
  137. ?>
  138. </head>
  139. <frameset cols="<?php
  140. if ($GLOBALS['text_dir'] === 'rtl') {
  141. echo '*,';
  142. }
  143. echo $GLOBALS['cfg']['NaviWidth'];
  144. if ($GLOBALS['text_dir'] === 'ltr') {
  145. echo ',*';
  146. }
  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" />
  152. <?php } ?>
  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" />
  160. <?php } ?>
  161. <noframes>
  162. <body>
  163. <p><?php echo __('phpMyAdmin is more friendly with a <b>frames-capable</b> browser.'); ?></p>
  164. </body>
  165. </noframes>
  166. </frameset>
  167. </html>
Advertisement
Add Comment
Please, Sign In to add comment