home *** CD-ROM | disk | FTP | other *** search
/ Freelog 70 / Freelog070.iso / Internet / EasyPHP / easyphp1-8_setup.exe / {app} / phpmyadmin / header.inc.php < prev    next >
Encoding:
PHP Script  |  2004-10-29  |  9.3 KB  |  209 lines

  1. <?php
  2. /* $Id: header.inc.php,v 2.22 2004/10/30 00:32:56 lem9 Exp $ */
  3. // vim: expandtab sw=4 ts=4 sts=4:
  4.  
  5. if (empty($GLOBALS['is_header_sent'])) {
  6.  
  7.     /**
  8.      * Gets a core script and starts output buffering work
  9.      */
  10.     require_once('./libraries/common.lib.php');
  11.     require_once('./libraries/ob.lib.php');
  12.     if ($GLOBALS['cfg']['OBGzip']) {
  13.         $GLOBALS['ob_mode'] = PMA_outBufferModeGet();
  14.         if ($GLOBALS['ob_mode']) {
  15.             PMA_outBufferPre($GLOBALS['ob_mode']);
  16.         }
  17.     }
  18.  
  19.     // garvin: For re-usability, moved http-headers and stylesheets
  20.     // to a seperate file. It can now be included by header.inc.php,
  21.     // queryframe.php, querywindow.php.
  22.  
  23.     require_once('./libraries/header_http.inc.php');
  24.     require_once('./libraries/header_meta_style.inc.php');
  25.     /* replaced 2004-05-05 by Michael Keck (mkkeck)
  26.     $title     = '';
  27.     if (isset($GLOBALS['db'])) {
  28.         $title .= str_replace('\'', '\\\'', $GLOBALS['db']);
  29.     }
  30.     if (isset($GLOBALS['table'])) {
  31.         $title .= (empty($title) ? '' : '.') . str_replace('\'', '\\\'', $GLOBALS['table']);
  32.     }
  33.     if (!empty($GLOBALS['cfg']['Server']) && isset($GLOBALS['cfg']['Server']['host'])) {
  34.         $title .= (empty($title) ? 'phpMyAdmin ' : ' ')
  35.                . sprintf($GLOBALS['strRunning'], (empty($GLOBALS['cfg']['Server']['verbose']) ? str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['host']) : str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['verbose'])));
  36.     }
  37.     $title     .= (empty($title) ? '' : ' - ') . 'phpMyAdmin ' . PMA_VERSION;
  38.     */
  39.     /* the new one
  40.      * 2004-05-05: replaced by Michael Keck (mkkeck)
  41.      */
  42.     $title     = '';
  43.     if ($cfg['ShowHttpHostTitle']) {
  44.         $title .= (empty($GLOBALS['cfg']['SetHttpHostTitle']) && isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $GLOBALS['cfg']['SetHttpHostTitle']) . ' >> ';
  45.     }
  46.     if (!empty($GLOBALS['cfg']['Server']) && isset($GLOBALS['cfg']['Server']['host'])) {
  47.         $title.=str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['host']);
  48.     }
  49.     if (isset($GLOBALS['db'])) {
  50.         $title .= ' >> ' . str_replace('\'', '\\\'', $GLOBALS['db']);
  51.     }
  52.     if (isset($GLOBALS['table'])) {
  53.         $title .= (empty($title) ? '' : ' ') . ' >> ' . str_replace('\'', '\\\'', $GLOBALS['table']);
  54.     }
  55.     $title .= ' | phpMyAdmin ' . PMA_VERSION;
  56.     ?>
  57.     <script type="text/javascript" language="javascript">
  58.     <!--
  59.     // Updates the title of the frameset if possible (ns4 does not allow this)
  60.     if (typeof(parent.document) != 'undefined' && typeof(parent.document) != 'unknown'
  61.         && typeof(parent.document.title) == 'string') {
  62.         parent.document.title = '<?php echo $title; ?>';
  63.     }
  64.     <?php
  65.     // Add some javascript instructions if required
  66.     if (isset($js_to_run) && $js_to_run == 'functions.js') {
  67.         echo "\n";
  68.         ?>
  69.     // js form validation stuff
  70.     var errorMsg0   = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strFormEmpty']); ?>';
  71.     var errorMsg1   = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotNumber']); ?>';
  72.     var errorMsg2   = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotValidNumber']); ?>';
  73.     var noDropDbMsg = '<?php echo((!$GLOBALS['cfg']['AllowUserDropDatabase']) ? str_replace('\'', '\\\'', $GLOBALS['strNoDropDatabases']) : ''); ?>';
  74.     var confirmMsg  = '<?php echo(($GLOBALS['cfg']['Confirm']) ? str_replace('\'', '\\\'', $GLOBALS['strDoYouReally']) : ''); ?>';
  75.     var confirmMsgDropDB  = '<?php echo(($GLOBALS['cfg']['Confirm']) ? str_replace('\'', '\\\'', $GLOBALS['strDropDatabaseStrongWarning']) : ''); ?>';
  76.     //-->
  77.     </script>
  78.     <script src="libraries/functions.js" type="text/javascript" language="javascript"></script>
  79.         <?php
  80.     } else if (isset($js_to_run) && $js_to_run == 'user_password.js') {
  81.         echo "\n";
  82.         ?>
  83.     // js form validation stuff
  84.     var jsHostEmpty       = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strHostEmpty']); ?>';
  85.     var jsUserEmpty       = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strUserEmpty']); ?>';
  86.     var jsPasswordEmpty   = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordEmpty']); ?>';
  87.     var jsPasswordNotSame = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordNotSame']); ?>';
  88.     //-->
  89.     </script>
  90.     <script src="libraries/user_password.js" type="text/javascript" language="javascript"></script>
  91.         <?php
  92.     } else if (isset($js_to_run) && $js_to_run == 'server_privileges.js') {
  93.         echo "\n";
  94.         ?>
  95.     // js form validation stuff
  96.     var jsHostEmpty       = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strHostEmpty']); ?>';
  97.     var jsUserEmpty       = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strUserEmpty']); ?>';
  98.     var jsPasswordEmpty   = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordEmpty']); ?>';
  99.     var jsPasswordNotSame = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordNotSame']); ?>';
  100.     //-->
  101.     </script>
  102.     <script src="libraries/server_privileges.js" type="text/javascript" language="javascript"></script>
  103.         <?php
  104.     } else if (isset($js_to_run) && $js_to_run == 'indexes.js') {
  105.         echo "\n";
  106.         ?>
  107.     // js index validation stuff
  108.     var errorMsg0   = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strFormEmpty']); ?>';
  109.     var errorMsg1   = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotNumber']); ?>';
  110.     var errorMsg2   = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotValidNumber']); ?>';
  111.     //-->
  112.     </script>
  113.     <script src="libraries/indexes.js" type="text/javascript" language="javascript"></script>
  114.         <?php
  115.     } else if (isset($js_to_run) && $js_to_run == 'tbl_change.js') {
  116.         echo "\n";
  117.         ?>
  118.     //-->
  119.     </script>
  120.     <script src="libraries/tbl_change.js" type="text/javascript" language="javascript"></script>
  121.         <?php
  122.     } else {
  123.         echo "\n";
  124.         ?>
  125.     //-->
  126.     </script>
  127.         <?php
  128.     }
  129.     echo "\n";
  130.  
  131.     // Reloads the navigation frame via JavaScript if required
  132.     PMA_reloadNavigation();
  133.     ?>
  134.         <meta name="OBGZip" content="<?php echo ($cfg['OBGzip'] ? 'true' : 'false'); ?>" />
  135.     </head>
  136.  
  137.  
  138.     <?php
  139.     if ($GLOBALS['cfg']['RightBgImage'] != '') {
  140.         $bkg_img = ' background="' . $GLOBALS['cfg']['RightBgImage'] . '"';
  141.     } else {
  142.         $bkg_img = '';
  143.     }
  144.     ?>
  145.     <body bgcolor="<?php echo $GLOBALS['cfg']['RightBgColor'] . '"' . $bkg_img; ?>>
  146.     <?php
  147.     include('./config.header.inc.php');
  148.  
  149.     if (!defined('PMA_DISPLAY_HEADING')) {
  150.         define('PMA_DISPLAY_HEADING', 1);
  151.     }
  152.  
  153.     /**
  154.      * Display heading if needed. Design can be set in css file.
  155.      */
  156.  
  157.     if (PMA_DISPLAY_HEADING) {
  158.         echo '<table border="0" cellpadding="0" cellspacing="0" id="serverinfo">' . "\n"
  159.            . '    <tr>' . "\n";
  160.         $header_url_qry = '?' . PMA_generate_common_url();
  161.         $server_info = (!empty($cfg['Server']['verbose'])
  162.                         ? $cfg['Server']['verbose']
  163.                         : $server_info = $cfg['Server']['host'] . (empty($cfg['Server']['port'])
  164.                                                                    ? ''
  165.                                                                    : ':' . $cfg['Server']['port']
  166.                                                                   )
  167.                        );
  168.         echo '        '
  169.            . '<td class="serverinfo">' . $GLOBALS['strServer'] . ': '
  170.            . '<a href="' . $GLOBALS['cfg']['DefaultTabServer'] . '?' . PMA_generate_common_url() . '">';
  171.         if ($GLOBALS['cfg']['MainPageIconic']) {
  172.             echo '<img src="' . $GLOBALS['pmaThemeImage'] . 's_host.png" width="16" height="16" border="0" alt="' . htmlspecialchars($server_info) . '" />';
  173.         }
  174.         echo htmlspecialchars($server_info) . '</a>' . "\n"
  175.            . '</td>' . "\n\n";
  176.  
  177.         if (!empty($GLOBALS['db'])) {
  178.             echo '        '
  179.                . '<td class="serverinfo"><div></div></td>' . "\n" . '            '
  180.                . '<td class="serverinfo">' . $GLOBALS['strDatabase'] . ': '
  181.                . '<a href="' . $GLOBALS['cfg']['DefaultTabDatabase'] . '?' . PMA_generate_common_url($GLOBALS['db']) . '">';
  182.             if ($GLOBALS['cfg']['MainPageIconic']) {
  183.                 echo '<img src="' . $GLOBALS['pmaThemeImage'] . 's_db.png" width="16" height="16" border="0" alt="' . htmlspecialchars($GLOBALS['db']) . '" />';
  184.             }
  185.             echo htmlspecialchars($GLOBALS['db']) . '</a>' . "\n"
  186.                . '</td>' . "\n\n";
  187.  
  188.             if (!empty($GLOBALS['table'])) {
  189.                 echo '        '
  190.                    . '<td class="serverinfo"><div></div></td>' . "\n" . '            '
  191.                    . '<td class="serverinfo">' . $GLOBALS['strTable'] . ': '
  192.                    . '<a href="' . $GLOBALS['cfg']['DefaultTabTable'] . '?' . PMA_generate_common_url($GLOBALS['db'], $GLOBALS['table']) . '">';
  193.                 if ($GLOBALS['cfg']['MainPageIconic']) {
  194.                     echo '<img src="' . $GLOBALS['pmaThemeImage'] . 's_tbl.png" width="16" height="16" border="0" alt="' . htmlspecialchars($GLOBALS['table']) . '" />';
  195.                 }
  196.                 echo htmlspecialchars($GLOBALS['table']) . '</a>' . "\n"
  197.                    . '</td>' . "\n\n";
  198.             }
  199.         }
  200.         echo '    </tr>' . "\n" . '</table>';
  201.     }
  202.     /**
  203.      * Sets a variable to remember headers have been sent
  204.      */
  205.     $GLOBALS['is_header_sent'] = TRUE;
  206. }
  207.  
  208. ?>
  209.