cvs: smarty / NEWS /libs/plugins function.popup_init.php

[email protected] ("boots") Tue, 09 May 2006 19:48:54 -0000
Newsgroups php.smarty.cvs
Message-ID <cvsboots1147204134@cvsserver>
boots		Tue May  9 19:48:54 2006 UTC

  Modified files:              
    /smarty	NEWS 
    /smarty/libs/plugins	function.popup_init.php 
  Log:
  reverted {popup_init} as proposed change to insertion behviour was not BC
  
http://cvs.php.net/viewcvs.cgi/smarty/NEWS?r1=1.528&r2=1.529&diff_format=u
Index: smarty/NEWS
diff -u smarty/NEWS:1.528 smarty/NEWS:1.529
--- smarty/NEWS:1.528	Thu May  4 19:10:13 2006
+++ smarty/NEWS	Tue May  9 19:48:54 2006
@@ -1,4 +1,3 @@
-- 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)
 
http://cvs.php.net/viewcvs.cgi/smarty/libs/plugins/function.popup_init.php?r1=1.11&r2=1.12&diff_format=u
Index: smarty/libs/plugins/function.popup_init.php
diff -u smarty/libs/plugins/function.popup_init.php:1.11 smarty/libs/plugins/function.popup_init.php:1.12
--- smarty/libs/plugins/function.popup_init.php:1.11	Thu May  4 19:10:13 2006
+++ smarty/libs/plugins/function.popup_init.php	Tue May  9 19:48:54 2006
@@ -21,24 +21,20 @@
  */
 function smarty_function_popup_init($params, &$smarty)
 {
-    static $already_init;
+    $zindex = 1000;
     
-    if (!$already_init) {
-        $zindex = 1000;
-        
-        if (!empty($params['zindex'])) {
-            $zindex = $params['zindex'];
-        }
-        
-        if (!empty($params['src'])) {
-            return '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:'.$zindex.';"></div>' . "\n"
-             . '<script type="text/javascript" language="JavaScript" src="'.$params['src'].'"></script>' . "\n";
-        } else {
-            $smarty->trigger_error("popup_init: missing src parameter");
-        }
+    if (!empty($params['zindex'])) {
+        $zindex = $params['zindex'];
+    }
+    
+    if (!empty($params['src'])) {
+        return '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:'.$zindex.';"></div>' . "\n"
+         . '<script type="text/javascript" language="JavaScript" src="'.$params['src'].'"></script>' . "\n";
+    } else {
+        $smarty->trigger_error("popup_init: missing src parameter");
     }
 }
 
 /* vim: set expandtab: */
 
-?>
\ No newline at end of file
+?>