typo3/ext/phpmyadmin/modsub/phpmyadmin-2.6.2/header.inc.php

Go to the documentation of this file.
00001 <?php
00002 /* $Id: header.inc.php,v 2.28 2005/03/23 11:51:56 lem9 Exp $ */
00003 // vim: expandtab sw=4 ts=4 sts=4:
00004 
00005 if (empty($GLOBALS['is_header_sent'])) {
00006 
00010     require_once('./libraries/common.lib.php');
00011     require_once('./libraries/ob.lib.php');
00012     if ($GLOBALS['cfg']['OBGzip']) {
00013         $GLOBALS['ob_mode'] = PMA_outBufferModeGet();
00014         if ($GLOBALS['ob_mode']) {
00015             PMA_outBufferPre($GLOBALS['ob_mode']);
00016         }
00017     }
00018 
00019     // garvin: For re-usability, moved http-headers and stylesheets
00020     // to a seperate file. It can now be included by header.inc.php,
00021     // queryframe.php, querywindow.php.
00022 
00023     require_once('./libraries/header_http.inc.php');
00024     require_once('./libraries/header_meta_style.inc.php');
00025     /* replaced 2004-05-05 by Michael Keck (mkkeck)
00026     $title     = '';
00027     if (isset($GLOBALS['db'])) {
00028         $title .= str_replace('\'', '\\\'', $GLOBALS['db']);
00029     }
00030     if (isset($GLOBALS['table'])) {
00031         $title .= (empty($title) ? '' : '.') . str_replace('\'', '\\\'', $GLOBALS['table']);
00032     }
00033     if (!empty($GLOBALS['cfg']['Server']) && isset($GLOBALS['cfg']['Server']['host'])) {
00034         $title .= (empty($title) ? 'phpMyAdmin ' : ' ')
00035                . sprintf($GLOBALS['strRunning'], (empty($GLOBALS['cfg']['Server']['verbose']) ? str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['host']) : str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['verbose'])));
00036     }
00037     $title     .= (empty($title) ? '' : ' - ') . 'phpMyAdmin ' . PMA_VERSION;
00038     */
00039     /* the new one
00040      * 2004-05-05: replaced by Michael Keck (mkkeck)
00041      */
00042     $title     = '';
00043     if ($cfg['ShowHttpHostTitle']) {
00044         $title .= (empty($GLOBALS['cfg']['SetHttpHostTitle']) && isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $GLOBALS['cfg']['SetHttpHostTitle']) . ' >> ';
00045     }
00046     if (!empty($GLOBALS['cfg']['Server']) && isset($GLOBALS['cfg']['Server']['host'])) {
00047         $title.=str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['host']);
00048     }
00049     if (isset($GLOBALS['db'])) {
00050         $title .= ' >> ' . str_replace('\'', '\\\'', $GLOBALS['db']);
00051     }
00052     if (isset($GLOBALS['table'])) {
00053         $title .= (empty($title) ? '' : ' ') . ' >> ' . str_replace('\'', '\\\'', $GLOBALS['table']);
00054     }
00055     $title .= ' | phpMyAdmin ' . PMA_VERSION;
00056     ?>
00057     <script type="text/javascript" language="javascript">
00058     <!--
00059     // Updates the title of the frameset if possible (ns4 does not allow this)
00060     if (typeof(parent.document) != 'undefined' && typeof(parent.document) != 'unknown'
00061         && typeof(parent.document.title) == 'string') {
00062         parent.document.title = '<?php echo $title; ?>';
00063     }
00064 
00065     document.write('<style type="text/css">');
00066     document.write('img.lightbulb { cursor: pointer; }');
00067     document.write('<\/style>');
00068     
00069     <?php
00070     // Add some javascript instructions if required
00071     if (isset($js_to_run) && $js_to_run == 'functions.js') {
00072         echo "\n";
00073         ?>
00074     // js form validation stuff
00075     var errorMsg0   = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strFormEmpty']); ?>';
00076     var errorMsg1   = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotNumber']); ?>';
00077     var errorMsg2   = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotValidNumber']); ?>';
00078     var noDropDbMsg = '<?php echo((!$GLOBALS['cfg']['AllowUserDropDatabase']) ? str_replace('\'', '\\\'', $GLOBALS['strNoDropDatabases']) : ''); ?>';
00079     var confirmMsg  = '<?php echo(($GLOBALS['cfg']['Confirm']) ? str_replace('\'', '\\\'', $GLOBALS['strDoYouReally']) : ''); ?>';
00080     var confirmMsgDropDB  = '<?php echo(($GLOBALS['cfg']['Confirm']) ? str_replace('\'', '\\\'', $GLOBALS['strDropDatabaseStrongWarning']) : ''); ?>';
00081     //-->
00082     </script>
00083     <script src="libraries/functions.js" type="text/javascript" language="javascript"></script>
00084         <?php
00085     } else if (isset($js_to_run) && $js_to_run == 'user_password.js') {
00086         echo "\n";
00087         ?>
00088     // js form validation stuff
00089     var jsHostEmpty       = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strHostEmpty']); ?>';
00090     var jsUserEmpty       = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strUserEmpty']); ?>';
00091     var jsPasswordEmpty   = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordEmpty']); ?>';
00092     var jsPasswordNotSame = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordNotSame']); ?>';
00093     //-->
00094     </script>
00095     <script src="libraries/user_password.js" type="text/javascript" language="javascript"></script>
00096         <?php
00097     } else if (isset($js_to_run) && $js_to_run == 'server_privileges.js') {
00098         echo "\n";
00099         ?>
00100     // js form validation stuff
00101     var jsHostEmpty       = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strHostEmpty']); ?>';
00102     var jsUserEmpty       = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strUserEmpty']); ?>';
00103     var jsPasswordEmpty   = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordEmpty']); ?>';
00104     var jsPasswordNotSame = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordNotSame']); ?>';
00105     //-->
00106     </script>
00107     <script src="libraries/server_privileges.js" type="text/javascript" language="javascript"></script>
00108         <?php
00109     } else if (isset($js_to_run) && $js_to_run == 'indexes.js') {
00110         echo "\n";
00111         ?>
00112     // js index validation stuff
00113     var errorMsg0   = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strFormEmpty']); ?>';
00114     var errorMsg1   = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotNumber']); ?>';
00115     var errorMsg2   = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotValidNumber']); ?>';
00116     //-->
00117     </script>
00118     <script src="libraries/indexes.js" type="text/javascript" language="javascript"></script>
00119         <?php
00120     } else if (isset($js_to_run) && $js_to_run == 'tbl_change.js') {
00121         echo "\n";
00122         ?>
00123     //-->
00124     </script>
00125     <script src="libraries/tbl_change.js" type="text/javascript" language="javascript"></script>
00126         <?php
00127     } else {
00128         echo "\n";
00129         ?>
00130     //-->
00131     </script>
00132         <?php
00133     }
00134     echo "\n";
00135 
00136     // Reloads the navigation frame via JavaScript if required
00137     PMA_reloadNavigation();
00138     ?>
00139         <meta name="OBGZip" content="<?php echo ($cfg['OBGzip'] ? 'true' : 'false'); ?>" />
00140     </head>
00141 
00142 
00143     <?php
00144     if ($GLOBALS['cfg']['RightBgImage'] != '') {
00145         $bkg_img = ' background="' . $GLOBALS['cfg']['RightBgImage'] . '"';
00146     } else {
00147         $bkg_img = '';
00148     }
00149     ?>
00150     <body bgcolor="<?php echo $GLOBALS['cfg']['RightBgColor'] . '"' . $bkg_img; ?>>
00151     <div id="TooltipContainer" name="TooltipContainer" onmouseover="holdTooltip();" onmouseout="swapTooltip('default');"></div>
00152     <?php
00153     include('./config.header.inc.php');
00154 
00155     if (!defined('PMA_DISPLAY_HEADING')) {
00156         define('PMA_DISPLAY_HEADING', 1);
00157     }
00158 
00163     if (PMA_DISPLAY_HEADING) {
00164         echo '<table border="0" cellpadding="0" cellspacing="0" id="serverinfo">' . "\n"
00165            . '    <tr>' . "\n";
00166         $header_url_qry = '?' . PMA_generate_common_url();
00167         $server_info = (!empty($cfg['Server']['verbose'])
00168                         ? $cfg['Server']['verbose']
00169                         : $server_info = $cfg['Server']['host'] . (empty($cfg['Server']['port'])
00170                                                                    ? ''
00171                                                                    : ':' . $cfg['Server']['port']
00172                                                                   )
00173                        );
00174         echo '        '
00175            . '<td class="serverinfo">' . $GLOBALS['strServer'] . ':&nbsp;'
00176            . '<a href="' . $GLOBALS['cfg']['DefaultTabServer'] . '?' . PMA_generate_common_url() . '">';
00177         if ($GLOBALS['cfg']['MainPageIconic']) {
00178             echo '<img src="' . $GLOBALS['pmaThemeImage'] . 's_host.png" width="16" height="16" border="0" alt="' . htmlspecialchars($server_info) . '" />';
00179         }
00180         echo htmlspecialchars($server_info) . '</a>' . "\n"
00181            . '</td>' . "\n\n";
00182 
00183         if (!empty($GLOBALS['db'])) {
00184             echo '        '
00185                . '<td class="serverinfo"><div></div></td>' . "\n" . '            '
00186                . '<td class="serverinfo">' . $GLOBALS['strDatabase'] . ':&nbsp;'
00187                . '<a href="' . $GLOBALS['cfg']['DefaultTabDatabase'] . '?' . PMA_generate_common_url($GLOBALS['db']) . '">';
00188             if ($GLOBALS['cfg']['MainPageIconic']) {
00189                 echo '<img src="' . $GLOBALS['pmaThemeImage'] . 's_db.png" width="16" height="16" border="0" alt="' . htmlspecialchars($GLOBALS['db']) . '" />';
00190             }
00191             echo htmlspecialchars($GLOBALS['db']) . '</a>' . "\n"
00192                . '</td>' . "\n\n";
00193 
00194             if (!empty($GLOBALS['table'])) {
00195                 if (PMA_MYSQL_INT_VERSION >= 50000) {
00196                     require_once('./tbl_properties_table_info.php');
00197                 } else {
00198                     $tbl_is_view = FALSE;
00199                 }
00200                 echo '        '
00201                    . '<td class="serverinfo"><div></div></td>' . "\n" . '            '
00202                    . '<td class="serverinfo">' . (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ? $GLOBALS['strView'] : $GLOBALS['strTable']) . ':&nbsp;'
00203                    . '<a href="' . $GLOBALS['cfg']['DefaultTabTable'] . '?' . PMA_generate_common_url($GLOBALS['db'], $GLOBALS['table']) . '">';
00204                 if ($GLOBALS['cfg']['MainPageIconic']) {
00205                     echo '<img src="' . $GLOBALS['pmaThemeImage'] . (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ? 'b_views' : 's_tbl') . '.png" width="16" height="16" border="0" alt="' . htmlspecialchars($GLOBALS['table']) . '" />';
00206                 }
00207                 echo htmlspecialchars($GLOBALS['table']) . '</a>' . "\n"
00208                    . '</td>' . "\n\n";
00209             }
00210         }
00211         echo '    </tr>' . "\n" . '</table>';
00212     }
00216     $GLOBALS['is_header_sent'] = TRUE;
00217 }
00218 
00219 ?>

Generated on Wed Aug 10 07:55:30 2005 for TYPO3 3.8.0 by  doxygen 1.4.3-20050530