code:
var installer = {
	verifyDB: true,

	handleAjaxError: function(msg, status, err) {
		error_msg= '';
		if (msg.responseText != '') {
			error_msg= msg.responseText;
		}
		installer.showError(
			'Installation Issue'+
			'
The installer couldn\'t verify your settings, possibly because your server is not correctly configured.  See the manual for information on how to correct this problem, or continue without database verification.
' +
//			'
You might want to make sure mod_rewrite is enabled and that AllowOverride is at least set to FileInfo for the directory where .htaccess resides.
'+
			'Server Response'+
			'
'+error_msg.replace(/(<([^>]+)>)/ig,"")+'
'
		);
	},

	showError: function(error) {
		$('#installerror').html(error).fadeIn();
		$('html,body').animate({scrollTop: $('#installerror').offset().top},500);
	},

	setDatabaseType: function() {
		switch($('#db_type').val()) {
			case 'mysql':
				$('.forpgsql').hide();
				$('.forsqlite').hide();
				$('.formysql').show();
				break;
			case 'pgsql':
				$('.formysql').hide();
				$('.forsqlite').hide();
				$('.forpgsql').show();
				break;
			case 'sqlite':
				$('.formysql').hide();
				$('.forpgsql').hide();
				$('.forsqlite').show();
				break;
		}
		installer.checkDBFields();
	},

	checkDBCredentials: function() {
		switch ($('#db_type').val()) {
			case 'mysql':
				installer.mysql.checkDBCredentials();
				break;
			case 'pgsql':
				installer.pgsql.checkDBCredentials();
				break;
			case 'sqlite':
				installer.sqlite.checkDBCredentials();
				break;
		}
	},

	checkDBFields: function() {
		switch ($('#db_type').val()) {
			case 'mysql':
				installer.mysql.checkDBFields();
				break;
			case 'pgsql':
				installer.pgsql.checkDBFields();
				break;
			case 'sqlite':
				installer.sqlite.checkDBFields();
				break;
		}
	},

	checkSiteConfigurationCredentials: function() {
		var installok = true;

		// If admin passwords have been entered, check if they're the same
		pass1 = $('#adminpass1');
		pass2 = $('#adminpass2');

		if ( pass1.val().length > 0 && pass2.val().length > 0 && pass1.val() == pass2.val() ) {
			pass1.parents('.inputfield').removeClass('invalid').addClass('valid');
			installok = true;
		}
		else {
			pass1.parents('.inputfield').removeClass('valid').addClass('invalid');
			installok = false;
		}

		// Check other details have been entered
		$('#sitename, #adminuser, #adminemail').each(function(){
			if ($(this).val() != '') {
				$(this).parents('.inputfield').removeClass('invalid').addClass('valid').find('.warning:visible').fadeOut();
			}
			else {
				$(this).parents('.inputfield').removeClass('valid').addClass('invalid');
				installok = false;
			}
		});

		if (installok) {
//			installer.checkDBCredentials();
			$('#siteconfiguration, #pluginactivation, #install').addClass('ready').addClass('done').children('.options').fadeIn().children('.inputfield').removeClass('invalid').addClass('valid').find('.warning:visible').fadeOut();
			$('#pluginactivation').children('.help-me').show();
			$('#submitinstall').removeAttr( 'disabled' );
		}
		else {
			$('#siteconfiguration').removeClass('done');
			$('#pluginactivation, #install').removeClass('ready').removeClass('done').children('.options').fadeOut();
			$('#pluginactivation').children('.help-me').hide();
		}
	},

	noVerify: function() {
		installer.verifyDB = false;
		installer.showError('Verification Disabled
The installer will no longer attempt to verify the database settings.
' + $('#installerror').html());
	}

}

installer.mysql = {
	checkDBFields : function() {
		if ( ( $('#mysqldatabasehost').val() == '' ) || ( $('#mysqldatabaseuser').val() == '' ) || ( $('#mysqldatabasename').val() == '' ) ) {
			$('#check_db_connection').attr('disabled', true);
			$('#mysqldatabasename, #mysqldatabasehost, #mysqldatabasepass, #mysqldatabaseuser, #tableprefix').each(function() {
				$(this).parents('.inputfield').removeClass('invalid').removeClass('valid').find('.warning:visible').fadeOut();
			});
			$('#siteconfiguration, #pluginactivation, #install').removeClass('ready').removeClass('done').children('.options').fadeOut();
			$('#siteconfiguration, #pluginactivation').children('.help-me').hide();
		}
		else {
			$('#check_db_connection').attr('disabled', false);
		}
	},

	checkDBCredentials : function() {
		if ( ( $('#mysqldatabasehost').val() != '' ) && ( $('#mysqldatabaseuser').val() != '' ) && ( $('#mysqldatabasename').val() != '' ) ) {
			if (installer.verifyDB) {
				$.ajax({
					type: 'POST',
					url: 'ajax/check_mysql_credentials',
					data: { // Ask InstallHandler::ajax_check_mysql_credentials to check the credentials
						ajax_action: 'check_mysql_credentials',
						host: $('#mysqldatabasehost').val(),
						database: $('#mysqldatabasename').val(),
						user: $('#mysqldatabaseuser').val(),
						pass: $('#mysqldatabasepass').val(),
						table_prefix: $('#tableprefix').val()
					},
					success: function(xml) {
						$('#installerror').fadeOut();
						switch($('status',xml).text()) {
						case '0': // Show warning, fade the borders and hide the next step
							$('#mysqldatabasename, #mysqldatabasehost, #mysqldatabasepass, #mysqldatabaseuser, #tableprefix').each(function() {
								$(this).parents('.inputfield').addClass('valid').removeClass('invalid').find('.warning:visible').hide();
							});
							warningtext= $('message',xml).text();
							$('id',xml).each(function() {
								$($(this).text()).parents('.inputfield').removeClass('valid').addClass('invalid').find('.warning').html(warningtext).fadeIn();
								$($(this).text()).parents('.installstep').removeClass('done')
							});
							$('#siteconfiguration, #pluginactivation, #install').removeClass('ready').removeClass('done').children('.options').fadeOut();
							$('#siteconfiguration, #pluginactivation').children('.help-me').hide();
							break;
						case '1': // Hide the warnings, highlight the borders and show the next step
							installer.mysql.validDBCredentials();
							break;
						}
					},
					error: installer.handleAjaxError
				});
			} else {
				installer.mysql.validDBCredentials();
			}
		} else {
			$('#mysqldatabasename, #mysqldatabasehost, #mysqldatabasepass, #mysqldatabaseuser, #tableprefix').each(function() {
				$(this).parents('.inputfield').removeClass('invalid').removeClass('valid').find('.warning:visible').fadeOut();
			});
			$('#siteconfiguration, #pluginactivation, #install').removeClass('ready').removeClass('done').children('.options').fadeOut();
			$('#siteconfiguration, #pluginactivation').children('.help-me').hide();
		}
	},

	validDBCredentials: function() {
		$('#mysqldatabasename, #mysqldatabasehost, #mysqldatabasepass, #mysqldatabaseuser, #tableprefix').each(function() {
			$(this).parents('.inputfield').removeClass('invalid').addClass('valid').find('.warning:visible').fadeOut();
			$(this).parents('.installstep').addClass('done');
		});
		$('#siteconfiguration').children('.options').fadeIn().addClass('ready');
		$('#siteconfiguration').children('.help-me').show();
		installer.checkSiteConfigurationCredentials();
	}
}

installer.pgsql = {
	checkDBFields : function() {
		if ( ( $('#pgsqldatabasehost').val() == '' ) || ( $('#pgsqldatabaseuser').val() == '' ) || ( $('#pgsqldatabasename').val() == '' ) ) {
			$('#check_db_connection').attr('disabled', true);
			$('#pgsqldatabasename, #pgsqldatabasehost, #pgsqldatabasepass, #pgsqldatabaseuser, #tableprefix').each(function() {
				$(this).parents('.inputfield').removeClass('invalid').removeClass('valid').find('.warning:visible').fadeOut();
			});
			$('.installstep:eq(1)').removeClass('done');
			$('#siteconfiguration, #pluginactivation, #install').removeClass('ready').removeClass('done').children('.options').fadeOut();
			$('#siteconfiguration, #pluginactivation').children('.help-me').hide();
		}
		else {
			$('#check_db_connection').attr('disabled', false);
		}
	},

	checkDBCredentials : function() {
		if ( ( $('#pgsqldatabasehost').val() != '' ) && ( $('#pgsqldatabaseuser').val() != '' ) && ( $('#pgsqldatabasename').val() != '' ) ) {
			if (installer.verifyDB) {
				$.ajax({
					type: 'POST',
					url: 'ajax/check_pgsql_credentials',
					data: { // Ask InstallHandler::ajax_check_pgsql_credentials to check the credentials
						ajax_action: 'check_pgsql_credentials',
						host: $('#pgsqldatabasehost').val(),
						database: $('#pgsqldatabasename').val(),
						user: $('#pgsqldatabaseuser').val(),
						pass: $('#pgsqldatabasepass').val(),
						table_prefix: $('#tableprefix').val()
					},
					success: function(xml) {
						$('#installerror').fadeOut();
						switch($('status',xml).text()) {
						case '0': // Show warning, fade the borders and hide the next step
							$('#pgsqldatabasename, #pgsqldatabasehost, #pgsqldatabasepass, #pgsqldatabaseuser, #tableprefix').each(function() {
								$(this).parents('.inputfield').addClass('valid').removeClass('invalid').find('.warning:visible').hide();
							});
							warningtext= $('message',xml).text();
							$('id',xml).each(function() {
								$($(this).text()).parents('.inputfield').addClass('invalid').find('.warning').html(warningtext).fadeIn();
								$($(this).text()).parents('.installstep').removeClass('done')
							});
							$('#siteconfiguration, #pluginactivation, #install').removeClass('ready').removeClass('done').children('.options').fadeOut();
							$('#siteconfiguration, #pluginactivation').children('.help-me').hide();
							break;
						case '1': // Hide the warnings, highlight the borders and show the next step
							installer.pgsql.validDBCredentials();
							break;
						}
					},
					error: installer.handleAjaxError
				});
			} else {
				installer.pgsql.validDBCredentials();
			}
		} else {
			$('#pgsqldatabasename, #pgsqldatabasehost, #pgsqldatabasepass, #pgsqldatabaseuser, #tableprefix').each(function() {
				$(this).parents('.inputfield').removeClass('invalid').removeClass('valid').find('.warning:visible').fadeOut();
			});
			$('.installstep:eq(1)').removeClass('done');
			$('#siteconfiguration, #pluginactivation, #install').removeClass('ready').removeClass('done').children('.options').fadeOut();
			$('#siteconfiguration, #pluginactivation').children('.help-me').hide();
		}
	},

	validDBCredentials: function() {
		$('#pgsqldatabasename, #pgsqldatabasehost, #pgsqldatabasepass, #pgsqldatabaseuser, #tableprefix').each(function() {
			$(this).parents('.inputfield').removeClass('invalid').addClass('valid').find('.warning:visible').fadeOut();
			$(this).parents('.installstep').addClass('done')
		});
		$('#siteconfiguration').children('.options').fadeIn().addClass('ready');
		$('#siteconfiguration').children('.help-me').show();
		installer.checkSiteConfigurationCredentials();
	}
}

installer.sqlite = {
	checkDBFields : function() {
		if ( ( $('#databasefile').val() == '' ) ) {
			$('#check_db_connection').attr('disabled', true);
			$('#databasefile, #tableprefix').each(function() {
				$(this).parents('.inputfield').removeClass('invalid').removeClass('valid').find('.warning:visible').fadeOut();
			});
			$('.installstep:eq(1)').removeClass('done');
			$('#siteconfiguration, #pluginactivation, #install').removeClass('ready').removeClass('done').children('.options').fadeOut();
			$('#siteconfiguration, #pluginactivation').children('.help-me').hide();
		}
		else {
			$('#check_db_connection').attr('disabled', false)
		}
	},

	checkDBCredentials : function() {
		if ( $('#databasefile').val() != '' ) {
			if (installer.verifyDB) {
				$.ajax({
					type: 'POST',
					url: 'ajax/check_sqlite_credentials',
					data: { // Ask InstallHandler::ajax_check_sqlite_credentials to check the credentials
						ajax_action: 'check_sqlite_credentials',
						file: $('#databasefile').val()
					},
					success: function(xml) {
						$('#installerror').fadeOut();
						switch($('status',xml).text()) {
						case '0': // Show warning, fade the borders and hide the next step
							$('#databasefile, #tableprefix').each(function() {
								$(this).parents('.inputfield').addClass('valid').removeClass('invalid').find('.warning:visible').hide();
							});
							warningtext= $('message',xml).text();
							$('id',xml).each(function() {
								$($(this).text()).parents('.inputfield').removeClass('valid').addClass('invalid').find('.warning').html(warningtext).fadeIn();
								$($(this).text()).parents('.installstep').removeClass('done')
							});
							$('#siteconfiguration, #pluginactivation, #install').removeClass('ready').removeClass('done').children('.options').fadeOut();
							$('#siteconfiguration, #pluginactivation').children('.help-me').hide();
							break;
						case '1': // Hide the warnings, highlight the borders and show the next step
							installer.sqlite.validDBCredentials();
							break;
						}
					},
					error: installer.handleAjaxError
				});
			} else {
				installer.sqlite.validDBCredentials();
			}
		} else {
			$('#databasefile, #tableprefix').each(function() {
				$(this).parents('.inputfield').removeClass('invalid').removeClass('valid').find('.warning:visible').fadeOut();
			});
			$('.installstep:eq(1)').removeClass('done');
			$('#siteconfiguration, #pluginactivation, #install').removeClass('ready').removeClass('done').children('.options').fadeOut();
			$('#siteconfiguration, #pluginactivation').children('.help-me').hide();
		}
	},

	validDBCredentials: function() {
		$('#databasefile, #tableprefix').each(function() {
			$(this).parents('.inputfield').removeClass('invalid').addClass('valid').find('.warning:visible').fadeOut();
			$(this).parents('.installstep').addClass('done')
		});
		$('#siteconfiguration').children('.options').fadeIn().addClass('ready');
		$('#siteconfiguration').children('.help-me').show();
		installer.checkSiteConfigurationCredentials();
	}
}

/* Handles the timers for verification */
var checktimer = null;
function queueTimer(timer){
	if(checktimer != null) {
		clearTimeout(checktimer);
	}
	checktimer = setTimeout(timer, 500);
}

/* Manages Plugin Activation Items */
var itemManage = {
	init: function() {
		if(!$('.item.controls input[type=checkbox]')) return;

		$('.item.controls input[type=checkbox]').change(function () {
			if($('.item.controls label').hasClass('all')) {
				itemManage.uncheckAll();
			} else {
				itemManage.checkAll();
			}
		});

		$('.item:not(.ignore):not(.controls) .checkbox input[type=checkbox]').change(function () {
			itemManage.changeItem();
		});

		itemManage.changeItem();
	},
	changeItem: function() {
		var selected = {};

		count = $('.item:not(.hidden):not(.ignore):not(.controls) .checkbox input[type=checkbox]:checked').length;

		if(count == 0) {
			$('.item.controls input[type=checkbox]').each(function() {
				this.checked = 0;
			});
			$('.item.controls label').addClass('none').removeClass('all').text('None selected');
		} else if(count == $('.item:not(.hidden):not(.ignore):not(.controls) .checkbox input[type=checkbox]').length) {
			$('.item.controls input[type=checkbox]').each(function() {
				this.checked = 1;
			});
			$('.item.controls label').removeClass('none').addClass('all').text('All selected');
		} else {
			$('.item.controls input[type=checkbox]').each(function() {
				this.checked = 0;
			});
			$('.item.controls label').removeClass('none').removeClass('all').text(count + ' selected');
		}
	},
	uncheckAll: function() {
		$('.item:not(.hidden):not(.ignore):not(.controls) .checkbox input[type=checkbox]').each(function() {
			this.checked = 0;
		});
		itemManage.changeItem();
	},
	checkAll: function() {
		$('.item:not(.hidden):not(.ignore):not(.controls) .checkbox input[type=checkbox]').each(function() {
			this.checked = 1;
		});
		itemManage.changeItem();
	}
}

$(document).ready(function() {
	$('.help-me').click(function(){$(this).parents('.installstep').find('.help').slideToggle();return false;});
	$('.help').hide();
	$('.installstep').removeClass('ready');
	$('.installstep:eq(0), .installstep:eq(1)').addClass('ready');
	// Table Prefix is optional, it is always OK
	$('#tableprefix').parents('.inputfield').addClass('valid');
	$('.javascript-disabled').hide();
	$('#installform').before('

');
	$('#installerror').hide();
	$('form').attr('autocomplete', 'off');
	itemManage.init();
	installer.setDatabaseType();
//	installer.checkDBFields();
	$('#db_type').change(installer.setDatabaseType);
	$('#databasesetup input').keyup(function(){queueTimer(installer.checkDBFields)});
	$('#check_db_connection').click(function(){installer.checkDBCredentials()});
	$('#siteconfiguration input').keyup(function(){queueTimer(installer.checkSiteConfigurationCredentials)});
	$('#locale').focus().change(function() { $('#locale-form').submit();	});
});


code:
<?php include( 'header.php' ); ?>

<form action="" method="post">
<input type="hidden" name="locale" value="<?php echo Utils::htmlspecialchars($locale); ?>">

.htaccess(<?php _e('help'); ?>)

			<?php printf(_t('Your .htaccess file is not writable. In order to secure your SQLite database, please paste the following into %s:'), HABARI_PATH . '/.htaccess'); ?>

			<textarea class="config"><?php echo $sqlite_contents; ?></textarea>

				<?php _e('Your SQLite database is a file on your server like any other file. You can enhance it\'s security by including a section in your .htaccess file that disallows access to it by readers on the web. Habari is not able to write this section in your .htaccess file automatically, so you must add this section yourself to gain the enhanced security it offers you.'); ?>
				<a onclick="this.target='_blank';" href="<?php Site::out_url( 'habari' ); ?>/manual/index.html#Installation"><?php _e('Learn More...'); ?>

<?php _e('Install'); ?>

<?php _e('When you have successfully placed the .htaccess file, run the installer again.'); ?>

			<input type="submit" name="submit" value="<?php _e('Restart Installer'); ?>" />

</form>

<?php include( 'footer.php' ); ?>

repo_name: DaSourcerer/habari


code:
/* @override style.css */

/* Force vertical scrollbars so that revealing help or errors don't move the form to the left */
html { height: 100%; margin-bottom: 1px; overflow-y: scroll}

body {
	font-family: 'Helvetica Neue', Helvetica, Arial, Sans-Serif;
	padding: 0;
	margin: 0;
	}

#installer {
	text-align: center;
	min-width: 600px;
	background: #f1f1f1;
	}

a {
	color: #999;
	}

#wrapper {
	width: 552px;
	margin: 0 auto 50px;
	}

