Merge pull request #137 from thelia/adminInclude
display admin hook if in debug mode and specific parameter in url
This commit is contained in:
@@ -58,7 +58,9 @@
|
|||||||
<argument type="service" id="thelia.translator" />
|
<argument type="service" id="thelia.translator" />
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
<service id="smarty.plugin.module" class="Thelia\Core\Template\Smarty\Plugins\Module" >
|
<service id="smarty.plugin.module" class="Thelia\Core\Template\Smarty\Plugins\Module" scope="request">
|
||||||
|
<argument>%kernel.debug%</argument>
|
||||||
|
<argument type="service" id="request"/>
|
||||||
<tag name="thelia.parser.register_plugin"/>
|
<tag name="thelia.parser.register_plugin"/>
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
|
|||||||
@@ -23,12 +23,28 @@
|
|||||||
|
|
||||||
namespace Thelia\Core\Template\Smarty\Plugins;
|
namespace Thelia\Core\Template\Smarty\Plugins;
|
||||||
|
|
||||||
|
use Thelia\Core\HttpFoundation\Request;
|
||||||
use Thelia\Core\Template\Smarty\SmartyPluginDescriptor;
|
use Thelia\Core\Template\Smarty\SmartyPluginDescriptor;
|
||||||
use Thelia\Core\Template\Smarty\AbstractSmartyPlugin;
|
use Thelia\Core\Template\Smarty\AbstractSmartyPlugin;
|
||||||
use Thelia\Model\ModuleQuery;
|
use Thelia\Model\ModuleQuery;
|
||||||
|
|
||||||
class Module extends AbstractSmartyPlugin
|
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
|
* Process theliaModule template inclusion function
|
||||||
*
|
*
|
||||||
@@ -44,6 +60,10 @@ class Module extends AbstractSmartyPlugin
|
|||||||
|
|
||||||
if (false !== $location = $this->getParam($params, 'location', false)) {
|
if (false !== $location = $this->getParam($params, 'location', false)) {
|
||||||
|
|
||||||
|
if($this->debug === true && $this->request->get('SHOW_INCLUDE')) {
|
||||||
|
echo sprintf('<div style="background-color: #C82D26; border-color: #000000; border: solid;">%s</div>', $location);
|
||||||
|
}
|
||||||
|
|
||||||
$moduleLimit = $this->getParam($params, 'module', null);
|
$moduleLimit = $this->getParam($params, 'module', null);
|
||||||
|
|
||||||
$modules = ModuleQuery::getActivated();
|
$modules = ModuleQuery::getActivated();
|
||||||
|
|||||||
Reference in New Issue
Block a user