// Remove Module->templateAssign() from modules (use $this->smarty->assign() instead)

This commit is contained in:
rMalie
2011-12-05 14:04:35 +00:00
parent a25d5d2488
commit 1699ae2f34
21 changed files with 86 additions and 104 deletions

View File

@@ -1237,24 +1237,6 @@ abstract class ModuleCore
return ($overloaded ? _PS_THEME_DIR_.'modules/'.$this->name : _PS_MODULE_DIR_.$this->name).'/'.$template;
}
/**
* Assign a smarty vars (same syntax as smarty->assign) but prefix all keys with module name
*
* @since 1.5.0
* @param string $key Variable key (can be an array)
* @param mixed $value Variable value
*/
public function templateAssign($key, $value = null)
{
if (is_array($key))
{
foreach ($key as $k => $v)
$this->context->smarty->assign($this->name.'_'.$k, $v);
}
else
$this->context->smarty->assign($this->name.'_'.$key, $value);
}
protected function _getApplicableTemplateDir($template)
{
return $this->_isTemplateOverloaded($template) ? _PS_THEME_DIR_ : _PS_MODULE_DIR_.$this->name.'/';