install/includes/stages/database.php
changeset 348 87e08a6e4fec
child 536 218a627eb53e
equal deleted inserted replaced
347:299a90e28abc 348:87e08a6e4fec
       
     1 <?php
       
     2 
       
     3 /*
       
     4  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
       
     5  * Version 1.1.1
       
     6  * Copyright (C) 2006-2007 Dan Fuhry
       
     7  * Installation package
       
     8  * database.php - Installer database driver selection stage
       
     9  *
       
    10  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
       
    11  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
       
    12  *
       
    13  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
       
    14  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
       
    15  */
       
    16 
       
    17 if ( !defined('IN_ENANO_INSTALL') )
       
    18   die();
       
    19 
       
    20 echo '<h3>' . $lang->get('database_driver_heading') . '</h3>';
       
    21 echo '<p>' . $lang->get('database_driver_intro') . '</p>';
       
    22 if ( @file_exists('/etc/enano-is-virt-appliance') )
       
    23 {
       
    24   echo '<p>' . $lang->get('database_driver_msg_virt_appliance') . '</p>';
       
    25 }
       
    26 
       
    27 $mysql_disable_reason = '';
       
    28 $pgsql_disable_reason = '';
       
    29 $mysql_disable = '';
       
    30 $pgsql_disable = '';
       
    31 if ( !function_exists('mysql_connect') )
       
    32 {
       
    33   $mysql_disable = ' disabled="disabled"';
       
    34   $mysql_disable_reason = $lang->get('database_driver_err_no_mysql');
       
    35 }
       
    36 if ( !function_exists('pg_connect') )
       
    37 {
       
    38   $pgsql_disable = ' disabled="disabled"';
       
    39   $pgsql_disable_reason = $lang->get('database_driver_err_no_pgsql');
       
    40 }
       
    41 
       
    42 echo '<form action="install.php?stage=database" method="post" enctype="multipart/form-data">';
       
    43 echo '<input type="hidden" name="language" value="' . $lang_id . '" />';
       
    44 ?>
       
    45 <table border="0" cellspacing="5">
       
    46   <tr>
       
    47     <td>
       
    48       <?php 
       
    49       if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ):
       
    50       ?>
       
    51       <input type="radio" checked="checked" name="driver" value="mysql" <?php echo $mysql_disable; ?>/>
       
    52       <?php
       
    53       else:
       
    54       ?>
       
    55       <button name="driver" value="mysql"<?php echo $mysql_disable; ?>>
       
    56         <img src="../images/about-powered-mysql.png" />
       
    57       </button>
       
    58       <?php
       
    59       endif;
       
    60       ?>
       
    61     </td>
       
    62     <td<?php if ( $mysql_disable ) echo ' style="opacity: 0.5; filter: alpha(opacity=50);"'; ?>>
       
    63       <b><?php echo $lang->get('database_driver_mysql'); ?></b><br />
       
    64       <?php echo $lang->get('database_driver_mysql_intro'); ?>
       
    65       <?php
       
    66       if ( $mysql_disable )
       
    67       {
       
    68         echo "<br /><br /><b>$mysql_disable_reason</b>";
       
    69       }
       
    70       ?>
       
    71     </td>
       
    72   </tr>
       
    73   <tr>
       
    74     <td>
       
    75       <?php
       
    76       if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ):
       
    77       ?>
       
    78       <input type="radio" name="driver" value="mysql" <?php echo $pgsql_disable; ?>/>
       
    79       <?php
       
    80       else:
       
    81       ?>
       
    82       <button name="driver" value="postgresql"<?php echo $pgsql_disable; ?>>
       
    83         <img src="../images/about-powered-pgsql.png" />
       
    84       </button>
       
    85       <?php
       
    86       endif;
       
    87       ?>
       
    88     </td>
       
    89     <td<?php if ( $pgsql_disable ) echo ' style="opacity: 0.5; filter: alpha(opacity=50);"'; ?>>
       
    90       <b><?php echo $lang->get('database_driver_pgsql'); ?></b><br />
       
    91       <?php echo $lang->get('database_driver_pgsql_intro'); ?>
       
    92       <?php
       
    93       if ( $pgsql_disable )
       
    94       {
       
    95         echo "<br /><br /><b>$pgsql_disable_reason</b>";
       
    96       }
       
    97       ?>
       
    98     </td>
       
    99   </tr>
       
   100 </table>
       
   101 
       
   102 <?php
       
   103 if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') )
       
   104 {
       
   105   echo '<div style="text-align: center;">
       
   106           <input type="submit" />
       
   107         </div>';
       
   108 }
       
   109 
       
   110 echo '</form>';