diff --git a/library/smarty/libs/sysplugins/smarty_data.php b/library/smarty/libs/sysplugins/smarty_data.php new file mode 100644 --- /dev/null +++ b/library/smarty/libs/sysplugins/smarty_data.php @@ -0,0 +1,64 @@ +dataObjectName = 'Data_object ' . (isset($name) ? "'{$name}'" : self::$count); + $this->smarty = $smarty; + if (is_object($_parent)) { + // when object set up back pointer + $this->parent = $_parent; + } elseif (is_array($_parent)) { + // set up variable values + foreach ($_parent as $_key => $_val) { + $this->tpl_vars[$_key] = new Smarty_Variable($_val); + } + } elseif ($_parent != null) { + throw new SmartyException("Wrong type for template variables"); + } + } +}