3 // vim: expandtab sw=4 ts=4 sts=4:
6 * WARNING: This script has to be included at the very end of your code because
7 * it will stop the script execution!
9 * always use $GLOBALS, as this script is also included by functions
13 require_once './libraries/relation.lib.php'; // for PMA_setHistory()
16 * updates javascript variables in index.php for coorect working with querywindow
17 * and navigation frame refreshing
20 <script type
="text/javascript" language
="javascript">
23 if (! isset($GLOBALS['no_history']) && isset($GLOBALS['db'])
24 && strlen($GLOBALS['db']) && empty($GLOBALS['error_message'])) {
25 $table = isset($GLOBALS['table']) ?
$GLOBALS['table'] : ''; ?
>
26 // updates current settings
27 if (window
.parent
.setAll
) {
28 window
.parent
.setAll('<?php echo $GLOBALS['lang
']; ?>', '<?php echo htmlspecialchars($GLOBALS['collation_connection
']); ?>', '<?php echo $GLOBALS['server
']; ?>', '<?php echo htmlspecialchars($GLOBALS['db
']); ?>', '<?php echo htmlspecialchars($table); ?>');
32 <?php
if (! empty($GLOBALS['reload'])) { ?
>
33 // refresh navigation frame content
34 if (window
.parent
.refreshLeft
) {
35 window
.parent
.refreshLeft();
40 if (! isset($GLOBALS['no_history']) && empty($GLOBALS['error_message'])) {
41 if (isset($GLOBALS['LockFromUpdate']) && $GLOBALS['LockFromUpdate'] == '1'
42 && isset($GLOBALS['sql_query'])) {
43 // When the button 'LockFromUpdate' was selected in the querywindow,
44 // it does not submit it's contents to
45 // itself. So we create a SQL-history entry here.
46 if ($GLOBALS['cfg']['QueryHistoryDB'] && $GLOBALS['cfgRelation']['historywork']) {
47 PMA_setHistory((isset($GLOBALS['db']) ?
$GLOBALS['db'] : ''),
48 (isset($GLOBALS['table']) ?
$GLOBALS['table'] : ''),
49 $GLOBALS['cfg']['Server']['user'],
50 $GLOBALS['sql_query']);
54 // set current db, table and sql query in the querywindow
55 if (window
.parent
.refreshLeft
) {
56 window
.parent
.reload_querywindow(
57 "<?php echo isset($GLOBALS['db']) ? htmlspecialchars(addslashes($GLOBALS['db'])) : '' ?>",
58 "<?php echo isset($GLOBALS['table']) ? htmlspecialchars(addslashes($GLOBALS['table'])) : '' ?>",
59 "<?php echo isset($GLOBALS['sql_query']) ? htmlspecialchars(urlencode($GLOBALS['sql_query'])) : ''; ?>");
63 <?php
if (! empty($GLOBALS['focus_querywindow'])) { ?
>
64 // set focus to the querywindow
65 if (parent
.querywindow
&& !parent
.querywindow
.closed
&& parent
.querywindow
.location
) {
70 if (window
.parent
.frames
[1]) {
71 // reset content frame name, as querywindow needs to set a unique name
72 // before submitting form data, and navigation frame needs the original name
73 if (window
.parent
.frames
[1].name
!= 'frame_content') {
74 window
.parent
.frames
[1].name
= 'frame_content';
76 if (window
.parent
.frames
[1].id
!= 'frame_content') {
77 window
.parent
.frames
[1].id
= 'frame_content';
79 //window.parent.frames[1].setAttribute('name', 'frame_content');
80 //window.parent.frames[1].setAttribute('id', 'frame_content');
86 // Link to itself to replicate windows including frameset
87 if (!isset($GLOBALS['checked_special'])) {
88 $GLOBALS['checked_special'] = FALSE;
91 if (PMA_getenv('SCRIPT_NAME') && empty($_POST) && !$GLOBALS['checked_special']) {
92 echo '<div id="selflink" class="print_ignore">' . "\n";
93 $url_params['target'] = basename(PMA_getenv('SCRIPT_NAME'));
94 echo '<a href="index.php' . PMA_generate_common_url($url_params) . '"'
95 . ' title="' . $GLOBALS['strOpenNewWindow'] . '" target="_blank">';
97 echo '<a href="index.php?target=' . basename(PMA_getenv('SCRIPT_NAME'));
98 $url = PMA_generate_common_url(isset($GLOBALS['db']) ? $GLOBALS['db'] : '', isset($GLOBALS['table']) ? $GLOBALS['table'] : '');
102 echo '" target="_blank">';
104 if ($GLOBALS['cfg']['NavigationBarIconic']) {
105 echo '<img class="icon" src="'. $GLOBALS['pmaThemeImage'] . 'window-new.png"'
106 . ' alt="' . $GLOBALS['strOpenNewWindow'] . '" />';
108 if ($GLOBALS['cfg']['NavigationBarIconic'] !== true) {
109 echo $GLOBALS['strOpenNewWindow'];
112 echo '</div>' . "\n";
116 * Close database connections
118 if (isset($GLOBALS['controllink']) && $GLOBALS['controllink']) {
119 @PMA_DBI_close
($GLOBALS['controllink']);
121 if (isset($GLOBALS['userlink']) && $GLOBALS['userlink']) {
122 @PMA_DBI_close
($GLOBALS['userlink']);
125 // Include possible custom footers
126 if (file_exists('./config.footer.inc.php')) {
127 require('./config.footer.inc.php');
132 * Generates profiling data if requested
134 if (! empty($GLOBALS['cfg']['DBG']['enable'])
135 && ! empty($GLOBALS['cfg']['DBG']['profile']['enable'])) {
136 //run the basic setup code first
137 require_once './libraries/dbg/setup.php';
138 //if the setup ran fine, then do the profiling
139 if (! empty($GLOBALS['DBG'])) {
140 require_once './libraries/dbg/profiling.php';
141 dbg_dump_profiling_results();
150 * Sends bufferized data
152 if (! empty($GLOBALS['cfg']['OBGzip'])
153 && ! empty($GLOBALS['ob_mode'])) {
154 PMA_outBufferPost($GLOBALS['ob_mode']);
158 * Stops the script execution