From 6aa2f80444ee35451db7db905cc6045b355330f8 Mon Sep 17 00:00:00 2001 From: franck Date: Sat, 31 Aug 2013 11:38:00 +0200 Subject: [PATCH] Intriducec BaseI18nLoop, started variable config management --- core/lib/Thelia/Action/Category.php | 62 +++---- core/lib/Thelia/Action/Config.php | 154 ++++++++++++++++++ core/lib/Thelia/Config/Resources/config.xml | 1 + .../Thelia/Config/Resources/routing/admin.xml | 20 +++ .../Controller/Admin/ConfigController.php | 40 +++++ .../Thelia/Core/Event/ConfigChangeEvent.php | 48 ++++++ .../Thelia/Core/Event/ConfigCreateEvent.php | 146 +++++++++++++++++ .../Thelia/Core/Event/ConfigDeleteEvent.php | 48 ++++++ core/lib/Thelia/Core/Event/ConfigEvent.php | 34 ++++ core/lib/Thelia/Core/Event/TheliaEvents.php | 16 ++ .../Core/Template/Element/BaseI18nLoop.php | 79 +++++++++ .../Thelia/Core/Template/Loop/Attribute.php | 5 +- .../Template/Loop/AttributeAvailability.php | 5 +- .../Template/Loop/AttributeCombination.php | 5 +- .../Thelia/Core/Template/Loop/Category.php | 5 +- .../Core/Template/Loop/CategoryPath.php | 7 +- core/lib/Thelia/Core/Template/Loop/Config.php | 125 ++++++++++++++ .../lib/Thelia/Core/Template/Loop/Content.php | 5 +- .../lib/Thelia/Core/Template/Loop/Country.php | 7 +- .../Thelia/Core/Template/Loop/Currency.php | 7 +- .../lib/Thelia/Core/Template/Loop/Feature.php | 5 +- .../Template/Loop/FeatureAvailability.php | 5 +- .../Core/Template/Loop/FeatureValue.php | 7 +- core/lib/Thelia/Core/Template/Loop/Folder.php | 5 +- core/lib/Thelia/Core/Template/Loop/Image.php | 8 +- .../lib/Thelia/Core/Template/Loop/Product.php | 5 +- core/lib/Thelia/Core/Template/Loop/Title.php | 7 +- .../Core/Template/Smarty/SmartyParser.php | 2 +- core/lib/Thelia/Model/Category.php | 40 ++++- core/lib/Thelia/Model/Config.php | 61 ++++++- core/lib/Thelia/Model/Customer.php | 17 +- .../Model/Tools/ModelEventDispatcherTrait.php | 51 ++++++ templates/admin/default/config.html | 44 +++++ templates/admin/default/configuration.html | 4 +- 34 files changed, 966 insertions(+), 114 deletions(-) create mode 100644 core/lib/Thelia/Action/Config.php create mode 100644 core/lib/Thelia/Controller/Admin/ConfigController.php create mode 100644 core/lib/Thelia/Core/Event/ConfigChangeEvent.php create mode 100644 core/lib/Thelia/Core/Event/ConfigCreateEvent.php create mode 100644 core/lib/Thelia/Core/Event/ConfigDeleteEvent.php create mode 100644 core/lib/Thelia/Core/Event/ConfigEvent.php create mode 100644 core/lib/Thelia/Core/Template/Element/BaseI18nLoop.php create mode 100644 core/lib/Thelia/Core/Template/Loop/Config.php create mode 100644 core/lib/Thelia/Model/Tools/ModelEventDispatcherTrait.php create mode 100644 templates/admin/default/config.html diff --git a/core/lib/Thelia/Action/Category.php b/core/lib/Thelia/Action/Category.php index b9bde8a07..bce0df029 100755 --- a/core/lib/Thelia/Action/Category.php +++ b/core/lib/Thelia/Action/Category.php @@ -46,17 +46,13 @@ class Category extends BaseAction implements EventSubscriberInterface $category = new CategoryModel(); - $event->getDispatcher()->dispatch(TheliaEvents::BEFORE_CREATECATEGORY, $event); - - $category->create( - $event->getTitle(), - $event->getParent(), - $event->getLocale() + $category + ->setDispatcher($this->getDispatcher()) + ->create( + $event->getTitle(), + $event->getParent(), + $event->getLocale() ); - - $event->setCreatedCategory($category); - - $event->getDispatcher()->dispatch(TheliaEvents::AFTER_CREATECATEGORY, $event); } public function modify(CategoryChangeEvent $event) @@ -79,13 +75,7 @@ class Category extends BaseAction implements EventSubscriberInterface if ($category !== null) { - $event->setDeletedCategory($category); - - $event->getDispatcher()->dispatch(TheliaEvents::BEFORE_DELETECATEGORY, $event); - - $category->delete(); - - $event->getDispatcher()->dispatch(TheliaEvents::AFTER_DELETECATEGORY, $event); + $category->setDispatcher($this->getDispatcher())->delete(); } } @@ -102,15 +92,11 @@ class Category extends BaseAction implements EventSubscriberInterface if ($category !== null) { - $event->setCategory($category); - $event->getDispatcher()->dispatch(TheliaEvents::BEFORE_CHANGECATEGORY, $event); - - $category->setVisible($category->getVisible() ? false : true); - - $category->save(); - - $event->setCategory($category); - $event->getDispatcher()->dispatch(TheliaEvents::AFTER_CHANGECATEGORY, $event); + $category + ->setDispatcher($this->getDispatcher()) + ->setVisible($category->getVisible() ? false : true) + ->save() + ; } } @@ -140,9 +126,6 @@ class Category extends BaseAction implements EventSubscriberInterface if ($category !== null) { - $event->setCategory($category); - $event->getDispatcher()->dispatch(TheliaEvents::BEFORE_CHANGECATEGORY, $event); - // The current position of the category $my_position = $category->getPosition(); @@ -171,7 +154,11 @@ class Category extends BaseAction implements EventSubscriberInterface $cnx->beginTransaction(); try { - $category->setPosition($result->getPosition())->save(); + $category + ->setDispatcher($this->getDispatcher()) + ->setPosition($result->getPosition()) + ->save() + ; $result->setPosition($my_position)->save(); @@ -180,9 +167,6 @@ class Category extends BaseAction implements EventSubscriberInterface $cnx->rollback(); } } - - $event->setCategory($category); - $event->getDispatcher()->dispatch(TheliaEvents::AFTER_CHANGECATEGORY, $event); } } @@ -199,9 +183,6 @@ class Category extends BaseAction implements EventSubscriberInterface if ($category !== null) { - $event->setCategory($category); - $event->getDispatcher()->dispatch(TheliaEvents::BEFORE_CHANGECATEGORY, $event); - // The required position $new_position = $event->getPosition(); @@ -236,16 +217,17 @@ class Category extends BaseAction implements EventSubscriberInterface $result->setPosition($result->getPosition() + $delta)->save($cnx); } - $category->setPosition($new_position)->save($cnx); + $category + ->setDispatcher($this->getDispatcher()) + ->setPosition($new_position) + ->save($cnx) + ; $cnx->commit(); } catch (Exception $e) { $cnx->rollback(); } } - - $event->setCategory($category); - $event->getDispatcher()->dispatch(TheliaEvents::AFTER_CHANGECATEGORY, $event); } } diff --git a/core/lib/Thelia/Action/Config.php b/core/lib/Thelia/Action/Config.php new file mode 100644 index 000000000..bf0f47b4f --- /dev/null +++ b/core/lib/Thelia/Action/Config.php @@ -0,0 +1,154 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Thelia\Action; + + +use Symfony\Component\EventDispatcher\EventSubscriberInterface; + +use Thelia\Model\ConfigQuery; +use Thelia\Model\Config as ConfigModel; + +use Thelia\Core\Event\TheliaEvents; + +use Thelia\Core\Event\ConfigChangeEvent; +use Thelia\Core\Event\ConfigCreateEvent; +use Thelia\Core\Event\ConfigDeleteEvent; + +class Config extends BaseAction implements EventSubscriberInterface +{ + /** + * Create a new configuration entry + * + * @param ConfigCreateEvent $event + */ + public function create(ConfigCreateEvent $event) + { + $this->checkAuth("ADMIN", "admin.configuration.variables.create"); + + $config = new ConfigModel(); + + $config + ->setDispatcher($this->getDispatcher()) + + ->setName($event->getName()) + ->setValue($event->getValue()) + ->setHidden($evetn->getHidden()) + ->setSecured($event->getSecured()) + + ->setLocale($event->getLocale()) + ->setTitle($event->getTitle()) + ->setDescription($event->getDescription()) + ->setChapo($event->getChapo()) + ->setPostscriptum($event->getPostscriptum()) + + ->save() + ; + } + + /** + * Change a configuration entry value + * + * @param ConfigChangeEvent $event + */ + public function setValue(ConfigChangeEvent $event) + { + $this->checkAuth("ADMIN", "admin.configuration.variables.change"); + + $search = ConfigQuery::create(); + + if (null !== $config = $search->findById($event->getConfigId())) { + + $config + ->setDispatcher($this->getDispatcher()) + ->setValue($event->getValue()) + ->save() + ; + } + } + + /** + * Change a configuration entry + * + * @param ConfigChangeEvent $event + */ + public function modify(ConfigChangeEvent $event) + { + $this->checkAuth("ADMIN", "admin.configuration.variables.change"); + + $search = ConfigQuery::create(); + + if (null !== $config = ConfigQuery::create()->findById($event->getConfigId())) { + + $config + ->setDispatcher($this->getDispatcher()) + + ->setName($event->getName()) + ->setValue($event->getValue()) + ->setHidden($evetn->getHidden()) + ->setSecured($event->getSecured()) + + ->setLocale($event->getLocale()) + ->setTitle($event->getTitle()) + ->setDescription($event->getDescription()) + ->setChapo($event->getChapo()) + ->setPostscriptum($event->getPostscriptum()) + + ->save(); + } + } + + /** + * Delete a configuration entry + * + * @param ConfigDeleteEvent $event + */ + public function delete(ConfigDeleteEvent $event) + { + $this->checkAuth("ADMIN", "admin.configuration.variables.delete"); + + if (null !== $config = ConfigQuery::create()->findById($event->getConfigId())) { + + if (! $config->getSecured()) { + $config->setDispatcher($this->getDispatcher())->delete(); + } + } + } + + /** + * Returns an array of event names this subscriber listens to. + * + * @return array The event names to listen to + * + * @api + */ + public static function getSubscribedEvents() + { + return array( + TheliaEvents::CONFIG_CREATE => array("create", 128), + TheliaEvents::CONFIG_SETVALUE => array("setValue", 128), + TheliaEvents::CONFIG_MODIFY => array("modify", 128), + TheliaEvents::CONFIG_DELETE => array("delete", 128), + ); + } +} diff --git a/core/lib/Thelia/Config/Resources/config.xml b/core/lib/Thelia/Config/Resources/config.xml index 45c763830..7844c879e 100755 --- a/core/lib/Thelia/Config/Resources/config.xml +++ b/core/lib/Thelia/Config/Resources/config.xml @@ -32,6 +32,7 @@ + diff --git a/core/lib/Thelia/Config/Resources/routing/admin.xml b/core/lib/Thelia/Config/Resources/routing/admin.xml index ece222c22..9c235dc39 100755 --- a/core/lib/Thelia/Config/Resources/routing/admin.xml +++ b/core/lib/Thelia/Config/Resources/routing/admin.xml @@ -35,10 +35,30 @@ Thelia\Controller\Admin\CategoryController::processAction + + + + Thelia\Controller\Admin\ConfigController::defaultAction + + + + Thelia\Controller\Admin\ConfigController::createAction + + + + Thelia\Controller\Admin\ConfigController::changeAction + + + + Thelia\Controller\Admin\ConfigController::deleteAction + + + Thelia\Controller\Admin\AdminController::processTemplateAction .* + diff --git a/core/lib/Thelia/Controller/Admin/ConfigController.php b/core/lib/Thelia/Controller/Admin/ConfigController.php new file mode 100644 index 000000000..78979676b --- /dev/null +++ b/core/lib/Thelia/Controller/Admin/ConfigController.php @@ -0,0 +1,40 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Thelia\Controller\Admin; + +class ConfigController extends BaseAdminController +{ + public function defaultAction() { + $this->render('config'); + } + + public function createAction() { + } + + public function deleteAction() { + } + + public function updateAction() { + } +} diff --git a/core/lib/Thelia/Core/Event/ConfigChangeEvent.php b/core/lib/Thelia/Core/Event/ConfigChangeEvent.php new file mode 100644 index 000000000..547ace874 --- /dev/null +++ b/core/lib/Thelia/Core/Event/ConfigChangeEvent.php @@ -0,0 +1,48 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Thelia\Core\Event; + +use Thelia\Model\Config; + +class ConfigChangeEvent extends ConfigCreateEvent +{ + protected $config_id; + + public function __construct($config_id) + { + $this->setConfigId($config_id); + } + + public function getConfigId() + { + return $this->config_id; + } + + public function setConfigId($config_id) + { + $this->config_id = $config_id; + + return $this; + } +} diff --git a/core/lib/Thelia/Core/Event/ConfigCreateEvent.php b/core/lib/Thelia/Core/Event/ConfigCreateEvent.php new file mode 100644 index 000000000..673f48f44 --- /dev/null +++ b/core/lib/Thelia/Core/Event/ConfigCreateEvent.php @@ -0,0 +1,146 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Thelia\Core\Event; +use Thelia\Model\Config; + +class ConfigCreateEvent extends ActionEvent +{ + protected $name; + protected $value; + protected $hidden; + protected $secured; + protected $locale; + protected $title; + protected $description; + protected $chapo; + protected $postscriptum; + + public function getName() + { + return $this->name; + } + + public function setName($name) + { + $this->name = $name; + + return $this; + } + + public function getValue() + { + return $this->value; + } + + public function setValue($value) + { + $this->value = $value; + + return $this; + } + + public function getHidden() + { + return $this->hidden; + } + + public function setHidden($hidden) + { + $this->hidden = $hidden; + + return $this; + } + + public function getSecured() + { + return $this->secured; + } + + public function setSecured($secured) + { + $this->secured = $secured; + + return $this; + } + + public function getLocale() + { + return $this->locale; + } + + public function setLocale($locale) + { + $this->locale = $locale; + + return $this; + } + + public function getTitle() + { + return $this->title; + } + + public function setTitle($title) + { + $this->title = $title; + + return $this; + } + + public function getDescription() + { + return $this->description; + } + + public function setDescription($description) + { + $this->description = $description; + + return $this; + } + + public function getChapo() + { + return $this->chapo; + } + + public function setChapo($chapo) + { + $this->chapo = $chapo; + + return $this; + } + + public function getPostscriptum() + { + return $this->postscriptum; + } + + public function setPostscriptum($postscriptum) + { + $this->postscriptum = $postscriptum; + + return $this; + } +} diff --git a/core/lib/Thelia/Core/Event/ConfigDeleteEvent.php b/core/lib/Thelia/Core/Event/ConfigDeleteEvent.php new file mode 100644 index 000000000..7ae11ce16 --- /dev/null +++ b/core/lib/Thelia/Core/Event/ConfigDeleteEvent.php @@ -0,0 +1,48 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Thelia\Core\Event; + +use Thelia\Model\Config; + +class ConfigDeleteEvent extends ActionEvent +{ + protected $config_id; + + public function __construct($config_id) + { + $this->setConfigId($config_id); + } + + public function getConfigId() + { + return $this->config_id; + } + + public function setConfigId($config_id) + { + $this->config_id = $config_id; + + return $this; + } +} diff --git a/core/lib/Thelia/Core/Event/ConfigEvent.php b/core/lib/Thelia/Core/Event/ConfigEvent.php new file mode 100644 index 000000000..6d7b6ffce --- /dev/null +++ b/core/lib/Thelia/Core/Event/ConfigEvent.php @@ -0,0 +1,34 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Thelia\Core\Event; + +use Thelia\Model\Config; + +class ConfigEvent extends ActionEvent +{ + public function __construct(Config $config) + { + $this->config = $config; + } +} diff --git a/core/lib/Thelia/Core/Event/TheliaEvents.php b/core/lib/Thelia/Core/Event/TheliaEvents.php index 2dd85905d..0836d5e5a 100755 --- a/core/lib/Thelia/Core/Event/TheliaEvents.php +++ b/core/lib/Thelia/Core/Event/TheliaEvents.php @@ -177,4 +177,20 @@ final class TheliaEvents * Sent on cimage cache clear request */ const IMAGE_CLEAR_CACHE = "action.clearImageCache"; + + // -- Configuration management --------------------------------------------- + + const CONFIG_CREATE = "action.createConfig"; + const CONFIG_SETVALUE = "action.setConfigValue"; + const CONFIG_MODIFY = "action.changeConfig"; + const CONFIG_DELETE = "action.deleteConfig"; + + const BEFORE_CREATECONFIG = "action.before_createConfig"; + const AFTER_CREATECONFIG = "action.after_createConfig"; + + const BEFORE_CHANGECONFIG = "action.before_changeConfig"; + const AFTER_CHANGECONFIG = "action.after_changeConfig"; + + const BEFORE_DELETECONFIG = "action.before_deleteConfig"; + const AFTER_DELETECONFIG = "action.after_deleteConfig"; } diff --git a/core/lib/Thelia/Core/Template/Element/BaseI18nLoop.php b/core/lib/Thelia/Core/Template/Element/BaseI18nLoop.php new file mode 100644 index 000000000..ef51d51b8 --- /dev/null +++ b/core/lib/Thelia/Core/Template/Element/BaseI18nLoop.php @@ -0,0 +1,79 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Thelia\Core\Template\Element; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; +use Thelia\Core\Template\Loop\Argument\Argument; +use Propel\Runtime\ActiveQuery\ModelCriteria; +use Thelia\Core\Security\SecurityContext; +use Thelia\Model\Tools\ModelCriteriaTools; + +/** + * + * Class BaseI18nLoop, imlplemented by loops providing internationalized data, such as title, description, etc. + * + * @package Thelia\Core\Template\Element + */ +abstract class BaseI18nLoop extends BaseLoop +{ + /** + * Define common loop arguments + * + * @return Argument[] + */ + protected function getDefaultArgs() + { + $args = parent::getDefaultArgs(); + + $args[] = Argument::createIntTypeArgument('lang'); + + return $args; + } + + /** + * Setup ModelCriteria for proper i18n processing + * + * @param ModelCriteria $search the Propel Criteria to configure + * @param array $columns the i18n columns + * @param string $foreignTable the specified table (default to criteria table) + * @param string $foreignKey the foreign key in this table (default to criteria table) + * + * @return mixed the locale + */ + protected function configureI18nProcessing(ModelCriteria $search, $columns = array('TITLE', 'CHAPO', 'DESCRIPTION', 'POSTSCRIPTUM'), $foreignTable = null, $foreignKey = 'ID', $forceReturn = false) { + + /* manage translations */ + return ModelCriteriaTools::getI18n( + $this->getBackend_context(), + $this->getLang(), + $search, + $this->request->getSession()->getLocale(), + $columns, + $foreignTable, + $foreignKey, + $forceReturn + ); + } +} \ No newline at end of file diff --git a/core/lib/Thelia/Core/Template/Loop/Attribute.php b/core/lib/Thelia/Core/Template/Loop/Attribute.php index 0608732a4..f8ac29fa1 100755 --- a/core/lib/Thelia/Core/Template/Loop/Attribute.php +++ b/core/lib/Thelia/Core/Template/Loop/Attribute.php @@ -25,7 +25,7 @@ namespace Thelia\Core\Template\Loop; use Propel\Runtime\ActiveQuery\Criteria; use Propel\Runtime\ActiveQuery\Join; -use Thelia\Core\Template\Element\BaseLoop; +use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; @@ -53,7 +53,7 @@ use Thelia\Type\BooleanOrBothType; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class Attribute extends BaseLoop +class Attribute extends BaseI18nLoop { /** * @return ArgumentCollection @@ -66,7 +66,6 @@ class Attribute extends BaseLoop Argument::createIntListTypeArgument('category'), Argument::createBooleanOrBothTypeArgument('visible', 1), Argument::createIntListTypeArgument('exclude'), - Argument::createIntTypeArgument('lang'), new Argument( 'order', new TypeCollection( diff --git a/core/lib/Thelia/Core/Template/Loop/AttributeAvailability.php b/core/lib/Thelia/Core/Template/Loop/AttributeAvailability.php index 0664c7d56..6a34c0bba 100755 --- a/core/lib/Thelia/Core/Template/Loop/AttributeAvailability.php +++ b/core/lib/Thelia/Core/Template/Loop/AttributeAvailability.php @@ -25,7 +25,7 @@ namespace Thelia\Core\Template\Loop; use Propel\Runtime\ActiveQuery\Criteria; use Propel\Runtime\ActiveQuery\Join; -use Thelia\Core\Template\Element\BaseLoop; +use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; @@ -46,7 +46,7 @@ use Thelia\Type; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class AttributeAvailability extends BaseLoop +class AttributeAvailability extends BaseI18nLoop { /** * @return ArgumentCollection @@ -57,7 +57,6 @@ class AttributeAvailability extends BaseLoop Argument::createIntListTypeArgument('id'), Argument::createIntListTypeArgument('attribute'), Argument::createIntListTypeArgument('exclude'), - Argument::createIntTypeArgument('lang'), new Argument( 'order', new TypeCollection( diff --git a/core/lib/Thelia/Core/Template/Loop/AttributeCombination.php b/core/lib/Thelia/Core/Template/Loop/AttributeCombination.php index 556a5a1fd..277ead2df 100755 --- a/core/lib/Thelia/Core/Template/Loop/AttributeCombination.php +++ b/core/lib/Thelia/Core/Template/Loop/AttributeCombination.php @@ -25,7 +25,7 @@ namespace Thelia\Core\Template\Loop; use Propel\Runtime\ActiveQuery\Criteria; use Propel\Runtime\ActiveQuery\Join; -use Thelia\Core\Template\Element\BaseLoop; +use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; @@ -48,7 +48,7 @@ use Thelia\Type; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class AttributeCombination extends BaseLoop +class AttributeCombination extends BaseI18nLoop { /** * @return ArgumentCollection @@ -57,7 +57,6 @@ class AttributeCombination extends BaseLoop { return new ArgumentCollection( Argument::createIntTypeArgument('product_sale_elements', null, true), - Argument::createIntTypeArgument('lang'), new Argument( 'order', new TypeCollection( diff --git a/core/lib/Thelia/Core/Template/Loop/Category.php b/core/lib/Thelia/Core/Template/Loop/Category.php index 5eeab58be..372092dcd 100755 --- a/core/lib/Thelia/Core/Template/Loop/Category.php +++ b/core/lib/Thelia/Core/Template/Loop/Category.php @@ -24,7 +24,7 @@ namespace Thelia\Core\Template\Loop; use Propel\Runtime\ActiveQuery\Criteria; -use Thelia\Core\Template\Element\BaseLoop; +use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; @@ -62,7 +62,7 @@ use Thelia\Type\BooleanOrBothType; * @author Manuel Raynaud * @author Etienne Roudeix */ -class Category extends BaseLoop +class Category extends BaseI18nLoop { /** * @return ArgumentCollection @@ -75,7 +75,6 @@ class Category extends BaseLoop Argument::createBooleanTypeArgument('current'), Argument::createBooleanTypeArgument('not_empty', 0), Argument::createBooleanOrBothTypeArgument('visible', 1), - Argument::createIntTypeArgument('lang'), new Argument( 'order', new TypeCollection( diff --git a/core/lib/Thelia/Core/Template/Loop/CategoryPath.php b/core/lib/Thelia/Core/Template/Loop/CategoryPath.php index 30238c26d..5e41c4288 100755 --- a/core/lib/Thelia/Core/Template/Loop/CategoryPath.php +++ b/core/lib/Thelia/Core/Template/Loop/CategoryPath.php @@ -23,7 +23,7 @@ namespace Thelia\Core\Template\Loop; -use Thelia\Core\Template\Element\BaseLoop; +use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; @@ -54,7 +54,7 @@ use Thelia\Type\BooleanOrBothType; * @package Thelia\Core\Template\Loop * @author Franck Allimant */ -class CategoryPath extends BaseLoop +class CategoryPath extends BaseI18nLoop { /** * @return ArgumentCollection @@ -65,8 +65,7 @@ class CategoryPath extends BaseLoop Argument::createIntTypeArgument('category', null, true), Argument::createIntTypeArgument('depth'), Argument::createIntTypeArgument('level'), - Argument::createBooleanOrBothTypeArgument('visible', true, false), - Argument::createIntTypeArgument('lang') + Argument::createBooleanOrBothTypeArgument('visible', true, false) ); } diff --git a/core/lib/Thelia/Core/Template/Loop/Config.php b/core/lib/Thelia/Core/Template/Loop/Config.php new file mode 100644 index 000000000..ba83f92c1 --- /dev/null +++ b/core/lib/Thelia/Core/Template/Loop/Config.php @@ -0,0 +1,125 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Thelia\Core\Template\Loop; + +use Propel\Runtime\ActiveQuery\Criteria; +use Thelia\Core\Template\Element\BaseI18nLoop; +use Thelia\Core\Template\Element\LoopResult; +use Thelia\Core\Template\Element\LoopResultRow; + +use Thelia\Core\Template\Loop\Argument\Argument; + +use Thelia\Model\LangQuery; +use Thelia\Core\Template\Loop\Argument\ArgumentCollection; +use Thelia\Model\ConfigQuery; +use Thelia\Type\BooleanOrBothType; + +/** + * Config loop, to access configuration variables + * + * - id is the config id + * - name is the config name + * - hidden filters by hidden status (yes, no, both) + * - secured filters by secured status (yes, no, both) + * - exclude is a comma separated list of config IDs that will be excluded from output + * + * @package Thelia\Core\Template\Loop + * @author Franck Allimant + */ +class Config extends BaseI18nLoop +{ + /** + * @return ArgumentCollection + */ + protected function getArgDefinitions() + { + return new ArgumentCollection( + Argument::createIntTypeArgument('id'), + Argument::createIntListTypeArgument('exclude'), + Argument::createAnyTypeArgument('name'), + Argument::createBooleanOrBothTypeArgument('hidden'), + Argument::createBooleanOrBothTypeArgument('secured') + ); + } + + /** + * @param $pagination (ignored) + * + * @return \Thelia\Core\Template\Element\LoopResult + */ + public function exec(&$pagination) + { + $id = $this->getId(); + $name = $this->getName(); + + $search = ConfigQuery::create(); + + $this->configureI18nProcessing($search); + + if (! is_null($id)) + $search->filterById($id); + + if (! is_null($name)) + $search->filterByName($name); + + if (! is_null($exclude)) { + $search->filterById($exclude, Criteria::NOT_IN); + } + + if ($this->getHidden() != BooleanOrBothType::ANY) + $search->filterByHidden($this->getHidden() ? 1 : 0); + + if ($this->getSecured() != BooleanOrBothType::ANY) + $search->filterBySecured($this->getSecured() ? 1 : 0); + + $search->orderByName(Criteria::ASC); + + $results = $this->search($search, $pagination); + + $loopResult = new LoopResult(); + + foreach ($results as $result) { + + $loopResultRow = new LoopResultRow(); + + $loopResultRow + ->set("ID" , $result->getId()) + ->set("NAME" , $result->getName()) + ->set("VALUE" , $result->getValue()) + ->set("IS_TRANSLATED", $result->getVirtualColumn('IS_TRANSLATED')) + ->set("TITLE" , $result->getVirtualColumn('i18n_TITLE')) + ->set("CHAPO" , $result->getVirtualColumn('i18n_CHAPO')) + ->set("DESCRIPTION" , $result->getVirtualColumn('i18n_DESCRIPTION')) + ->set("POSTSCRIPTUM" , $result->getVirtualColumn('i18n_POSTSCRIPTUM')) + ->set("HIDDEN" , $result->getHidden()) + ->set("CREATE_DATE" , $result->getCreatedAt()) + ->set("UPDATE_DATE" , $result->getUpdatedAt()) + ; + + $loopResult->addRow($loopResultRow); + } + + return $loopResult; + } +} diff --git a/core/lib/Thelia/Core/Template/Loop/Content.php b/core/lib/Thelia/Core/Template/Loop/Content.php index b26e4d79f..32a5ea073 100755 --- a/core/lib/Thelia/Core/Template/Loop/Content.php +++ b/core/lib/Thelia/Core/Template/Loop/Content.php @@ -24,7 +24,7 @@ namespace Thelia\Core\Template\Loop; use Propel\Runtime\ActiveQuery\Criteria; -use Thelia\Core\Template\Element\BaseLoop; +use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; @@ -49,7 +49,7 @@ use Thelia\Type\BooleanOrBothType; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class Content extends BaseLoop +class Content extends BaseI18nLoop { /** * @return ArgumentCollection @@ -63,7 +63,6 @@ class Content extends BaseLoop Argument::createBooleanTypeArgument('current_folder'), Argument::createIntTypeArgument('depth', 1), Argument::createBooleanOrBothTypeArgument('visible', 1), - Argument::createIntTypeArgument('lang'), new Argument( 'order', new TypeCollection( diff --git a/core/lib/Thelia/Core/Template/Loop/Country.php b/core/lib/Thelia/Core/Template/Loop/Country.php index d93d94cb4..3ecf0055f 100755 --- a/core/lib/Thelia/Core/Template/Loop/Country.php +++ b/core/lib/Thelia/Core/Template/Loop/Country.php @@ -24,7 +24,7 @@ namespace Thelia\Core\Template\Loop; use Propel\Runtime\ActiveQuery\Criteria; -use Thelia\Core\Template\Element\BaseLoop; +use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; @@ -43,7 +43,7 @@ use Thelia\Model\ConfigQuery; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class Country extends BaseLoop +class Country extends BaseI18nLoop { /** * @return ArgumentCollection @@ -54,8 +54,7 @@ class Country extends BaseLoop Argument::createIntListTypeArgument('id'), Argument::createIntListTypeArgument('area'), Argument::createBooleanTypeArgument('with_area'), - Argument::createIntListTypeArgument('exclude'), - Argument::createIntTypeArgument('lang') + Argument::createIntListTypeArgument('exclude') ); } diff --git a/core/lib/Thelia/Core/Template/Loop/Currency.php b/core/lib/Thelia/Core/Template/Loop/Currency.php index b793b86fd..608780c74 100755 --- a/core/lib/Thelia/Core/Template/Loop/Currency.php +++ b/core/lib/Thelia/Core/Template/Loop/Currency.php @@ -24,7 +24,7 @@ namespace Thelia\Core\Template\Loop; use Propel\Runtime\ActiveQuery\Criteria; -use Thelia\Core\Template\Element\BaseLoop; +use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; @@ -43,7 +43,7 @@ use Thelia\Model\ConfigQuery; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class Currency extends BaseLoop +class Currency extends BaseI18nLoop { /** * @return ArgumentCollection @@ -53,8 +53,7 @@ class Currency extends BaseLoop return new ArgumentCollection( Argument::createIntListTypeArgument('id'), Argument::createIntListTypeArgument('exclude'), - Argument::createBooleanTypeArgument('default_only', false), - Argument::createIntTypeArgument('lang') + Argument::createBooleanTypeArgument('default_only', false) ); } diff --git a/core/lib/Thelia/Core/Template/Loop/Feature.php b/core/lib/Thelia/Core/Template/Loop/Feature.php index e2de85dbc..bfb715181 100755 --- a/core/lib/Thelia/Core/Template/Loop/Feature.php +++ b/core/lib/Thelia/Core/Template/Loop/Feature.php @@ -24,7 +24,7 @@ namespace Thelia\Core\Template\Loop; use Propel\Runtime\ActiveQuery\Criteria; -use Thelia\Core\Template\Element\BaseLoop; +use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; @@ -49,7 +49,7 @@ use Thelia\Type\BooleanOrBothType; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class Feature extends BaseLoop +class Feature extends BaseI18nLoop { /** * @return ArgumentCollection @@ -62,7 +62,6 @@ class Feature extends BaseLoop Argument::createIntListTypeArgument('category'), Argument::createBooleanOrBothTypeArgument('visible', 1), Argument::createIntListTypeArgument('exclude'), - Argument::createIntTypeArgument('lang'), new Argument( 'order', new TypeCollection( diff --git a/core/lib/Thelia/Core/Template/Loop/FeatureAvailability.php b/core/lib/Thelia/Core/Template/Loop/FeatureAvailability.php index c04d70031..5b1a939fa 100755 --- a/core/lib/Thelia/Core/Template/Loop/FeatureAvailability.php +++ b/core/lib/Thelia/Core/Template/Loop/FeatureAvailability.php @@ -24,7 +24,7 @@ namespace Thelia\Core\Template\Loop; use Propel\Runtime\ActiveQuery\Criteria; -use Thelia\Core\Template\Element\BaseLoop; +use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; @@ -44,7 +44,7 @@ use Thelia\Type; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class FeatureAvailability extends BaseLoop +class FeatureAvailability extends BaseI18nLoop { /** * @return ArgumentCollection @@ -55,7 +55,6 @@ class FeatureAvailability extends BaseLoop Argument::createIntListTypeArgument('id'), Argument::createIntListTypeArgument('feature'), Argument::createIntListTypeArgument('exclude'), - Argument::createIntTypeArgument('lang'), new Argument( 'order', new TypeCollection( diff --git a/core/lib/Thelia/Core/Template/Loop/FeatureValue.php b/core/lib/Thelia/Core/Template/Loop/FeatureValue.php index 7fef63c28..303d6f0f3 100755 --- a/core/lib/Thelia/Core/Template/Loop/FeatureValue.php +++ b/core/lib/Thelia/Core/Template/Loop/FeatureValue.php @@ -25,7 +25,7 @@ namespace Thelia\Core\Template\Loop; use Propel\Runtime\ActiveQuery\Criteria; use Propel\Runtime\ActiveQuery\Join; -use Thelia\Core\Template\Element\BaseLoop; +use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; @@ -49,7 +49,7 @@ use Thelia\Type; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class FeatureValue extends BaseLoop +class FeatureValue extends BaseI18nLoop { /** * @return ArgumentCollection @@ -68,8 +68,7 @@ class FeatureValue extends BaseLoop new Type\EnumListType(array('alpha', 'alpha_reverse', 'manual', 'manual_reverse')) ), 'manual' - ), - Argument::createIntTypeArgument('lang') + ) ); } diff --git a/core/lib/Thelia/Core/Template/Loop/Folder.php b/core/lib/Thelia/Core/Template/Loop/Folder.php index eb64d9996..32f9a928e 100755 --- a/core/lib/Thelia/Core/Template/Loop/Folder.php +++ b/core/lib/Thelia/Core/Template/Loop/Folder.php @@ -24,7 +24,7 @@ namespace Thelia\Core\Template\Loop; use Propel\Runtime\ActiveQuery\Criteria; -use Thelia\Core\Template\Element\BaseLoop; +use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; @@ -44,7 +44,7 @@ use Thelia\Type\BooleanOrBothType; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class Folder extends BaseLoop +class Folder extends BaseI18nLoop { /** * @return ArgumentCollection @@ -57,7 +57,6 @@ class Folder extends BaseLoop Argument::createBooleanTypeArgument('current'), Argument::createBooleanTypeArgument('not_empty', 0), Argument::createBooleanOrBothTypeArgument('visible', 1), - Argument::createIntTypeArgument('lang'), new Argument( 'order', new TypeCollection( diff --git a/core/lib/Thelia/Core/Template/Loop/Image.php b/core/lib/Thelia/Core/Template/Loop/Image.php index e26bcc9fe..6e96c637c 100755 --- a/core/lib/Thelia/Core/Template/Loop/Image.php +++ b/core/lib/Thelia/Core/Template/Loop/Image.php @@ -22,7 +22,7 @@ /*************************************************************************************/ namespace Thelia\Core\Template\Loop; -use Thelia\Core\Template\Element\BaseLoop; +use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Core\Event\ImageEvent; use Thelia\Model\CategoryImageQuery; @@ -43,7 +43,7 @@ use Thelia\Log\Tlog; * * @author Franck Allimant */ -class Image extends BaseLoop +class Image extends BaseI18nLoop { /** * @var array Possible image sources @@ -312,9 +312,7 @@ class Image extends BaseLoop new EnumType($this->possible_sources) ) ), - Argument::createIntTypeArgument('source_id'), - - Argument::createIntListTypeArgument('lang') + Argument::createIntTypeArgument('source_id') ); // Add possible image sources diff --git a/core/lib/Thelia/Core/Template/Loop/Product.php b/core/lib/Thelia/Core/Template/Loop/Product.php index 4c1acdcc6..458530afa 100755 --- a/core/lib/Thelia/Core/Template/Loop/Product.php +++ b/core/lib/Thelia/Core/Template/Loop/Product.php @@ -25,7 +25,7 @@ namespace Thelia\Core\Template\Loop; use Propel\Runtime\ActiveQuery\Criteria; use Propel\Runtime\ActiveQuery\Join; -use Thelia\Core\Template\Element\BaseLoop; +use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; @@ -56,7 +56,7 @@ use Thelia\Type\BooleanOrBothType; * * @todo : manage currency in price filter */ -class Product extends BaseLoop +class Product extends BaseI18nLoop { /** * @return ArgumentCollection @@ -83,7 +83,6 @@ class Product extends BaseLoop Argument::createBooleanTypeArgument('current_category'), Argument::createIntTypeArgument('depth', 1), Argument::createBooleanOrBothTypeArgument('visible', 1), - Argument::createIntTypeArgument('lang'), new Argument( 'order', new TypeCollection( diff --git a/core/lib/Thelia/Core/Template/Loop/Title.php b/core/lib/Thelia/Core/Template/Loop/Title.php index c53be086a..7e45eab4c 100755 --- a/core/lib/Thelia/Core/Template/Loop/Title.php +++ b/core/lib/Thelia/Core/Template/Loop/Title.php @@ -24,7 +24,7 @@ namespace Thelia\Core\Template\Loop; use Propel\Runtime\ActiveQuery\Criteria; -use Thelia\Core\Template\Element\BaseLoop; +use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; @@ -43,7 +43,7 @@ use Thelia\Model\ConfigQuery; * @package Thelia\Core\Template\Loop * @author Etienne Roudeix */ -class Title extends BaseLoop +class Title extends BaseI18nLoop { /** * @return ArgumentCollection @@ -51,8 +51,7 @@ class Title extends BaseLoop protected function getArgDefinitions() { return new ArgumentCollection( - Argument::createIntListTypeArgument('id'), - Argument::createIntTypeArgument('lang') + Argument::createIntListTypeArgument('id') ); } diff --git a/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php b/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php index ed74fe3f0..b7d86a4da 100755 --- a/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php +++ b/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php @@ -219,7 +219,7 @@ class SmartyParser extends Smarty implements ParserInterface $fileName .= ".html"; if (!file_exists($fileName)) { - throw new ResourceNotFoundException(sprintf("%s file not found in %s template", $file, $this->template)); + throw new ResourceNotFoundException(sprintf("%s file (%s) not found in %s template", $file, $fileName, $this->template)); } } diff --git a/core/lib/Thelia/Model/Category.php b/core/lib/Thelia/Model/Category.php index b1d92cfdd..996752214 100755 --- a/core/lib/Thelia/Model/Category.php +++ b/core/lib/Thelia/Model/Category.php @@ -5,9 +5,12 @@ namespace Thelia\Model; use Thelia\Model\Base\Category as BaseCategory; use Propel\Runtime\ActiveQuery\Criteria; use Thelia\Tools\URL; +use Thelia\Core\Event\TheliaEvents; class Category extends BaseCategory { + use \Thelia\Model\Tools\ModelEventDispatcherTrait; + /** * @return int number of child for the current category */ @@ -74,6 +77,39 @@ class Category extends BaseCategory } return $countProduct; - } -} + + public function preInsert(ConnectionInterface $con = null) + { + $this->dispatchEvent(TheliaEvents::BEFORE_CREATECATEGORY, new CategoryEvent($this)); + + return true; + } + + public function postInsert(ConnectionInterface $con = null) + { + $this->dispatchEvent(TheliaEvents::AFTER_CREATECATEGORY, new CategoryEvent($this)); + } + + public function preUpdate(ConnectionInterface $con = null) + { + $this->dispatchEvent(TheliaEvents::BEFORE_CHANGECATEGORY, new CategoryEvent($this)); + + return true; + } + + public function postUpdate(ConnectionInterface $con = null) + { + $this->dispatchEvent(TheliaEvents::AFTER_CHANGECATEGORY, new CategoryEvent($this)); + } + + public function preDelete(ConnectionInterface $con = null) + { + $this->dispatchEvent(TheliaEvents::BEFORE_DELETECATEGORY, new CategoryEvent($this)); + } + + public function postDelete(ConnectionInterface $con = null) + { + $this->dispatchEvent(TheliaEvents::AFTER_DELETECATEGORY, new CategoryEvent($this)); + } +} \ No newline at end of file diff --git a/core/lib/Thelia/Model/Config.php b/core/lib/Thelia/Model/Config.php index 04f760bd4..276823530 100755 --- a/core/lib/Thelia/Model/Config.php +++ b/core/lib/Thelia/Model/Config.php @@ -1,9 +1,68 @@ . */ +/* */ +/*************************************************************************************/ namespace Thelia\Model; use Thelia\Model\Base\Config as BaseConfig; +use Propel\Runtime\Connection\ConnectionInterface; +use Thelia\Core\Event\TheliaEvents; +use Thelia\Core\Event\ConfigEvent; class Config extends BaseConfig { -} + use \Thelia\Model\Tools\ModelEventDispatcherTrait; + + public function preInsert(ConnectionInterface $con = null) + { + $this->dispatchEvent(TheliaEvents::BEFORE_CREATECONFIG, new ConfigEvent($this)); + + return true; + } + + public function postInsert(ConnectionInterface $con = null) + { + $this->dispatchEvent(TheliaEvents::AFTER_CREATECONFIG, new ConfigEvent($this)); + } + + public function preUpdate(ConnectionInterface $con = null) + { + $this->dispatchEvent(TheliaEvents::BEFORE_CHANGECONFIG, new ConfigEvent($this)); + + return true; + } + + public function postUpdate(ConnectionInterface $con = null) + { + $this->dispatchEvent(TheliaEvents::AFTER_CHANGECONFIG, new ConfigEvent($this)); + } + + public function preDelete(ConnectionInterface $con = null) + { + $this->dispatchEvent(TheliaEvents::BEFORE_DELETECONFIG, new ConfigEvent($this)); + } + + public function postDelete(ConnectionInterface $con = null) + { + $this->dispatchEvent(TheliaEvents::AFTER_DELETECONFIG, new ConfigEvent($this)); + } +} \ No newline at end of file diff --git a/core/lib/Thelia/Model/Customer.php b/core/lib/Thelia/Model/Customer.php index d7418a4ea..621f39652 100755 --- a/core/lib/Thelia/Model/Customer.php +++ b/core/lib/Thelia/Model/Customer.php @@ -31,10 +31,7 @@ use Thelia\Core\Event\CustomerEvent; */ class Customer extends BaseCustomer implements UserInterface { - /** - * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface - */ - protected $dispatcher; + use \Thelia\Model\Tools\ModelEventDispatcherTrait; /** * @param int $titleId customer title id (from customer_title table) @@ -137,13 +134,6 @@ class Customer extends BaseCustomer implements UserInterface $this->dispatchEvent(TheliaEvents::AFTER_CHANGECUSTOMER, $customerEvent); } - protected function dispatchEvent($eventName, CustomerEvent $customerEvent) - { - if (!is_null($this->dispatcher)) { - $this->dispatcher->dispatch($eventName, $customerEvent); - } - } - protected function generateRef() { return uniqid(substr($this->getLastname(), 0, (strlen($this->getLastname()) >= 3) ? 3 : strlen($this->getLastname())), true); @@ -184,11 +174,6 @@ class Customer extends BaseCustomer implements UserInterface return parent::setEmail($email); } - public function setDispatcher(EventDispatcherInterface $dispatcher) - { - $this->dispatcher = $dispatcher; - } - /** * {@inheritDoc} */ diff --git a/core/lib/Thelia/Model/Tools/ModelEventDispatcherTrait.php b/core/lib/Thelia/Model/Tools/ModelEventDispatcherTrait.php new file mode 100644 index 000000000..aeaadc1f3 --- /dev/null +++ b/core/lib/Thelia/Model/Tools/ModelEventDispatcherTrait.php @@ -0,0 +1,51 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Thelia\Model\Tools; + +use Thelia\Core\Event\ActionEvent; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; + +/** + * A trait to provide event dispatching mechanism to Model objects + */ +trait ModelEventDispatcherTrait { + + /** + * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface + */ + protected $dispatcher = null; + + + public function setDispatcher(EventDispatcherInterface $dispatcher) + { + $this->dispatcher = $dispatcher; + } + + protected function dispatchEvent($eventName, ActionEvent $event) + { + if (!is_null($this->dispatcher)) { + $this->dispatcher->dispatch($eventName, $event); + } + } +} \ No newline at end of file diff --git a/templates/admin/default/config.html b/templates/admin/default/config.html new file mode 100644 index 000000000..46d257ff3 --- /dev/null +++ b/templates/admin/default/config.html @@ -0,0 +1,44 @@ +{check_auth context="admin" roles="ADMIN" permissions="admin.configuration.variables.view" login_tpl="/admin/login"} + +{$page_title={intl l='Configuration'}} + +{include file='includes/header.inc.html'} + +
+ +
+ + {module_include location='config_top'} + +

{intl l="Thelia system variables "}

+ +
+ +
+ +
+
+
+
+ +{include file='includes/js.inc.html'} + +{include file='includes/footer.inc.html'} \ No newline at end of file diff --git a/templates/admin/default/configuration.html b/templates/admin/default/configuration.html index 6973807c7..88454c6e5 100644 --- a/templates/admin/default/configuration.html +++ b/templates/admin/default/configuration.html @@ -112,8 +112,8 @@ {loop type="auth" name="pcc2" context="admin" roles="ADMIN" permissions="admin.configuration.variables"} - {intl l='System variables'} - + {intl l='System variables'} + {/loop}