Rev Author Line No. Line
250 kaklik 1 <?php
2 /* $Id: footer.inc.php,v 2.7.2.5 2006/05/12 14:33:45 nijel Exp $ */
3 // vim: expandtab sw=4 ts=4 sts=4:
4  
5 /**
6 * WARNING: This script has to be included at the very end of your code because
7 * it will stop the script execution!
8 *
9 * always use $GLOBALS, as this script is also included by functions
10 *
11 */
12  
13 require_once './libraries/relation.lib.php'; // for PMA_setHistory()
14  
15 /**
16 * updates javascript variables in index.php for coorect working with querywindow
17 * and navigation frame refreshing
18 */
19 ?>
20 <script type="text/javascript" language="javascript">
21 //<![CDATA[
22 <?php
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); ?>');
29 }
30 <?php } ?>
31  
32 <?php if (! empty($GLOBALS['reload'])) { ?>
33 // refresh navigation frame content
34 if (window.parent.refreshLeft) {
35 window.parent.refreshLeft();
36 }
37 <?php } ?>
38  
39 <?php
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']);
51 }
52 }
53 ?>
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'])) : ''; ?>");
60 }
61 <?php } ?>
62  
63 <?php if (! empty($GLOBALS['focus_querywindow'])) { ?>
64 // set focus to the querywindow
65 if (parent.querywindow && !parent.querywindow.closed && parent.querywindow.location) {
66 self.focus();
67 }
68 <?php } ?>
69  
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';
75 }
76 if (window.parent.frames[1].id != 'frame_content') {
77 window.parent.frames[1].id = 'frame_content';
78 }
79 //window.parent.frames[1].setAttribute('name', 'frame_content');
80 //window.parent.frames[1].setAttribute('id', 'frame_content');
81 }
82 //]]>
83 </script>
84 <?php
85  
86 // Link to itself to replicate windows including frameset
87 if (!isset($GLOBALS['checked_special'])) {
88 $GLOBALS['checked_special'] = FALSE;
89 }
90  
91 if (PMA_getenv('SCRIPT_NAME') && empty($_POST) && !$GLOBALS['checked_special']) {
92 echo '<div id="selflink">' . "\n";
93 echo '<a href="index.php?target=' . basename(PMA_getenv('SCRIPT_NAME'));
94 $url = PMA_generate_common_url(isset($GLOBALS['db']) ? $GLOBALS['db'] : '', isset($GLOBALS['table']) ? $GLOBALS['table'] : '');
95 if (!empty($url)) {
96 echo '&amp;' . $url;
97 }
98 echo '" target="_blank">' . $GLOBALS['strOpenNewWindow'] . '</a>' . "\n";
99 echo '</div>' . "\n";
100 }
101  
102 /**
103 * Close database connections
104 */
105 if (isset($GLOBALS['controllink']) && $GLOBALS['controllink']) {
106 @PMA_DBI_close($GLOBALS['controllink']);
107 }
108 if (isset($GLOBALS['userlink']) && $GLOBALS['userlink']) {
109 @PMA_DBI_close($GLOBALS['userlink']);
110 }
111  
112 // Include possible custom footers
113 require_once './libraries/footer_custom.inc.php';
114  
115 /**
116 * Generates profiling data if requested
117 */
118 if (! empty($GLOBALS['cfg']['DBG']['enable'])
119 && ! empty($GLOBALS['cfg']['DBG']['profile']['enable'])) {
120 //run the basic setup code first
121 require_once './libraries/dbg/setup.php';
122 //if the setup ran fine, then do the profiling
123 if (! empty($GLOBALS['DBG'])) {
124 require_once './libraries/dbg/profiling.php';
125 dbg_dump_profiling_results();
126 }
127 }
128  
129 ?>
130 </body>
131 </html>
132 <?php
133 /**
134 * Sends bufferized data
135 */
136 if (! empty($GLOBALS['cfg']['OBGzip'])
137 && ! empty($GLOBALS['ob_mode'])) {
138 PMA_outBufferPost($GLOBALS['ob_mode']);
139 }
140  
141 /**
142 * Stops the script execution
143 */
144 exit;
145 ?>