#masthead {
	margin: 30px 0;
	}

#masthead h1 {
	font-size: 35px;
	line-height: 35px;
	color: #333;
	margin-bottom: 0px;
	text-transform: lowercase;
	}

#masthead p {
	font-size: 11px;
	text-transform: lowercase;
	color: #666;
	margin: 0px;
	}

.installstep {
	width: 552px;
	background: url(images/install-step.png) scroll repeat-y 0px 47px;
	margin-top: 20px;
	position: relative;
	}

.installstep.done {
	background: url(images/install-step_done.png) scroll repeat-y 0px 47px;
	}

.installstep h2 {
	color: #333;
	line-height: 30px;
	font-size: 18px;
	background: url(images/install-step_h2.png) scroll no-repeat top left;
	font-weight: normal;
	padding: 10px 22px 0px;
	margin: 0px;
	}

.installstep.done h2 {
	background: url(images/install-step_h2_done.png) scroll no-repeat top left;
	}

.help-me {
	float: right;
	position: absolute;
	top: 20px;
	right: 25px;
	display: none;
	height: 15px;
	width: 15px;
	text-indent: -3000px;
	background: url(../admin/images/help_icon.png) scroll no-repeat top left;
	outline: none;
	}
.ready .help-me {
	display:block;
}
.help-me:hover {
	background: url(../admin/images/help_icon_over.png) scroll no-repeat top left;
	}

