Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
install.php tweaks
- code cleanup
- UI improvements
- correct behavior in case of invalid install step
  • Loading branch information
dregad committed Jan 17, 2015
2 parents e7e2b55 + c205169 commit d92b11a
Showing 1 changed file with 22 additions and 29 deletions.
51 changes: 22 additions & 29 deletions admin/install.php
Expand Up @@ -105,14 +105,17 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
?>

<body>
<table width="100%" cellspacing="0" cellpadding="0" bgcolor="#ffffff">
<table width="100%" cellspacing="0" cellpadding="0">
<tr class="top-bar">
<td class="links">
[ <a href="index.php">Back to Administration</a> ]
</td>
<td class="title">
<?php
switch( $t_install_state ) {
case 7:
echo 'Installation Complete';
break;
case 6:
echo 'Post Installation Checks';
break;
Expand All @@ -133,6 +136,7 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
break;
case 0:
default:
$t_install_state = 0;
echo 'Pre-Installation Check';
break;
}
Expand All @@ -143,12 +147,14 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
<br /><br />

<?php
if( 0 == $t_install_state ) {
# installation checks table header is valid both for pre-install and
# database installation steps
if( 0 == $t_install_state || 2 == $t_install_state ) {
?>
<table width="100%" bgcolor="#222222" cellpadding="10" cellspacing="1">
<table width="100%" cellpadding="10" cellspacing="1">
<tr>
<td bgcolor="#e8e8e8" colspan="2">
<span class="title">Checking Installation...</span>
<span class="title">Checking Installation</span>
</td>
</tr>
<?php
Expand Down Expand Up @@ -333,8 +339,6 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
if( 2 == $t_install_state ) {
?>

<table width="100%" cellpadding="10" cellspacing="1">

<!-- Checking DB support-->
<?php
print_test( 'Setting Database Type', '' !== $f_db_type, true, 'database type is blank?' );
Expand Down Expand Up @@ -486,6 +490,7 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
print_test_result( ( '' == $t_error ) && ( '' == $t_warning ), ( '' != $t_error ), $t_error . ' ' . $t_warning );
?>
</tr>
</table>
<?php
}?>
</table>
Expand All @@ -512,7 +517,7 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
<span class="title">
<?php echo
( $g_database_upgrade ? 'Upgrade Options' : 'Installation Options' ),
( $g_failed ? ': Checks Failed... ' : '' )
( $g_failed ? ': Checks Failed ' : '' )
?>
</span>
</td>
Expand Down Expand Up @@ -1059,20 +1064,8 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes

<tr>
<td bgcolor="#ffffff">
<?php
if( !$t_config_exists ) {
?>
Creating Configuration File (config/config_inc.php)<br />
<span class="error-msg">
(if this file is not created, create it manually with the contents below)
</span>
<?php
} else {
?>
Updating Configuration File (config/config_inc.php)<br />
<?php
}
?>
<?php echo ( $t_config_exists ? 'Updating' : 'Creating' ); ?>
Configuration File (config/config_inc.php)<br />
</td>
<?php
# Generating the config_inc.php file
Expand Down Expand Up @@ -1165,8 +1158,8 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
<tr>
<td>
Please add the following lines to
'<?php echo $g_absolute_path; ?>config_inc.php'
before continuing to the database upgrade check:
<em>'<?php echo $g_absolute_path; ?>config_inc.php'</em>
before continuing:
</td>
</tr>
<tr>
Expand Down Expand Up @@ -1195,10 +1188,10 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes

# post install checks
?>
<table width="100%" bgcolor="#222222" cellpadding="10" cellspacing="1">
<table width="100%" cellpadding="10" cellspacing="1">
<tr>
<td bgcolor="#e8e8e8" colspan="2">
<span class="title">Checking Installation...</span>
<span class="title">Checking Installation</span>
</td>
</tr>

Expand Down Expand Up @@ -1299,10 +1292,10 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes
if( 7 == $t_install_state ) {
# cleanup and launch upgrade
?>
<table width="100%" bgcolor="#222222" cellpadding="10" cellspacing="1">
<table width="100%" cellpadding="10" cellspacing="1">
<tr>
<td bgcolor="#e8e8e8" colspan="2">
<span class="title">Installation Complete...</span>
<span class="title">Installation Complete</span>
</td>
</tr>
<tr bgcolor="#ffffff">
Expand All @@ -1325,10 +1318,10 @@ function print_test( $p_test_description, $p_result, $p_hard_fail = true, $p_mes

if( $g_failed && $t_install_state != 1 ) {
?>
<table width="100%" bgcolor="#222222" cellpadding="10" cellspacing="1">
<table width="100%" cellpadding="10" cellspacing="1">
<tr>
<td bgcolor="#e8e8e8" colspan="2">
<span class="title">Installation Failed...</span>
<span class="title">Installation Failed</span>
</td>
</tr>
<tr>
Expand Down

0 comments on commit d92b11a

Please sign in to comment.