home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / phpMyAdmin / libraries / footer.inc.php < prev    next >
Encoding:
PHP Script  |  2008-06-23  |  6.0 KB  |  199 lines

  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4.  * finishes 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 11326 2008-06-17 21:32:48Z lem9 $
  46.  */
  47. if (! defined('PHPMYADMIN')) {
  48.     exit;
  49. }
  50.  
  51. /**
  52.  * for PMA_setHistory()
  53.  */
  54. require_once './libraries/relation.lib.php';
  55.  
  56. if (! PMA_isValid($_REQUEST['no_history']) && empty($GLOBALS['error_message'])
  57.  && ! empty($GLOBALS['sql_query'])) {
  58.     PMA_setHistory(PMA_ifSetOr($GLOBALS['db'], ''),
  59.         PMA_ifSetOr($GLOBALS['table'], ''),
  60.         $GLOBALS['cfg']['Server']['user'],
  61.         $GLOBALS['sql_query']);
  62. }
  63.  
  64. ?>
  65. <script type="text/javascript">
  66. //<![CDATA[
  67. <?php
  68. if (empty($GLOBALS['error_message'])) {
  69.     ?>
  70. // updates current settings
  71. if (window.parent.setAll) {
  72.     window.parent.setAll('<?php
  73.         echo PMA_escapeJsString($GLOBALS['lang']) . "', '";
  74.         echo PMA_escapeJsString($GLOBALS['collation_connection']) . "', '";
  75.         echo PMA_escapeJsString($GLOBALS['server']) . "', '";
  76.         echo PMA_escapeJsString(PMA_ifSetOr($GLOBALS['db'], '')) . "', '";
  77.         echo PMA_escapeJsString(PMA_ifSetOr($GLOBALS['table'], '')); ?>');
  78. }
  79.     <?php
  80.     if (! empty($GLOBALS['reload'])) {
  81.         ?>
  82. // refresh navigation frame content
  83. if (window.parent.refreshNavigation) {
  84.     window.parent.refreshNavigation();
  85. }
  86.         <?php
  87.     }
  88.     ?>
  89. // set current db, table and sql query in the querywindow
  90. if (window.parent.reload_querywindow) {
  91.     window.parent.reload_querywindow(
  92.         '<?php echo PMA_escapeJsString(PMA_ifSetOr($GLOBALS['db'], '')) ?>',
  93.         '<?php echo PMA_escapeJsString(PMA_ifSetOr($GLOBALS['table'], '')) ?>',
  94.         '<?php echo strlen($GLOBALS['sql_query']) > $GLOBALS['cfg']['MaxCharactersInDisplayedSQL'] ? PMA_escapeJsString($GLOBALS['sql_query']) : ''; ?>');
  95. }
  96.     <?php
  97. }
  98.  
  99. if (! empty($GLOBALS['focus_querywindow'])) {
  100.     ?>
  101. // set focus to the querywindow
  102. if (parent.querywindow && !parent.querywindow.closed && parent.querywindow.location) {
  103.     self.focus();
  104. }
  105.     <?php
  106. }
  107. ?>
  108.  
  109. if (window.parent.frame_content) {
  110.     // reset content frame name, as querywindow needs to set a unique name
  111.     // before submitting form data, and navigation frame needs the original name
  112.     if (typeof(window.parent.frame_content.name) != 'undefined'
  113.      && window.parent.frame_content.name != 'frame_content') {
  114.         window.parent.frame_content.name = 'frame_content';
  115.     }
  116.     if (typeof(window.parent.frame_content.id) != 'undefined'
  117.      && window.parent.frame_content.id != 'frame_content') {
  118.         window.parent.frame_content.id = 'frame_content';
  119.     }
  120.     //window.parent.frame_content.setAttribute('name', 'frame_content');
  121.     //window.parent.frame_content.setAttribute('id', 'frame_content');
  122. }
  123. //]]>
  124. </script>
  125. <?php
  126.  
  127. // Link to itself to replicate windows including frameset
  128. if (!isset($GLOBALS['checked_special'])) {
  129.     $GLOBALS['checked_special'] = false;
  130. }
  131.  
  132. if (PMA_getenv('SCRIPT_NAME') && empty($_POST) && !$GLOBALS['checked_special']) {
  133.     echo '<div id="selflink" class="print_ignore">' . "\n";
  134.     $url_params['target'] = basename(PMA_getenv('SCRIPT_NAME'));
  135.     echo '<a href="index.php' . PMA_generate_common_url($url_params) . '"'
  136.         . ' title="' . $GLOBALS['strOpenNewWindow'] . '" target="_blank">';
  137.     /*
  138.     echo '<a href="index.php?target=' . basename(PMA_getenv('SCRIPT_NAME'));
  139.     $url = PMA_generate_common_url($GLOBALS['db'], $GLOBALS['table']);
  140.     if (!empty($url)) {
  141.         echo '&' . $url;
  142.     }
  143.     echo '" target="_blank">';
  144.     */
  145.     if ($GLOBALS['cfg']['NavigationBarIconic']) {
  146.         echo '<img class="icon" src="'. $GLOBALS['pmaThemeImage'] . 'window-new.png"'
  147.             . ' alt="' . $GLOBALS['strOpenNewWindow'] . '" />';
  148.     }
  149.     if ($GLOBALS['cfg']['NavigationBarIconic'] !== true) {
  150.         echo $GLOBALS['strOpenNewWindow'];
  151.     }
  152.     echo '</a>' . "\n";
  153.     echo '</div>' . "\n";
  154. }
  155.  
  156. /**
  157.  * Close database connections
  158.  */
  159. if (! empty($GLOBALS['controllink'])) {
  160.     @PMA_DBI_close($GLOBALS['controllink']);
  161. }
  162. if (! empty($GLOBALS['userlink'])) {
  163.     @PMA_DBI_close($GLOBALS['userlink']);
  164. }
  165.  
  166. // Include possible custom footers
  167. if (file_exists('./config.footer.inc.php')) {
  168.     require './config.footer.inc.php';
  169. }
  170.  
  171.  
  172. /**
  173.  * Generates profiling data if requested
  174.  */
  175.  
  176. // profiling deactivated due to licensing issues
  177. if (! empty($GLOBALS['cfg']['DBG']['enable'])
  178.   && ! empty($GLOBALS['cfg']['DBG']['profile']['enable'])) {
  179.     //run the basic setup code first
  180.     require_once './libraries/dbg/setup.php';
  181.     //if the setup ran fine, then do the profiling
  182.     /*
  183.     if (! empty($GLOBALS['DBG'])) {
  184.         require_once './libraries/dbg/profiling.php';
  185.         dbg_dump_profiling_results();
  186.     }
  187.     */
  188. }
  189.  
  190. ?>
  191. </body>
  192. </html>
  193. <?php
  194. /**
  195.  * Stops the script execution
  196.  */
  197. exit;
  198. ?>
  199.