fix module_include countvar assignation
This commit is contained in:
@@ -63,7 +63,7 @@ class Module extends AbstractSmartyPlugin
|
|||||||
public function theliaModule($params, \Smarty_Internal_Template $template)
|
public function theliaModule($params, \Smarty_Internal_Template $template)
|
||||||
{
|
{
|
||||||
$content = null;
|
$content = null;
|
||||||
|
$count = 0;
|
||||||
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')) {
|
if ($this->debug === true && $this->request->get('SHOW_INCLUDE')) {
|
||||||
@@ -74,8 +74,6 @@ class Module extends AbstractSmartyPlugin
|
|||||||
|
|
||||||
$modules = ModuleQuery::getActivated();
|
$modules = ModuleQuery::getActivated();
|
||||||
|
|
||||||
$count = 0;
|
|
||||||
|
|
||||||
foreach ($modules as $module) {
|
foreach ($modules as $module) {
|
||||||
|
|
||||||
if (null !== $moduleLimit && $moduleLimit != $module->getCode()) {
|
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)) {
|
if (false !== $countvarname = $this->getParam($params, 'countvar', false)) {
|
||||||
$template->assign($countvarname, $count);
|
$template->assign($countvarname, $count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! empty($content)) {
|
||||||
|
return $template->fetch(sprintf("string:%s", $content));
|
||||||
|
}
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -273,7 +273,7 @@
|
|||||||
|
|
||||||
{module_include location='category-edit' countvar='module_count'}
|
{module_include location='category-edit' countvar='module_count'}
|
||||||
|
|
||||||
{if $countvar == 0}
|
{if $module_count == 0}
|
||||||
<div class="alert alert-info">
|
<div class="alert alert-info">
|
||||||
{intl l="There is currently no active module here."}
|
{intl l="There is currently no active module here."}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -168,7 +168,7 @@
|
|||||||
|
|
||||||
{module_include location='content-edit' countvar='module_count'}
|
{module_include location='content-edit' countvar='module_count'}
|
||||||
|
|
||||||
{if $countvar == 0}
|
{if $module_count == 0}
|
||||||
<div class="alert alert-info">
|
<div class="alert alert-info">
|
||||||
{intl l="There is currently no active module here."}
|
{intl l="There is currently no active module here."}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -154,7 +154,7 @@
|
|||||||
|
|
||||||
{module_include location='folder-edit' countvar='module_count'}
|
{module_include location='folder-edit' countvar='module_count'}
|
||||||
|
|
||||||
{if $countvar == 0}
|
{if $module_count == 0}
|
||||||
<div class="alert alert-info">
|
<div class="alert alert-info">
|
||||||
{intl l="There is currently no active module here."}
|
{intl l="There is currently no active module here."}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -353,7 +353,7 @@
|
|||||||
|
|
||||||
{module_include location='order-edit' countvar='module_count'}
|
{module_include location='order-edit' countvar='module_count'}
|
||||||
|
|
||||||
{if $countvar == 0}
|
{if $module_count == 0}
|
||||||
<div class="alert alert-info">
|
<div class="alert alert-info">
|
||||||
{intl l="There is currently no active module here."}
|
{intl l="There is currently no active module here."}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -121,7 +121,7 @@
|
|||||||
|
|
||||||
{module_include location='product-edit' countvar='module_count'}
|
{module_include location='product-edit' countvar='module_count'}
|
||||||
|
|
||||||
{if $countvar == 0}
|
{if $module_count == 0}
|
||||||
<div class="alert alert-info">
|
<div class="alert alert-info">
|
||||||
{intl l="There is currently no active module here."}
|
{intl l="There is currently no active module here."}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user