Updated install script

Fixed CSS issues

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
This commit is contained in:
Gregory PLANCHAT 2011-12-05 18:52:05 +01:00
commit 4bb4693d2e
26 changed files with 917 additions and 330 deletions

View file

@ -0,0 +1,65 @@
<?php $session = Wootook::getSession('install')?>
<div class="install">
<h1><?php echo $this->__('Welcome to the Wootook! installer')?></h1>
<h2><?php echo $this->__('Database Config')?></h2>
<?php echo $this->getLayout()->getMessagesblock()->renderGroupedHtml()?>
<form method="post" action="?mode=install&step=2" id="form:database">
<input type="hidden" id="form_key" name="__formkey" value="<?php echo $session->getFormKey()?>" />
<p>
<label for="datbase:host"><?php echo $this->__('Database host address:')?></label>
<input type="text" id="datbase:host" name="host" value="<?php echo $this->escape($session->getFormData('host', 'localhost'))?>" />
</p>
<p>
<label for="datbase:port"><?php echo $this->__('Database host port:')?></label>
<input type="text" id="datbase:port" name="port" value="<?php echo $this->escape($session->getFormData('port', '3306'))?>" />
</p>
<p>
<label for="datbase:user"><?php echo $this->__('Database account name:')?></label>
<input type="text" id="datbase:user" name="user" value="<?php echo $this->escape($session->getFormData('user', 'u_wootook'))?>" />
</p>
<p>
<label for="datbase:password"><?php echo $this->__('Database account password:')?></label>
<input type="text" id="datbase:password" name="password" value="<?php echo $this->escape($session->getFormData('password', ''))?>" />
</p>
<p>
<label for="datbase:dbname"><?php echo $this->__('Database name:')?></label>
<input type="text" id="datbase:dbname" name="dbname" value="<?php echo $this->escape($session->getFormData('dbname', 'db_wootook'))?>" />
</p>
<p>
<label for="datbase:prefix"><?php echo $this->__('Table name prefix:')?></label>
<input type="text" id="datbase:prefix" name="prefix" value="<?php echo $this->escape($session->getFormData('prefix', 'wtk_'))?>" />
</p>
<p>
<input type="button" id="test" value="<?php echo $this->__('Test connection')?>" />
<input type="submit" value="<?php echo $this->__('Next step')?>" />
</p>
<div id="install_messages"></div>
</form>
</div>
<script type="text/javascript">
/*<![CDATA[*/
//<!--
(function($){
$('#test').click(function(e){
var formData = $('#form\\:database').serializeArray();
formData.push({name: 'test', value: 1});
$.ajax('?mode=install&step=2', {
data: formData,
type: 'post',
success: function(data){
if (!data.status) {
$('#install_messages').html('<?php echo $this->escapeJs($this->__('Ajax failure.'))?>');
} else if (data.status == 'success') {
$('#install_messages').html('<?php echo $this->escapeJs($this->__('Connection succeeded.'))?>');
} else if (data.status == 'error' && data.message) {
$('#install_messages').html('<?php echo $this->escapeJs($this->__('Connection error: '))?>' + data.message);
} else {
$('#install_messages').html('<?php echo $this->escapeJs($this->__('Ajax failure.'))?>');
}
}});
});
})(jQuery);
//-->
/*]]>*/
</script>

View file

