initialize step 2

This commit is contained in:
Manuel Raynaud
2013-09-02 19:56:34 +02:00
parent 73508028b4
commit 50e585044f
4 changed files with 45 additions and 2 deletions

View File

@@ -8,4 +8,8 @@
<default key="_controller">Thelia\Controller\Install\InstallController::index</default>
</route>
<route id="home" path="/install/step/2" >
<default key="_controller">Thelia\Controller\Install\InstallController::checkPermission</default>
</route>
</routes>

View File

@@ -179,7 +179,7 @@ class BaseController extends ContainerAware
*/
public function redirect($url)
{
Redirect::exec($url);
Redirect::exec(URL::absoluteUrl($url));
}
/**

View File

@@ -23,6 +23,7 @@
namespace Thelia\Controller\Install;
use Thelia\Install\BaseInstall;
use Thelia\Install\CheckPermission;
/**
* Class InstallController
@@ -33,6 +34,36 @@ class InstallController extends BaseInstallController {
public function index()
{
$this->verifyStep(1);
$this->getSession()->set("step", 1);
$this->render("index.html");
}
public function checkPermission()
{
$this->verifyStep(2);
$permission = new CheckPermission();
}
protected function verifyStep($step)
{
$session = $this->getSession();
if ($session->has("step")) {
$sessionStep = $session->get("step");
} else {
return true;
}
switch($step) {
case "1" :
if ($sessionStep > 1) {
$this->redirect("/install/step/2");
}
break;
}
}
}

View File

@@ -1,4 +1,12 @@
{extends file="layout.html"}
{block name="content"}
Hello World !
<h1>{intl l="Thelia installation wizard"}</h1>
<br />
{intl l="Bienvenue au sein du programme d'installation de Thelia."}<br />
{intl l="Nous allons vous guider tout au long de ce processus afin d'installer l'application sur votre système."}<br /><br />
<form action="{url path="/install/step/2" }" method="post">
<input type="submit" value="Continuer" />
</form>
{/block}