Une première version d'une version permettant d'avoir des templates différents suivant la langue.
A creuser mais peut-être pas besoin de TemplateSwitcher et de CustomSwitchTemplate, et qu'il suffirait de rajouter juste du Smarty dans layout.tpl et index.html
This commit is contained in:
39
local/modules/CustomSwitchTemplate/CustomSwitchTemplate.php
Normal file
39
local/modules/CustomSwitchTemplate/CustomSwitchTemplate.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* This file is part of the Thelia package. */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : dev@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* For the full copyright and license information, please view the LICENSE.txt */
|
||||
/* file that was distributed with this source code. */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace CustomSwitchTemplate;
|
||||
|
||||
use AdminComment\Model\AdminCommentQuery;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Thelia\Install\Database;
|
||||
use Thelia\Model\ConfigQuery;
|
||||
use Thelia\Module\BaseModule;
|
||||
|
||||
class CustomSwitchTemplate extends BaseModule
|
||||
{
|
||||
/** @var string */
|
||||
const DOMAIN_NAME = 'customswitchtemplate';
|
||||
|
||||
/*
|
||||
* You may now override BaseModuleInterface methods, such as:
|
||||
* install, destroy, preActivation, postActivation, preDeactivation, postDeactivation
|
||||
*
|
||||
* Have fun !
|
||||
*/
|
||||
public function postActivation(ConnectionInterface $con = null)
|
||||
{
|
||||
if (null == ConfigQuery::read('alternative-front-template')) {
|
||||
$database = new Database($con->getWrappedConnection());
|
||||
$database->insertSql(null, [__DIR__ . DS . 'Config' . DS . 'thelia.sql']);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user