Skip to content

Commit

Permalink
Installer UI update and pre-populated steps with existing data from c…
Browse files Browse the repository at this point in the history
…onfig file.
  • Loading branch information
Alan Hartless authored and Alan Hartless committed Nov 28, 2014
1 parent e2db834 commit 6499fed
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 60 deletions.
10 changes: 10 additions & 0 deletions app/bundles/InstallBundle/Configurator/Configurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ public function isFileWritable()
*/
public function addStep(StepInterface $step)
{
//merge existing settings
$properties = get_object_vars($step);

$existing = $this->getParameters();
foreach ($properties as $p => $v) {
if (isset($existing[$p])) {
$step->$p = $existing[$p];
}
}

$this->steps[] = $step;
}

Expand Down
5 changes: 4 additions & 1 deletion app/bundles/InstallBundle/Controller/InstallController.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,10 @@ private function performDatabaseInstallation ($dbParams)

return array(
'type' => 'error',
'msg' => 'mautic.installer.error.connecting.database'
'msg' => 'mautic.installer.error.connecting.database',
'msgVars' => array(
'%exception%' => $exception->getMessage()
)
);
}

Expand Down
76 changes: 40 additions & 36 deletions app/bundles/InstallBundle/Views/Install/doctrine.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,49 +27,54 @@
<h2 class="page-header">
<?php echo $view['translator']->trans('mautic.install.heading.database.configuration'); ?>
</h2>
<p><?php echo $view['translator']->trans('mautic.install.database.introtext'); ?></p>


<?php echo $view['form']->start($form); ?>
<?php echo $view['form']->row($form['driver']); ?>

<div class="row">
<div class="col-sm-6">
<?php echo $view['form']->row($form['host']); ?>
</div>
<div class="col-sm-6">
<?php echo $view['form']->row($form['port']); ?>
<div class="panel panel-primary">
<div class="panel-heading pa-10">
<h6><?php echo $view['translator']->trans('mautic.install.database.introtext'); ?></h6>
</div>
</div>
<div class="panel-body">
<?php echo $view['form']->row($form['driver']); ?>

<div class="row">
<div class="col-sm-6">
<?php echo $view['form']->row($form['name']); ?>
</div>
<div class="col-sm-6">
<?php echo $view['form']->row($form['table_prefix']); ?>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<?php echo $view['form']->row($form['host']); ?>
</div>
<div class="col-sm-6">
<?php echo $view['form']->row($form['port']); ?>
</div>
</div>

<div class="row">
<div class="col-sm-6">
<?php echo $view['form']->row($form['user']); ?>
</div>
<div class="col-sm-6">
<?php echo $view['form']->row($form['password']); ?>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<?php echo $view['form']->row($form['name']); ?>
</div>
<div class="col-sm-6">
<?php echo $view['form']->row($form['table_prefix']); ?>
</div>
</div>

<div class="row">
<div class="col-sm-6">
<?php echo $view['form']->row($form['backup_tables']); ?>
</div>
<?php $hide = (!$form['backup_tables']->vars['data']) ? ' hide' : ''; ?>
<div class="col-sm-6<?php echo $hide; ?>" id="backupPrefix">
<?php echo $view['form']->row($form['backup_prefix']); ?>
<div class="row">
<div class="col-sm-6">
<?php echo $view['form']->row($form['user']); ?>
</div>
<div class="col-sm-6">
<?php echo $view['form']->row($form['password']); ?>
</div>
</div>

<div class="row">
<div class="col-sm-6">
<?php echo $view['form']->row($form['backup_tables']); ?>
</div>
<?php $hide = (!$form['backup_tables']->vars['data']) ? ' hide' : ''; ?>
<div class="col-sm-6<?php echo $hide; ?>" id="backupPrefix">
<?php echo $view['form']->row($form['backup_prefix']); ?>
</div>
</div>
</div>
</div>


<div class="row mt-20">
<div class="col-sm-9">
<div class="hide" id="waitMessage">
Expand All @@ -82,5 +87,4 @@
<?php echo $view['form']->row($form['buttons']); ?>
</div>
</div>

<?php echo $view['form']->end($form); ?>
53 changes: 30 additions & 23 deletions app/bundles/InstallBundle/Views/Install/user.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,40 @@
<h2 class="page-header">
<?php echo $view['translator']->trans('mautic.install.heading.user.configuration'); ?>
</h2>
<p><?php echo $view['translator']->trans('mautic.install.user.introtext'); ?></p>

<?php echo $view['form']->start($form); ?>

<div class="row">
<div class="col-sm-6">
<?php echo $view['form']->row($form['username']); ?>
<div class="panel panel-primary">
<div class="panel-heading pa-10">
<h6><?php echo $view['translator']->trans('mautic.install.user.introtext'); ?></h6>
</div>
<div class="col-sm-6">
<?php echo $view['form']->row($form['password']); ?>
</div>
</div>


<div class="row">
<div class="col-sm-6">
<?php echo $view['form']->row($form['firstname']); ?>
</div>
<div class="col-sm-6">
<?php echo $view['form']->row($form['lastname']); ?>
</div>
</div>


<div class="row">
<div class="col-sm-12">
<?php echo $view['form']->row($form['email']); ?>
<div class="panel-body">

<div class="row">
<div class="col-sm-6">
<?php echo $view['form']->row($form['username']); ?>
</div>
<div class="col-sm-6">
<?php echo $view['form']->row($form['password']); ?>
</div>
</div>


<div class="row">
<div class="col-sm-6">
<?php echo $view['form']->row($form['firstname']); ?>
</div>
<div class="col-sm-6">
<?php echo $view['form']->row($form['lastname']); ?>
</div>
</div>


<div class="row">
<div class="col-sm-12">
<?php echo $view['form']->row($form['email']); ?>
</div>
</div>
</div>
</div>

Expand Down

0 comments on commit 6499fed

Please sign in to comment.