Documentation TYPO3 par Ameos

index.php

00001 <?php
00002 /* $Id: index.php,v 2.14 2004/10/19 17:23:09 nijel Exp $ */
00003 // vim: expandtab sw=4 ts=4 sts=4:
00004 
00008 require_once('./libraries/grab_globals.lib.php');
00009 require_once('./libraries/common.lib.php');
00013 require_once('./libraries/select_theme.lib.php');
00014 
00019 // (from grab_globals)
00020 if (isset($collation_connection)) {
00021     if (!isset($pma_uri_parts)) {
00022         $pma_uri_parts = parse_url($cfg['PmaAbsoluteUri']);
00023         $cookie_path   = substr($pma_uri_parts['path'], 0, strrpos($pma_uri_parts['path'], '/'));
00024         $is_https      = (isset($pma_uri_parts['scheme']) && $pma_uri_parts['scheme'] == 'https') ? 1 : 0;
00025     }
00026     setcookie('pma_collation_connection', $collation_connection, time() + 60*60*24*30, $cookie_path, '', $is_https);
00027 }
00028 // Gets the default font sizes
00029 PMA_setFontSizes();
00030 
00031 // Gets the host name
00032 // loic1 - 2001/25/11: use the new globals arrays defined with php 4.1+
00033 if (empty($HTTP_HOST)) {
00034     if (!empty($_ENV) && isset($_ENV['HTTP_HOST'])) {
00035         $HTTP_HOST = $_ENV['HTTP_HOST'];
00036     }
00037     else if (@getenv('HTTP_HOST')) {
00038         $HTTP_HOST = getenv('HTTP_HOST');
00039     }
00040     else {
00041         $HTTP_HOST = '';
00042     }
00043 }
00047 // loic1: If left light mode -> urldecode the db name
00048 if (isset($lightm_db)) {
00049 // no longer urlencoded because of html entities in the db name
00050 //    $db    = urldecode($lightm_db);
00051     $db    = $lightm_db;
00052     unset($lightm_db);
00053 }
00054 $url_query = PMA_generate_common_url(isset($db) ? $db : '');
00055 header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
00056 
00057 require_once('./libraries/relation.lib.php');
00058 $cfgRelation = PMA_getRelationsParam();
00059 
00060 if ($cfg['QueryHistoryDB'] && $cfgRelation['historywork']) {
00061     PMA_purgeHistory($cfg['Server']['user']);
00062 }
00063 
00064 $phpmain_hash = md5($cfg['PmaAbsoluteUri']);
00065 $phpmain_hash_js = time();
00066 ?>
00067 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
00068     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
00069 <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; ?>">
00070 <head>
00071 <title>phpMyAdmin <?php echo PMA_VERSION; ?> - <?php echo $HTTP_HOST; ?></title>
00072 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" />
00073 <link rel="stylesheet" type="text/css" href="./css/phpmyadmin.css.php?lang=<?php echo $lang; ?>&amp;js_frame=right" />
00074 </head>
00075 
00076 <?php
00077 $logo_image = $GLOBALS['pmaThemeImage'] . 'logo_left.png';
00078 $query_frame_height = 0;
00079 if ($cfg['LeftDisplayLogo'] && @file_exists($logo_image)) {
00080     $tmp_imgsize = @getimagesize($logo_image);
00081     $query_frame_height = ($tmp_imgsize[1] + 60);
00082     // increase the height to take into account font size differences in
00083     // theme 'original'? (TODO: improve with a parameter in layout.inc.php)
00084     $query_frame_height += ((!isset($GLOBALS['theme']) || $GLOBALS['theme']=='original') ? 25 : 0);
00085 }
00086 if ($query_frame_height == 0) {
00087     $query_frame_height = 60;
00088 }
00089 // increase the height to take into account font size differences in
00090 // theme 'original'? (TODO: improve with a parameter in layout.inc.php)
00091 $query_frame_height += ((!isset($GLOBALS['theme']) || $GLOBALS['theme']=='original') ? 20 : 10);
00092 
00093 if ($cfg['LeftDisplayServers'] && !$cfg['DisplayServersList']) {
00094     $query_frame_height += 40;
00095 }
00096 if ($server > 0) {
00097     PMA_availableDatabases(); // this function is defined in "common.lib.php"
00098 } else {
00099     $num_dbs = 0;
00100 }
00101 if ($num_dbs > 1) {
00102     if ($cfg['LeftFrameLight']) {
00103         $query_frame_height += 20;
00104     }
00105 }
00106 if ($cfg['QueryFrame']) {
00107     /* Will we show list of servers? */
00108     if ($cfg['LeftDisplayServers'] && $cfg['DisplayServersList'] && count($cfg['Servers']) > 1) {
00109         $query_frame_height += (count($cfg['Servers']) + 1)*15;
00110     }
00111 
00112     if ($cfg['QueryFrameJS']) {
00113         echo '<script type="text/javascript">' . "\n";
00114         echo '<!--' . "\n";
00115         echo '    document.writeln(\'<frameset cols="' . $cfg['LeftWidth'] . ',*" rows="*" border="1" frameborder="1" framespacing="1" name="mainFrameset" id="mainFrameset">\');' . "\n";
00116         echo '    document.writeln(\'    <frameset rows="' . $query_frame_height . ', *" framespacing="0" frameborder="0" border="0" name="leftFrameset" id="leftFrameset">\');' . "\n";
00117         echo '    document.writeln(\'        <frame src="queryframe.php?' . $url_query . '&amp;hash=' . $phpmain_hash . $phpmain_hash_js . '" name="queryframe" frameborder="0" scrolling="no" id="leftQueryframe" />\');' . "\n";
00118         echo '    document.writeln(\'        <frame src="left.php?' . $url_query . '&amp;hash=' . $phpmain_hash . $phpmain_hash_js . '" name="nav" frameborder="0" id="leftFrame" />\');' . "\n";
00119         echo '    document.writeln(\'    </frameset>\');' . "\n";
00120         echo '    document.writeln(\'    <frame src="' . (empty($db) ? $cfg['DefaultTabServer']  : $cfg['DefaultTabDatabase']) . '?' . $url_query . '" name="phpmain' . $phpmain_hash . $phpmain_hash_js . '" border="0" frameborder="0" style="border-left: 1px solid #000000;" id="rightFrame" />\');' . "\n";
00121         echo '    document.writeln(\'    <noframes>\');' . "\n";
00122         echo '    document.writeln(\'        <body bgcolor="#FFFFFF">\');' . "\n";
00123         echo '    document.writeln(\'            <p>' . str_replace("'", "\'", $strNoFrames) . '</p>\');' . "\n";
00124         echo '    document.writeln(\'        </body>\');' . "\n";
00125         echo '    document.writeln(\'    </noframes>\');' . "\n";
00126         echo '    document.writeln(\'</frameset>\');' . "\n";
00127         echo '//-->' . "\n";
00128         echo '</script>' . "\n";
00129         echo "\n";
00130         echo '<noscript>' . "\n";
00131     }
00132 
00133     echo '<frameset cols="' . $cfg['LeftWidth'] . ',*" rows="*"  border="1" frameborder="1" framespacing="1" name="mainFrameset" id="mainFrameset">' . "\n";
00134     echo '    <frameset rows="' . $query_frame_height . ', *" framespacing="0" frameborder="0" border="0" name="leftFrameset" id="leftFrameset">' . "\n";
00135     echo '        <frame src="queryframe.php?' . $url_query . '&amp;hash=' . $phpmain_hash . '" name="queryframe" frameborder="0" scrolling="no" id="leftQueryframe" />' . "\n";
00136     echo '        <frame src="left.php?' . $url_query . '&amp;hash=' . $phpmain_hash . '" name="nav" frameborder="0" id="leftFrame" />' . "\n";
00137     echo '    </frameset>' . "\n";
00138     echo '    <frame src="' . (empty($db) ? $cfg['DefaultTabServer']  : $cfg['DefaultTabDatabase']) . '?' . $url_query . '" name="phpmain' . $phpmain_hash . '" frameborder="0" id="rightFrame" />' . "\n";
00139 
00140 } else {
00141 
00142     echo '<frameset cols="' . $cfg['LeftWidth'] . ',*" rows="*" border="1" frameborder="1" framespacing="1" id="leftFrameset" >' . "\n";
00143     echo '    <frame src="left.php?' . $url_query . '&amp;hash=' . $phpmain_hash . '" name="nav" frameborder="0" id="leftFrame" />' . "\n";
00144     echo '    <frame src="' . (empty($db) ? $cfg['DefaultTabServer']  : $cfg['DefaultTabDatabase']) . '?' . $url_query . '" name="phpmain' . $phpmain_hash . '" id="rightFrame" frameborder="1" />' . "\n";
00145 
00146 }
00147 ?>
00148 
00149     <noframes>
00150         <body bgcolor="#FFFFFF">
00151             <p><?php echo $strNoFrames; ?></p>
00152         </body>
00153     </noframes>
00154 </frameset>
00155 <?php
00156 if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
00157     echo '</noscript>' . "\n";
00158 }
00159 ?>
00160 
00161 </html>


Généré par L'expert TYPO3 avec  doxygen 1.4.6