Documentation TYPO3 par Ameos

header.inc.php

00001 <?php
00002 /* $Id: header.inc.php,v 2.31.2.1 2005/09/05 22:09:08 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 PMA_sanitize($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 noDropDbMsg = '<?php echo((!$GLOBALS['cfg']['AllowUserDropDatabase']) ? str_replace('\'', '\\\'', $GLOBALS['strNoDropDatabases']) : ''); ?>';
00078     var confirmMsg  = '<?php echo(($GLOBALS['cfg']['Confirm']) ? str_replace('\'', '\\\'', $GLOBALS['strDoYouReally']) : ''); ?>';
00079     var confirmMsgDropDB  = '<?php echo(($GLOBALS['cfg']['Confirm']) ? str_replace('\'', '\\\'', $GLOBALS['strDropDatabaseStrongWarning']) : ''); ?>';
00080     //-->
00081     </script>
00082     <script src="libraries/functions.js" type="text/javascript" language="javascript"></script>
00083         <?php
00084     } else if (isset($js_to_run) && $js_to_run == 'user_password.js') {
00085         echo "\n";
00086         ?>
00087     // js form validation stuff
00088     var jsHostEmpty       = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strHostEmpty']); ?>';
00089     var jsUserEmpty       = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strUserEmpty']); ?>';
00090     var jsPasswordEmpty   = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordEmpty']); ?>';
00091     var jsPasswordNotSame = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordNotSame']); ?>';
00092     //-->
00093     </script>
00094     <script src="libraries/user_password.js" type="text/javascript" language="javascript"></script>
00095         <?php
00096     } else if (isset($js_to_run) && $js_to_run == 'server_privileges.js') {
00097         echo "\n";
00098         ?>
00099     // js form validation stuff
00100     var jsHostEmpty       = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strHostEmpty']); ?>';
00101     var jsUserEmpty       = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strUserEmpty']); ?>';
00102     var jsPasswordEmpty   = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordEmpty']); ?>';
00103     var jsPasswordNotSame = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strPasswordNotSame']); ?>';
00104     //-->
00105     </script>
00106     <script src="libraries/server_privileges.js" type="text/javascript" language="javascript"></script>
00107         <?php
00108     } else if (isset($js_to_run) && $js_to_run == 'indexes.js') {
00109         echo "\n";
00110         ?>
00111     // js index validation stuff
00112     var errorMsg0   = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strFormEmpty']); ?>';
00113     var errorMsg1   = '<?php echo str_replace('\'', '\\\'', $GLOBALS['strNotNumber']); ?>';
00114     //-->
00115     </script>
00116     <script src="libraries/indexes.js" type="text/javascript" language="javascript"></script>
00117         <?php
00118     } else if (isset($js_to_run) && $js_to_run == 'tbl_change.js') {
00119         echo "\n";
00120         ?>
00121     //-->
00122     </script>
00123     <script src="libraries/tbl_change.js" type="text/javascript" language="javascript"></script>
00124         <?php
00125     } else {
00126         echo "\n";
00127         ?>
00128     //-->
00129     </script>
00130         <?php
00131     }
00132     echo "\n";
00133 
00134     // Reloads the navigation frame via JavaScript if required
00135     PMA_reloadNavigation();
00136     ?>
00137         <meta name="OBGZip" content="<?php echo ($cfg['OBGzip'] ? 'true' : 'false'); ?>" />
00138     </head>
00139 
00140 
00141     <?php
00142     if ($GLOBALS['cfg']['RightBgImage'] != '') {
00143         $bkg_img = ' background="' . $GLOBALS['cfg']['RightBgImage'] . '"';
00144     } else {
00145         $bkg_img = '';
00146     }
00147     ?>
00148     <body bgcolor="<?php echo $GLOBALS['cfg']['RightBgColor'] . '"' . $bkg_img; ?>>
00149     <div id="TooltipContainer" name="TooltipContainer" onmouseover="holdTooltip();" onmouseout="swapTooltip('default');"></div>
00150     <?php
00151     include('./config.header.inc.php');
00152 
00153     if (!defined('PMA_DISPLAY_HEADING')) {
00154         define('PMA_DISPLAY_HEADING', 1);
00155     }
00156 
00161     if (PMA_DISPLAY_HEADING) {
00162         $server_info = (!empty($GLOBALS['cfg']['Server']['verbose'])
00163                         ? $GLOBALS['cfg']['Server']['verbose']
00164                         : $GLOBALS['cfg']['Server']['host'] . (empty($GLOBALS['cfg']['Server']['port'])
00165                                                                ? ''
00166                                                                : ':' . $GLOBALS['cfg']['Server']['port']
00167                                                               )
00168                        );
00169         $item = '<a href="%1$s?%2$s" class="item">';
00170         if ( $GLOBALS['cfg']['NavigationBarIconic'] ) {
00171             $separator = '        <span class="separator"><img src="' . $GLOBALS['pmaThemeImage'] . 'item_ltr.png" width="5" height="9" alt="-" /></span>' . "\n";
00172             $item .= '        <img src="' . $GLOBALS['pmaThemeImage'] . '%5$s" width="16" height="16" alt="" border="0" /> ' . "\n";
00173         } else {
00174             $separator = '        <span class="separator"> - </span>' . "\n";
00175         }
00176 
00177         if ( $GLOBALS['cfg']['NavigationBarIconic'] !== true ) {
00178             $item .= '%4$s: ';
00179         }
00180         $item .= '%3$s</a>' . "\n";
00181         
00182         echo '<div id="serverinfo">' . "\n";
00183         printf( $item,
00184                 $GLOBALS['cfg']['DefaultTabServer'],
00185                 PMA_generate_common_url(),
00186                 htmlspecialchars($server_info),
00187                 $GLOBALS['strServer'],
00188                 's_host.png' );
00189         
00190         if (!empty($GLOBALS['db'])) {
00191             
00192             echo $separator;
00193             printf( $item,
00194                     $GLOBALS['cfg']['DefaultTabDatabase'],
00195                     PMA_generate_common_url($GLOBALS['db']),
00196                     htmlspecialchars($GLOBALS['db']),
00197                     $GLOBALS['strDatabase'],
00198                     's_db.png' );
00199             
00200             if (!empty($GLOBALS['table'])) {
00201                 require_once('./tbl_properties_table_info.php');
00202 
00203                 echo $separator;
00204                 printf( $item,
00205                         $GLOBALS['cfg']['DefaultTabTable'],
00206                         PMA_generate_common_url($GLOBALS['db'], $GLOBALS['table']),
00207                         htmlspecialchars($GLOBALS['table']),
00208                         (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ? $GLOBALS['strView'] : $GLOBALS['strTable']),
00209                         (isset($GLOBALS['tbl_is_view']) && $GLOBALS['tbl_is_view'] ? 'b_views' : 's_tbl') . '.png' );
00210                                 
00216                 if (!empty($show_comment) && !isset($GLOBALS['avoid_show_comment'])) {
00217                     if (strstr($show_comment, '; InnoDB free')) {
00218                         $show_comment = preg_replace('@; InnoDB free:.*?$@' , '', $show_comment);
00219                     }
00220                     echo '<!-- Table comment -->' . "\n"
00221                        . '<span class="table_comment" id="span_table_comment">&quot;' .  htmlspecialchars($show_comment) . '&quot</span>' . "\n";
00222                 } // end if
00223             }
00224         }
00225         echo '</div>';
00226         
00227     }
00231     $GLOBALS['is_header_sent'] = TRUE;
00232 }
00233 
00234 ?>


Généré par TYPO3 Ameos avec  doxygen 1.4.6