fix module_include countvar assignation

This commit is contained in:
Manuel Raynaud
2014-03-11 17:39:56 +01:00
parent ed6d0b4a71
commit 775160235c
6 changed files with 10 additions and 12 deletions

View File

@@ -63,7 +63,7 @@ class Module extends AbstractSmartyPlugin
public function theliaModule($params, \Smarty_Internal_Template $template)
{
$content = null;
$count = 0;
if (false !== $location = $this->getParam($params, 'location', false)) {
if ($this->debug === true && $this->request->get('SHOW_INCLUDE')) {
@@ -74,8 +74,6 @@ class Module extends AbstractSmartyPlugin
$modules = ModuleQuery::getActivated();
$count = 0;
foreach ($modules as $module) {
if (null !== $moduleLimit && $moduleLimit != $module->getCode()) {
@@ -92,14 +90,14 @@ class Module extends AbstractSmartyPlugin
}
}
if (! empty($content)) {
return $template->fetch(sprintf("string:%s", $content));
}
if (false !== $countvarname = $this->getParam($params, 'countvar', false)) {
$template->assign($countvarname, $count);
}
if (! empty($content)) {
return $template->fetch(sprintf("string:%s", $content));
}
return "";
}

View File

@@ -273,7 +273,7 @@
{module_include location='category-edit' countvar='module_count'}
{if $countvar == 0}
{if $module_count == 0}
<div class="alert alert-info">
{intl l="There is currently no active module here."}
</div>

View File

@@ -168,7 +168,7 @@
{module_include location='content-edit' countvar='module_count'}
{if $countvar == 0}
{if $module_count == 0}
<div class="alert alert-info">
{intl l="There is currently no active module here."}
</div>

View File

@@ -154,7 +154,7 @@
{module_include location='folder-edit' countvar='module_count'}
{if $countvar == 0}
{if $module_count == 0}
<div class="alert alert-info">
{intl l="There is currently no active module here."}
</div>

View File

@@ -353,7 +353,7 @@
{module_include location='order-edit' countvar='module_count'}
{if $countvar == 0}
{if $module_count == 0}
<div class="alert alert-info">
{intl l="There is currently no active module here."}
</div>

View File

@@ -121,7 +121,7 @@
{module_include location='product-edit' countvar='module_count'}
{if $countvar == 0}
{if $module_count == 0}
<div class="alert alert-info">
{intl l="There is currently no active module here."}
</div>