// Set shop name entered during install instead of Default
This commit is contained in:
1 parent
6e7cfff962
commit
808c1b344d
2 files changed
+15
-5
No files matched your search
@@ -29,6 +29,11 @@ class InstallControllerHttpProcess extends InstallControllerHttp
|
|||||||
{
|
{
|
||||||
const SETTINGS_FILE = 'config/settings.inc.php';
|
const SETTINGS_FILE = 'config/settings.inc.php';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var InstallModelInstall
|
||||||
|
*/
|
||||||
|
protected $model_install;
|
||||||
|
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
require_once _PS_INSTALL_MODELS_PATH_.'install.php';
|
require_once _PS_INSTALL_MODELS_PATH_.'install.php';
|
||||||
@@ -101,7 +106,11 @@ class InstallControllerHttpProcess extends InstallControllerHttp
|
|||||||
$this->initializeContext();
|
$this->initializeContext();
|
||||||
|
|
||||||
// @todo remove true in populateDatabase for 1.5.0 RC version
|
// @todo remove true in populateDatabase for 1.5.0 RC version
|
||||||
if (!$this->model_install->populateDatabase(true) || $this->model_install->getErrors())
|
$result = $this->model_install->populateDatabase(true, array(
|
||||||
|
'shop_name' => $this->session->shop_name
|
||||||
|
));
|
||||||
|
|
||||||
|
if (!$result || $this->model_install->getErrors())
|
||||||
$this->ajaxJsonAnswer(false, $this->model_install->getErrors());
|
$this->ajaxJsonAnswer(false, $this->model_install->getErrors());
|
||||||
$this->session->xml_loader_ids = $this->model_install->xml_loader_ids;
|
$this->session->xml_loader_ids = $this->model_install->xml_loader_ids;
|
||||||
$this->ajaxJsonAnswer(true);
|
$this->ajaxJsonAnswer(true);
|
||||||
|
|||||||
@@ -143,13 +143,14 @@ class InstallModelInstall extends InstallAbstractModel
|
|||||||
* PROCESS : populateDatabase
|
* PROCESS : populateDatabase
|
||||||
* Populate database with default data
|
* Populate database with default data
|
||||||
*/
|
*/
|
||||||
public function populateDatabase($clear_database = false)
|
public function populateDatabase($clear_database = false, array $params = array())
|
||||||
{
|
{
|
||||||
if ($clear_database)
|
if ($clear_database)
|
||||||
$this->clearDatabase(true);
|
$this->clearDatabase(true);
|
||||||
|
|
||||||
// Install first shop
|
// Install first shop
|
||||||
if (!$this->createShop())
|
$shop_name = isset($params['shop_name']) ? $params['shop_name'] : 'Default';
|
||||||
|
if (!$this->createShop($shop_name))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Install languages
|
// Install languages
|
||||||
@@ -203,7 +204,7 @@ class InstallModelInstall extends InstallAbstractModel
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createShop()
|
public function createShop($shop_name)
|
||||||
{
|
{
|
||||||
// Create default group shop
|
// Create default group shop
|
||||||
$group_shop = new GroupShop();
|
$group_shop = new GroupShop();
|
||||||
@@ -221,7 +222,7 @@ class InstallModelInstall extends InstallAbstractModel
|
|||||||
$shop->id_group_shop = $group_shop->id;
|
$shop->id_group_shop = $group_shop->id;
|
||||||
$shop->id_category = 2;
|
$shop->id_category = 2;
|
||||||
$shop->id_theme = 1;
|
$shop->id_theme = 1;
|
||||||
$shop->name = 'Default';
|
$shop->name = $shop_name;
|
||||||
if (!$shop->add())
|
if (!$shop->add())
|
||||||
{
|
{
|
||||||
$this->setError($this->language->l('Cannot create shop'));
|
$this->setError($this->language->l('Cannot create shop'));
|
||||||
|
|||||||
Reference in new issue
Block a user