diff --git a/NEWS b/NEWS index 640f8b0e..4b9f497f 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ +- changed {popup_init} to only emit code once during a request (TGKnIght, boots) - fix handling of block-methods of registered objects (El Hombre Gris, messju) diff --git a/libs/plugins/function.popup_init.php b/libs/plugins/function.popup_init.php index 93cb4545..a2206e0f 100644 --- a/libs/plugins/function.popup_init.php +++ b/libs/plugins/function.popup_init.php @@ -21,20 +21,24 @@ */ function smarty_function_popup_init($params, &$smarty) { - $zindex = 1000; + static $already_init; - if (!empty($params['zindex'])) { - $zindex = $params['zindex']; - } - - if (!empty($params['src'])) { - return '' . "\n" - . '' . "\n"; - } else { - $smarty->trigger_error("popup_init: missing src parameter"); + if (!$already_init) { + $zindex = 1000; + + if (!empty($params['zindex'])) { + $zindex = $params['zindex']; + } + + if (!empty($params['src'])) { + return '' . "\n" + . '' . "\n"; + } else { + $smarty->trigger_error("popup_init: missing src parameter"); + } } } /* vim: set expandtab: */ -?> +?> \ No newline at end of file