@ -0,0 +1,30 @@
<?php $session = Wootook::getSession('install')?>
<div class="install">
<h1><?php echo $this->__('Welcome to the Wootook! installer')?></h1>
<h2><?php echo $this->__('Admin Profile Config')?></h2>
<?php echo $this->getLayout()->getMessagesblock()->renderGroupedHtml()?>
<form method="post" action="?mode=install&step=3" id="form:database">
<input type="hidden" id="form_key" name="__formkey" value="<?php echo $session->getFormKey()?>" />
<p>
<label for="account:username"><?php echo $this->__('Root admin account name:')?></label>
<input type="text" id="account:username" name="username" value="<?php echo $this->escape($session->getFormData('username', 'admin'))?>" />
</p>
<p>
<label for="account:email"><?php echo $this->__('Root admin email:')?></label>
<input type="text" id="account:email" name="email" value="<?php echo $this->escape($session->getFormData('email'))?>" />
</p>
<p>
<label for="account:email_confirm"><?php echo $this->__('Root admin email:')?></label>
<input type="text" id="account:email_confirm" name="email_confirm" value="<?php echo $this->escape($session->getFormData('email_confirm'))?>" />
</p>
<p>
<label for="account:password"><?php echo $this->__('Root admin account password:')?></label>
<input type="password" id="account:password" name="password" value="<?php echo $this->escape($session->getFormData('password'))?>" />
</p>
<p>
<label for="account:password_confirm"><?php echo $this->__('Root admin account password confirm:')?></label>
<input type="password" id="account:password_confirm" name="password_confirm" value="<?php echo $this->escape($session->getFormData('password_confirm'))?>" />
</p>
<p><input type="submit" value="<?php echo $this->__('Next step')?>" /></p>
</form>
</div>

View file

@ -7,7 +7,7 @@
<input type="hidden" id="form_key" name="__formkey" value="<?php echo $session->getFormKey()?>" />
<p>
<label for="system:url_path"><?php echo $this->__('Base URL path for the game:')?></label>
<input type="text" id="system:url_path" name="url_path" value="<?php echo $session->getFormData('url_path', Wootook::getBaseUrl())?>" />
<input type="text" id="system:url_path" name="url_path" value="<?php echo $this->escape($session->getFormData('url_path', Wootook::getBaseUrl()))?>" />
</p>
<p>
<label for="system:timezone"><?php echo $this->__('Game timezone:')?></label>

View file

@ -0,0 +1,37 @@
<?php $session = Wootook::getSession('install')?>
<div class="install">
<h1><?php echo $this->__('Welcome to the Wootook! installer')?></h1>
<h2><?php echo $this->__('Universe Config')?></h2>
<?php echo $this->getLayout()->getMessagesblock()->renderGroupedHtml()?>
<form method="post" action="?mode=install&step=3" id="form:database">
<input type="hidden" id="form_key" name="__formkey" value="<?php echo $session->getFormKey()?>" />
<p>
<label for="universe:galaxies"><?php echo $this->__('Galaxies count:')?></label>
<input type="text" id="universe:galaxies" name="galaxies" value="<?php echo $this->escape($session->getFormData('galaxies', 3))?>" />
</p>
<p>
<label for="universe:systems"><?php echo $this->__('Systems count:')?></label>
<input type="text" id="universe:systems" name="systems" value="<?php echo $this->escape($session->getFormData('systems', 100))?>" />
</p>
<p>
<label for="universe:positions"><?php echo $this->__('Positions in each system:')?></label>
<input type="text" id="universe:positions" name="positions" value="<?php echo $this->escape($session->getFormData('positions', 15))?>" />
</p>
<p>
<label for="universe:allow_spy_drone_attacks"><?php echo $this->__('Allow spy drone attacks')?></label>
<input type="checkbox" id="universe:allow_spy_drone_attacks" <?php if ($session->getFormData('allow_spy_drone_attacks', true)):?>checked="checked" <?php endif?>name="allow_spy_drone_attacks" value="1" />
</p>
<p>
<label for="universe:use_large_numbers"><?php echo $this->__('Activate large numbers handling')?></label>
<?php if (extension_loaded('bcmath')):?>
<input type="checkbox" id="universe:use_large_numbers" <?php if ($session->getFormData('use_large_numbers', true)):?>checked="checked" <?php endif?>name="use_large_numbers" value="1" />
<?php else:?>
<input type="checkbox" id="universe:use_large_numbers" <?php if ($session->getFormData('use_large_numbers', false)):?>checked="checked" <?php endif?>name="use_large_numbers" value="1" />
<span class="alert"><?php echo $this->__("'BC Math' extension is unavailable. This option will have no effect until the extension isn't active.")?></span>
<?php endif?>
</p>
<p>
<input type="submit" value="<?php echo $this->__('Next step')?>" />
</p>
</form>
</div>