.options, .advanced-options {
	text-align: left;
	font-size: 0.76em;
	padding: 0px 11px 0px 22px;
	}

.options {
	background: url(images/options.png) scroll no-repeat 0px 0px;
	}

.installstep.done .options {
	background: url(images/options_done.png) scroll no-repeat 0px 0px;
	}

.installstep .options, .installstep .advanced-options, .installstep h2 .help-me {
	display: none;
	}

.installstep.ready .options, .installstep.ready .advanced-options, .installstep.ready h2 .help-me {
	display: block;
	}

.options .inputfield, .advanced-options .inputfield {
	margin-bottom: 5px;
	padding-top: 15px;
	}

div.javascript-disabled {
	width: 440px;
	color: #666666;
	padding: 10px 15px;
	margin: 0px 5px 0px 15px;
	border: 1px solid #dedede;
	background: #f1f1f1;
	text-align: center;
	}

.inputfield label, .item label {
	color: #666;
	}

.inputfield label {
	padding: 3px 20px 0 0;
	display: block;
	width: 122px;
	float: left;
	}

.inputfield label strong {
	color: #FF0000;
	}

.inputfield select {
	width: 336px;
	}

.inputfield input {
	width: 329px;
	padding-left: 2px
	}

#sitename {
	font-weight: bold;
	}

