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
29 echo PMA_escapeJsString($GLOBALS['lang
']) . "', '";
30 echo PMA_escapeJsString($GLOBALS['collation_connection
']) . "', '";
31 echo PMA_escapeJsString($GLOBALS['server
']) . "', '";
32 echo PMA_escapeJsString($GLOBALS['db
']) . "', '";
33 echo PMA_escapeJsString($table); ?>');
37 <?php
if (! empty($GLOBALS['reload'])) { ?
>
38 // refresh navigation frame content
39 if (window
.parent
.refreshNavigation
) {
40 window
.parent
.refreshNavigation();
45 if (! isset($GLOBALS['no_history']) && empty($GLOBALS['error_message'])) {
46 if (isset($GLOBALS['LockFromUpdate']) && $GLOBALS['LockFromUpdate'] == '1'
47 && isset($GLOBALS['sql_query'])) {
48 // When the button 'LockFromUpdate' was selected in the querywindow,
49 // it does not submit it's contents to
50 // itself. So we create a SQL-history entry here.
51 if ($GLOBALS['cfg']['QueryHistoryDB'] && $GLOBALS['cfgRelation']['historywork']) {
52 PMA_setHistory((isset($GLOBALS['db']) ?
$GLOBALS['db'] : ''),
53 (isset($GLOBALS['table']) ?
$GLOBALS['table'] : ''),
54 $GLOBALS['cfg']['Server']['user'],
55 $GLOBALS['sql_query']);
59 // set current db, table and sql query in the querywindow
60 if (window
.parent
.refreshNavigation
) {
61 window
.parent
.reload_querywindow(
62 '<?php echo isset($GLOBALS['db
']) ? PMA_escapeJsString($GLOBALS['db
']) : '' ?>',
63 '<?php echo isset($GLOBALS['table
']) ? PMA_escapeJsString($GLOBALS['table
']) : '' ?>',
64 '<?php echo isset($GLOBALS['sql_query
']) ? PMA_escapeJsString($GLOBALS['sql_query
']) : ''; ?>');
68 <?php
if (! empty($GLOBALS['focus_querywindow'])) { ?
>
69 // set focus to the querywindow
70 if (parent
.querywindow
&& !parent
.querywindow
.closed
&& parent
.querywindow
.location
) {
75 if (window
.parent
.frame_content
) {
76 // reset content frame name, as querywindow needs to set a unique name
77 // before submitting form data, and navigation frame needs the original name
78 if (window
.parent
.frame_content
.name
!= 'frame_content') {
79 window
.parent
.frame_content
.name
= 'frame_content';
81 if (window
.parent
.frame_content
.id
!= 'frame_content') {
82 window
.parent
.frame_content
.id
= 'frame_content';
84 //window.parent.frame_content.setAttribute('name', 'frame_content');
85 //window.parent.frame_content.setAttribute('id', 'frame_content');
91 // Link to itself to replicate windows including frameset
92 if (!isset($GLOBALS['checked_special'])) {
93 $GLOBALS['checked_special'] = FALSE;
96 if (PMA_getenv('SCRIPT_NAME') && empty($_POST) && !$GLOBALS['checked_special']) {
97 echo '<div id="selflink" class="print_ignore">' . "\n";
98 $url_params['target'] = basename(PMA_getenv('SCRIPT_NAME'));
99 echo '<a href="index.php' . PMA_generate_common_url($url_params) . '"'
100 . ' title="' . $GLOBALS['strOpenNewWindow'] . '" target="_blank">';
102 echo '<a href="index.php?target=' . basename(PMA_getenv('SCRIPT_NAME'));
103 $url = PMA_generate_common_url(isset($GLOBALS['db']) ? $GLOBALS['db'] : '', isset($GLOBALS['table']) ? $GLOBALS['table'] : '');
107 echo '" target="_blank">';
109 if ($GLOBALS['cfg']['NavigationBarIconic']) {
110 echo '<img class="icon" src="'. $GLOBALS['pmaThemeImage'] . 'window-new.png"'
111 . ' alt="' . $GLOBALS['strOpenNewWindow'] . '" />';
113 if ($GLOBALS['cfg']['NavigationBarIconic'] !== true) {
114 echo $GLOBALS['strOpenNewWindow'];
117 echo '</div>' . "\n";
121 * Close database connections
123 if (isset($GLOBALS['controllink']) && $GLOBALS['controllink']) {
124 @PMA_DBI_close
($GLOBALS['controllink']);
126 if (isset($GLOBALS['userlink']) && $GLOBALS['userlink']) {
127 @PMA_DBI_close
($GLOBALS['userlink']);
130 // Include possible custom footers
131 if (file_exists('./config.footer.inc.php')) {
132 require('./config.footer.inc.php');
137 * Generates profiling data if requested
140 // profiling deactivated due to licensing issues
141 if (! empty($GLOBALS['cfg']['DBG']['enable'])
142 && ! empty($GLOBALS['cfg']['DBG']['profile']['enable'])) {
143 //run the basic setup code first
144 require_once './libraries/dbg/setup.php';
145 //if the setup ran fine, then do the profiling
147 if (! empty($GLOBALS['DBG'])) {
148 require_once './libraries/dbg/profiling.php';
149 dbg_dump_profiling_results();
158 * Sends bufferized data
160 if (! empty($GLOBALS['cfg']['OBGzip'])
161 && ! empty($GLOBALS['ob_mode'])) {
162 PMA_outBufferPost($GLOBALS['ob_mode']);
166 * Stops the script execution