From 8944446776b3c705e564eed3881dcefec51a178f Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Mon, 9 Dec 2013 12:11:20 +0100 Subject: [PATCH] display admin hook if in debug mode and specific parameter in url --- .../Thelia/Config/Resources/smarty-plugin.xml | 4 +++- .../Core/Template/Smarty/Plugins/Module.php | 20 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/core/lib/Thelia/Config/Resources/smarty-plugin.xml b/core/lib/Thelia/Config/Resources/smarty-plugin.xml index c3c6a1312..8019b0688 100644 --- a/core/lib/Thelia/Config/Resources/smarty-plugin.xml +++ b/core/lib/Thelia/Config/Resources/smarty-plugin.xml @@ -58,7 +58,9 @@ - + + %kernel.debug% + diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/Module.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Module.php index 4d1ed3060..9b86410de 100755 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/Module.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Module.php @@ -23,12 +23,28 @@ namespace Thelia\Core\Template\Smarty\Plugins; +use Thelia\Core\HttpFoundation\Request; use Thelia\Core\Template\Smarty\SmartyPluginDescriptor; use Thelia\Core\Template\Smarty\AbstractSmartyPlugin; use Thelia\Model\ModuleQuery; class Module extends AbstractSmartyPlugin { + /** + * @var bool application debug mode + */ + protected $debug; + + /** + * @var Request $request + */ + protected $request; + + public function __construct($debug, Request $request) + { + $this->debug = $debug; + $this->request = $request; + } /** * Process theliaModule template inclusion function * @@ -44,6 +60,10 @@ class Module extends AbstractSmartyPlugin if (false !== $location = $this->getParam($params, 'location', false)) { + if($this->debug === true && $this->request->get('SHOW_INCLUDE')) { + echo sprintf('
%s
', $location); + } + $moduleLimit = $this->getParam($params, 'module', null); $modules = ModuleQuery::getActivated();