.inputfield .status {
	position: relative;
	top: 2px;
	width: 34px;
	height: 15px;
	}

.valid .status {
	background: url(images/ok.png);
	}

.invalid .status {
        background: url(images/warningsmall.png) no-repeat center;
	}

.inputfield .warning {
	display: block;
	padding: 3px 45px 0px 145px;
	line-height: 120%;
	text-align: left;
	color: #cc0000;
	}

.inputfield .help {

/* display: none; */
	padding: 10px 45px 10px 145px;
	color: #666;
	font-size: 11px;
	line-height: 15px;
	}

.inputfield .config {
	width: 507px;
	height: 150px;
	margin: 10px 0px 0px
	}

.installstep .bottom {
	height: 10px;
	background: url(images/options_bottom.png) scroll no-repeat left bottom;
	}

.installstep.done .bottom {
	height: 15px;
	background: url(images/options_bottom_done.png) scroll no-repeat left bottom;
	}

.installstep.ready .bottom {
	height: 15px;
	}

.next-section {
	height: 14px;
	width: 100%;
	margin: 20px 0px 0px 0px;
	background: url(images/next-section.png) scroll no-repeat center bottom;
	}

.inputfield.submit p {
	display: none;
	}

.submit {
	text-align: center;
	}

.submit input {
	width: 40%;
	margin: 0 0 10px;
	}

