19 foreach ($params[
'plugins'] as $_plugin_info) {
20 list($_type, $_name, $_tpl_file, $_tpl_line, $_delayed_loading) = $_plugin_info;
21 $_plugin = &$smarty->_plugins[$_type][$_name];
33 if (isset($_plugin)) {
34 if (empty($_plugin[3])) {
35 if (!is_callable($_plugin[0])) {
36 $smarty->_trigger_fatal_error(
"[plugin] $_type '$_name' is not implemented", $_tpl_file, $_tpl_line, __FILE__, __LINE__);
38 $_plugin[1] = $_tpl_file;
39 $_plugin[2] = $_tpl_line;
41 if (!isset($_plugin[4])) $_plugin[4] =
true;
45 }
else if ($_type ==
'insert') {
50 $_plugin_func =
'insert_' . $_name;
51 if (function_exists($_plugin_func)) {
52 $_plugin = array($_plugin_func, $_tpl_file, $_tpl_line,
true,
false);
57 $_plugin_file = $smarty->_get_plugin_filepath($_type, $_name);
59 if (! $_found = ($_plugin_file !=
false)) {
60 $_message =
"could not load plugin file '$_type.$_name.php'\n";
69 include_once $_plugin_file;
71 $_plugin_func =
'smarty_' . $_type .
'_' . $_name;
72 if (!function_exists($_plugin_func)) {
73 $smarty->_trigger_fatal_error(
"[plugin] function $_plugin_func() not found in $_plugin_file", $_tpl_file, $_tpl_line, __FILE__, __LINE__);
81 else if ($_type ==
'insert' && $_delayed_loading) {
82 $_plugin_func =
'smarty_' . $_type .
'_' . $_name;
90 if ($_type ==
'modifier') {
96 if ($smarty->security && !in_array($_name, $smarty->security_settings[
'MODIFIER_FUNCS'])) {
97 $_message =
"(secure mode) modifier '$_name' is not allowed";
99 if (!function_exists($_name)) {
100 $_message =
"modifier '$_name' is not implemented";
102 $_plugin_func = $_name;
106 }
else if ($_type ==
'function') {
110 $_message =
"unknown tag - '$_name'";
115 $smarty->_plugins[$_type][$_name] = array($_plugin_func, $_tpl_file, $_tpl_line,
true,
true);
118 $smarty->_trigger_fatal_error(
'[plugin] ' . $_message, $_tpl_file, $_tpl_line, __FILE__, __LINE__);