home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 April / PCWorld_2005-04_cd.bin / akce / web / phptriad / phptriad2-2-1.exe / htdocs / phpmyadmin / header.inc.php < prev    next >
PHP Script  |  2002-01-06  |  6KB  |  156 lines

  1. <?php
  2. /* $Id: header.inc.php,v 1.35 2001/12/29 17:25:15 loic1 Exp $ */
  3.  
  4.  
  5. /**
  6.  * Gets a core script and starts output buffering work 
  7.  */
  8. require('./libraries/common.lib.php');
  9. require('./libraries/ob.lib.php');
  10. if ($cfgOBGzip) {
  11.     $ob_mode = PMA_outBufferModeGet();
  12.     if ($ob_mode) {
  13.         PMA_outBufferPre($ob_mode);
  14.     }
  15. }
  16.  
  17.  
  18. /**
  19.  * Sends http headers
  20.  */
  21. // Don't use cache (required for Opera)
  22. $now = gmdate('D, d M Y H:i:s') . ' GMT';
  23. header('Expires: 0'); // rfc2616 - Section 14.21
  24. header('Last-Modified: ' . $now);
  25. header('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP/1.1
  26. header('Cache-Control: pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
  27. header('Pragma: no-cache'); // HTTP/1.0
  28. // Define the charset to be used
  29. header('Content-Type: text/html; charset=' . $charset);
  30.  
  31.  
  32. /**
  33.  * Sends the beginning of the html page then returns to the calling script
  34.  */
  35. // Gets the font sizes to use
  36. PMA_setFontSizes();
  37. // Defines the cell alignment values depending on text direction
  38. if ($text_dir == 'ltr') {
  39.     $cell_align_left  = 'left';
  40.     $cell_align_right = 'right';
  41. } else {
  42.     $cell_align_left  = 'right';
  43.     $cell_align_right = 'left';
  44. }
  45. ?>
  46. <!DOCTYPE html
  47.     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  48.     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  49. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $available_languages[$lang][2]; ?>" lang="<?php echo $available_languages[$lang][2]; ?>" dir="<?php echo $text_dir; ?>">
  50.  
  51. <head>
  52. <title>phpMyAdmin</title>
  53. <style type="text/css">
  54. <!--
  55. body          {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000}
  56. pre, tt       {font-size: <?php echo $font_size; ?>}
  57. th            {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; font-weight: bold; background-color: <?php echo $cfgThBgcolor;?>}
  58. td            {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>}
  59. form          {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>}
  60. input         {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000}
  61. select        {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000}
  62. textarea      {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; color: #000000}
  63. h1            {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_bigger; ?>; font-weight: bold}
  64. A:link        {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; text-decoration: none; color: #0000ff}
  65. A:visited     {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; text-decoration: none; color: #0000ff}
  66. A:hover       {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo $font_size; ?>; text-decoration: underline; color: #FF0000}
  67. A:link.nav    {font-family: <?php echo $right_font_family; ?>; color: #000000}
  68. A:visited.nav {font-family: <?php echo $right_font_family; ?>; color: #000000}
  69. A:hover.nav   {font-family: <?php echo $right_font_family; ?>; color: #FF0000}
  70. .nav          {font-family: <?php echo $right_font_family; ?>; color: #000000}
  71. //-->
  72. </style>
  73.  
  74. <?php
  75. $title     = '';
  76. if (isset($db)) {
  77.     $title .= str_replace('\'', '\\\'', $db);
  78. }
  79. if (isset($table)) {
  80.     $title .= (empty($title) ? '' : '.') . str_replace('\'', '\\\'', $table);
  81. }
  82. if (!empty($cfgServer) && isset($cfgServer['host'])) {
  83.     $title .= (empty($title) ? '' : ' ')
  84.            . sprintf($strRunning, (empty($cfgServer['verbose']) ? str_replace('\'', '\\\'', $cfgServer['host']) : str_replace('\'', '\\\'', $cfgServer['verbose'])));
  85. }
  86. $title     .= (empty($title) ? '' : ' - ') . 'phpMyAdmin ' . PMA_VERSION;
  87. ?>
  88. <script type="text/javascript" language="javascript">
  89. <!--
  90. // Updates the title of the frameset if possible (ns4 does not allow this)
  91. if (typeof(parent.document.title) == 'string') {
  92.     parent.document.title = '<?php echo $title; ?>';
  93. }
  94. <?php
  95. // Add some javascript instructions if required
  96. if (isset($js_to_run) && $js_to_run == 'functions.js') {
  97.     echo "\n";
  98.     ?>
  99. // js form validation stuff
  100. var errorMsg0   = '<?php echo str_replace('\'', '\\\'', $strFormEmpty); ?>';
  101. var errorMsg1   = '<?php echo str_replace('\'', '\\\'', $strNotNumber); ?>';
  102. var errorMsg2   = '<?php echo str_replace('\'', '\\\'', $strNotValidNumber); ?>';
  103. var noDropDbMsg = '<?php echo((!$cfgAllowUserDropDatabase) ? str_replace('\'', '\\\'', $strNoDropDatabases) : ''); ?>';
  104. var confirmMsg  = '<?php echo(($cfgConfirm) ? str_replace('\'', '\\\'', $strDoYouReally) : ''); ?>';
  105. //-->
  106. </script>
  107. <script src="libraries/functions.js" type="text/javascript" language="javascript"></script>
  108.     <?php
  109. } else if (isset($js_to_run) && $js_to_run == 'user_details.js') {
  110.     echo "\n";
  111.     ?>
  112. // js form validation stuff
  113. var jsHostEmpty       = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strHostEmpty']); ?>';
  114. var jsUserEmpty       = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strUserEmpty']); ?>';
  115. var jsPasswordEmpty   = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordEmpty']); ?>';
  116. var jsPasswordNotSame = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordNotSame']); ?>';
  117. //-->
  118. </script>
  119. <script src="libraries/user_details.js" type="text/javascript" language="javascript"></script>
  120.     <?php
  121. } else if (isset($js_to_run) && $js_to_run == 'indexes.js') {
  122.     echo "\n";
  123.     ?>
  124. // js index validation stuff
  125. var errorMsg0   = '<?php echo str_replace('\'', '\\\'', $strFormEmpty); ?>';
  126. var errorMsg1   = '<?php echo str_replace('\'', '\\\'', $strNotNumber); ?>';
  127. var errorMsg2   = '<?php echo str_replace('\'', '\\\'', $strNotValidNumber); ?>';
  128. //-->
  129. </script>
  130. <script src="libraries/indexes.js" type="text/javascript" language="javascript"></script>
  131.     <?php
  132. } else {
  133.     echo "\n";
  134.     ?>
  135. //-->
  136. </script>
  137.     <?php
  138. }
  139. echo "\n";
  140. ?>
  141. </head>
  142.  
  143.  
  144. <body bgcolor="<?php echo $cfgRightBgColor; ?>" background="images/bkg.gif">
  145. <?php
  146. if (isset($db)) {
  147.     echo '<h1>' . $strDatabase . ' <i>' . htmlspecialchars($db) . '</i>';
  148.     if (!empty($table)) {
  149.         echo ' - ' . $strTable . ' <i>' . htmlspecialchars($table) . '</i>';
  150.     }
  151.     echo ' ' . sprintf($strRunning, ' <i>' . (($cfgServer['verbose']) ? $cfgServer['verbose'] : $cfgServer['host']) . '</i>');
  152.     echo '</h1>' . "\n";
  153. }
  154. echo "\n";
  155. ?>
  156.