home *** CD-ROM | disk | FTP | other *** search
/ PC World 2008 February (DVD) / PCWorld_2008-02_DVD.iso / v cisle / PHP / PHP.exe / xampp-win32-1.6.5-installer.exe / phpMyAdmin / libraries / footer.inc.php < prev    next >
Encoding:
PHP Script  |  2007-12-20  |  5.9 KB  |  196 lines

  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4.  * finishs HTML output
  5.  *
  6.  * updates javascript variables in index.php for coorect working with querywindow
  7.  * and navigation frame refreshing
  8.  *
  9.  * send buffered data if buffered
  10.  *
  11.  * WARNING: This script has to be included at the very end of your code because
  12.  *          it will stop the script execution!
  13.  *
  14.  * always use $GLOBALS, as this script is also included by functions
  15.  *
  16.  * @uses    $_REQUEST['no_history']
  17.  * @uses    $GLOBALS['lang']
  18.  * @uses    $GLOBALS['collation_connection']
  19.  * @uses    $GLOBALS['server']
  20.  * @uses    $GLOBALS['db']
  21.  * @uses    $GLOBALS['table']
  22.  * @uses    $GLOBALS['error_message']
  23.  * @uses    $GLOBALS['reload']
  24.  * @uses    $GLOBALS['sql_query']
  25.  * @uses    $GLOBALS['focus_querywindow']
  26.  * @uses    $GLOBALS['checked_special']
  27.  * @uses    $GLOBALS['pmaThemeImage']
  28.  * @uses    $GLOBALS['controllink'] to close it
  29.  * @uses    $GLOBALS['userlink'] to close it
  30.  * @uses    $cfg['Server']['user']
  31.  * @uses    $cfg['NavigationBarIconic']
  32.  * @uses    $cfg['DBG']['enable']
  33.  * @uses    $cfg['DBG']['profile']['enable']
  34.  * @uses    $GLOBALS['strOpenNewWindow']
  35.  * @uses    $cfg['MaxCharactersInDisplayedSQL'] 
  36.  * @uses    PMA_isValid()
  37.  * @uses    PMA_setHistory()
  38.  * @uses    PMA_ifSetOr()
  39.  * @uses    PMA_escapeJsString()
  40.  * @uses    PMA_getenv()
  41.  * @uses    PMA_generate_common_url()
  42.  * @uses    PMA_DBI_close()
  43.  * @uses    basename()
  44.  * @uses    file_exists()
  45.  * @version $Id: footer.inc.php 10630 2007-09-11 21:04:32Z lem9 $
  46.  */
  47.  
  48. /**
  49.  * for PMA_setHistory()
  50.  */
  51. require_once './libraries/relation.lib.php';
  52.  
  53. if (! PMA_isValid($_REQUEST['no_history']) && empty($GLOBALS['error_message'])
  54.  && ! empty($GLOBALS['sql_query'])) {
  55.     PMA_setHistory(PMA_ifSetOr($GLOBALS['db'], ''),
  56.         PMA_ifSetOr($GLOBALS['table'], ''),
  57.         $GLOBALS['cfg']['Server']['user'],
  58.         $GLOBALS['sql_query']);
  59. }
  60.  
  61. ?>
  62. <script type="text/javascript">
  63. //<![CDATA[
  64. <?php
  65. if (empty($GLOBALS['error_message'])) {
  66.     ?>
  67. // updates current settings
  68. if (window.parent.setAll) {
  69.     window.parent.setAll('<?php
  70.         echo PMA_escapeJsString($GLOBALS['lang']) . "', '";
  71.         echo PMA_escapeJsString($GLOBALS['collation_connection']) . "', '";
  72.         echo PMA_escapeJsString($GLOBALS['server']) . "', '";
  73.         echo PMA_escapeJsString(PMA_ifSetOr($GLOBALS['db'], '')) . "', '";
  74.         echo PMA_escapeJsString(PMA_ifSetOr($GLOBALS['table'], '')); ?>');
  75. }
  76.     <?php
  77.     if (! empty($GLOBALS['reload'])) {
  78.         ?>
  79. // refresh navigation frame content
  80. if (window.parent.refreshNavigation) {
  81.     window.parent.refreshNavigation();
  82. }
  83.         <?php
  84.     }
  85.     ?>
  86. // set current db, table and sql query in the querywindow
  87. if (window.parent.reload_querywindow) {
  88.     window.parent.reload_querywindow(
  89.         '<?php echo PMA_escapeJsString(PMA_ifSetOr($GLOBALS['db'], '')) ?>',
  90.         '<?php echo PMA_escapeJsString(PMA_ifSetOr($GLOBALS['table'], '')) ?>',
  91.         '<?php echo strlen($GLOBALS['sql_query']) > $GLOBALS['cfg']['MaxCharactersInDisplayedSQL'] ? PMA_escapeJsString($GLOBALS['sql_query']) : ''; ?>');
  92. }
  93.     <?php
  94. }
  95.  
  96. if (! empty($GLOBALS['focus_querywindow'])) {
  97.     ?>
  98. // set focus to the querywindow
  99. if (parent.querywindow && !parent.querywindow.closed && parent.querywindow.location) {
  100.     self.focus();
  101. }
  102.     <?php
  103. }
  104. ?>
  105.  
  106. if (window.parent.frame_content) {
  107.     // reset content frame name, as querywindow needs to set a unique name
  108.     // before submitting form data, and navigation frame needs the original name
  109.     if (typeof(window.parent.frame_content.name) != 'undefined'
  110.      && window.parent.frame_content.name != 'frame_content') {
  111.         window.parent.frame_content.name = 'frame_content';
  112.     }
  113.     if (typeof(window.parent.frame_content.id) != 'undefined'
  114.      && window.parent.frame_content.id != 'frame_content') {
  115.         window.parent.frame_content.id = 'frame_content';
  116.     }
  117.     //window.parent.frame_content.setAttribute('name', 'frame_content');
  118.     //window.parent.frame_content.setAttribute('id', 'frame_content');
  119. }
  120. //]]>
  121. </script>
  122. <?php
  123.  
  124. // Link to itself to replicate windows including frameset
  125. if (!isset($GLOBALS['checked_special'])) {
  126.     $GLOBALS['checked_special'] = false;
  127. }
  128.  
  129. if (PMA_getenv('SCRIPT_NAME') && empty($_POST) && !$GLOBALS['checked_special']) {
  130.     echo '<div id="selflink" class="print_ignore">' . "\n";
  131.     $url_params['target'] = basename(PMA_getenv('SCRIPT_NAME'));
  132.     echo '<a href="index.php' . PMA_generate_common_url($url_params) . '"'
  133.         . ' title="' . $GLOBALS['strOpenNewWindow'] . '" target="_blank">';
  134.     /*
  135.     echo '<a href="index.php?target=' . basename(PMA_getenv('SCRIPT_NAME'));
  136.     $url = PMA_generate_common_url($GLOBALS['db'], $GLOBALS['table']);
  137.     if (!empty($url)) {
  138.         echo '&' . $url;
  139.     }
  140.     echo '" target="_blank">';
  141.     */
  142.     if ($GLOBALS['cfg']['NavigationBarIconic']) {
  143.         echo '<img class="icon" src="'. $GLOBALS['pmaThemeImage'] . 'window-new.png"'
  144.             . ' alt="' . $GLOBALS['strOpenNewWindow'] . '" />';
  145.     }
  146.     if ($GLOBALS['cfg']['NavigationBarIconic'] !== true) {
  147.         echo $GLOBALS['strOpenNewWindow'];
  148.     }
  149.     echo '</a>' . "\n";
  150.     echo '</div>' . "\n";
  151. }
  152.  
  153. /**
  154.  * Close database connections
  155.  */
  156. if (! empty($GLOBALS['controllink'])) {
  157.     @PMA_DBI_close($GLOBALS['controllink']);
  158. }
  159. if (! empty($GLOBALS['userlink'])) {
  160.     @PMA_DBI_close($GLOBALS['userlink']);
  161. }
  162.  
  163. // Include possible custom footers
  164. if (file_exists('./config.footer.inc.php')) {
  165.     require './config.footer.inc.php';
  166. }
  167.  
  168.  
  169. /**
  170.  * Generates profiling data if requested
  171.  */
  172.  
  173. // profiling deactivated due to licensing issues
  174. if (! empty($GLOBALS['cfg']['DBG']['enable'])
  175.   && ! empty($GLOBALS['cfg']['DBG']['profile']['enable'])) {
  176.     //run the basic setup code first
  177.     require_once './libraries/dbg/setup.php';
  178.     //if the setup ran fine, then do the profiling
  179.     /*
  180.     if (! empty($GLOBALS['DBG'])) {
  181.         require_once './libraries/dbg/profiling.php';
  182.         dbg_dump_profiling_results();
  183.     }
  184.     */
  185. }
  186.  
  187. ?>
  188. </body>
  189. </html>
  190. <?php
  191. /**
  192.  * Stops the script execution
  193.  */
  194. exit;
  195. ?>
  196.