Documentation TYPO3 par Ameos

select_server.lib.php

00001 <?php
00002 /*
00003  * Code for displaying server selection written by nijel
00004  * $Id: select_server.lib.php,v 2.4 2004/12/26 21:46:45 lem9 Exp $
00005  */
00006 
00007 if (count($cfg['Servers']) > 1) {
00008     if (!$cfg['DisplayServersList']) {
00009     ?>
00010     <form method="post" action="index.php" target="_parent" style="margin: 0px; padding: 0px;">
00011     <?php
00012     }
00013     if ($show_server_left) {
00014         echo '<div class="heada">' . $strServer . ':</div>';
00015     } else {
00016     ?>
00017 <!-- MySQL servers choice form -->
00018 <table border="0" cellpadding="3" cellspacing="0" bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
00019     <tr>
00020         <th class="tblHeaders"><?php echo $strServerChoice; ?></th>
00021     </tr>
00022     <tr>
00023         <td>
00024     <?php
00025     }
00026     if (!$cfg['DisplayServersList']) {
00027     ?>
00028     <form method="post" action="index.php" target="_parent" style="margin: 0px; padding: 0px;">
00029         <select name="server" onchange="this.form.submit();">
00030     <?php
00031     }
00032     foreach ($cfg['Servers'] AS $key => $val) {
00033         if (!empty($val['host'])) {
00034              $selected = 0;
00035             if (!empty($server) && ($server == $key)) {
00036                 $selected = 1;
00037             }
00038             if (!empty($val['verbose'])) {
00039                 $label = $val['verbose'];
00040             } else {
00041                 $label = $val['host'];
00042                 if (!empty($val['port'])) {
00043                     $label .= ':' . $val['port'];
00044                 }
00045             }
00046             // loic1: if 'only_db' is an array and there is more than one
00047             //        value, displaying such informations may not be a so good
00048             //        idea
00049             if (!empty($val['only_db'])) {
00050                 $label .= ' - ' . (is_array($val['only_db']) ? implode(', ', $val['only_db']) : $val['only_db']);
00051             }
00052             if (!empty($val['user']) && ($val['auth_type'] == 'config')) {
00053                 $label .= '  (' . $val['user'] . ')';
00054             }
00055 
00056             if ($cfg['DisplayServersList']){
00057                 if ($selected && !$show_server_left) {
00058                     echo '&raquo; <b>' . $label . '</b><br />';
00059                 }else{
00060                     echo '&raquo; <a class="item" href="index.php?server=' . $key . '&amp;lang=' . $lang . '&amp;convcharset=' . $convcharset . '" target="_top">' . $label . '</a><br />';
00061                 }
00062             } else {
00063                 echo '                <option value="' . $key . '" ' . ($selected ? ' selected="selected"' : '') . '>' . $label . '</option>' . "\n";
00064             }
00065 
00066         } // end if (!empty($val['host']))
00067     } // end while
00068 
00069     if (!$cfg['DisplayServersList']){
00070 ?>
00071         </select>
00072         <input type="hidden" name="lang" value="<?php echo $lang; ?>" />
00073         <input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
00074         <input type="submit" value="<?php echo $strGo; ?>" />
00075     </form>
00076 <?php
00077     }
00078     if (!$show_server_left) {
00079     ?>
00080         </td>
00081     </tr>
00082 </table>
00083 <br />
00084 <?php
00085     } else {
00086         echo '<hr />' . "\n";
00087     }
00088 }
00089 ?>


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