#check_db_connection {
	margin-left: 180px;
	width: 50%;
	}

.error {
	padding: .8em;
	margin-bottom: 1em;
	border: 2px solid #ddd;
	background: #FBE3E4;
	border-color: #FBC2C4;
	}

.error, .error a {
	color: #D12F19;
	}

#footer a {
	font-size: 11px !important;
	text-transform: lowercase;
	color: #999;
	padding: 0 3px;
	}

#footer a:hover {
	color: #666;
	}

/* item selection */
.items div.item {
	padding:5px 0;
}

.items span.checkbox {
	position:absolute;
}

.items label {
	position:relative;
	top:3px;
}

.items label, .items div.help {
	padding-left:30px;
}

.items .controls {
	margin-top:20px;
}

.items .controls label {
	color:#888888;
}

optgroup {
	font-style: normal;
	color: #aaaaaa;
	font-weight: normal;
	padding-left: 3px;
}


code:
<?php

/**
 * InstallerTheme is a custom Theme class for the installer.
 *
 * @package Habari
 */

// We must tell Habari to use MyTheme as the custom theme class:
define( 'THEME_CLASS', 'InstallerTheme' );

/**
 * A custom theme for the installer
 */
class InstallerTheme extends Theme
{

/**
	 * Add additional template variables to the template output.
	 * For the installer, we don't want any extra template variables added.
	 *
	 */
	public function add_template_vars()
	{

	}

}

?>