phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] [18570] fix: using now static var for phpgw::get_var


From: Pascal Vilarem
Subject: [Phpgroupware-cvs] [18570] fix: using now static var for phpgw::get_var check (thanks skwashd)
Date: Sun, 01 Jun 2008 10:20:18 +0000

Revision: 18570
          
http://svn.sv.gnu.org/viewvc/?view=rev&root=phpgroupware&revision=18570
Author:   maat
Date:     2008-06-01 10:20:16 +0000 (Sun, 01 Jun 2008)

Log Message:
-----------
fix: using now static var for phpgw::get_var check (thanks skwashd)

Modified Paths:
--------------
    trunk/ged/inc/class.flow_client.inc.php
    trunk/ged/inc/class.ged_ui.inc.php

Modified: trunk/ged/inc/class.flow_client.inc.php
===================================================================
--- trunk/ged/inc/class.flow_client.inc.php     2008-06-01 08:04:42 UTC (rev 
18569)
+++ trunk/ged/inc/class.flow_client.inc.php     2008-06-01 10:20:16 UTC (rev 
18570)
@@ -49,8 +49,14 @@
                // and old get_var otherwise
                function get_var($varname,$method=null,$default=null)
                {
-                       if ( is_callable(array('phpgw', 'get_var')))
+                       if (!isset($new_get_var))
                        {
+                               static $new_get_var;
+                               $new_get_var=is_callable(array('phpgw', 
'get_var'));
+                       }
+
+                       if ($new_get_var)
+                       {
                                return 
phpgw::get_var($varname,$method,$default);
                        }
                        else

Modified: trunk/ged/inc/class.ged_ui.inc.php
===================================================================
--- trunk/ged/inc/class.ged_ui.inc.php  2008-06-01 08:04:42 UTC (rev 18569)
+++ trunk/ged/inc/class.ged_ui.inc.php  2008-06-01 10:20:16 UTC (rev 18570)
@@ -292,17 +292,25 @@
        
        // wrapper to use new phpgw::get_var if it exists
        // and old get_var otherwise
-       function get_var($varname,$method=null,$default=null)
-       {
-               if ( is_callable(array('phpgw', 'get_var')))
+               // wrapper to use new phpgw::get_var if it exists
+               // and old get_var otherwise
+               function get_var($varname,$method=null,$default=null)
                {
-                       return phpgw::get_var($varname,$method,$default);
+                       if (!isset($new_get_var))
+                       {
+                               static $new_get_var;
+                               $new_get_var=is_callable(array('phpgw', 
'get_var'));
+                       }
+
+                       if ($new_get_var)
+                       {
+                               return 
phpgw::get_var($varname,$method,$default);
+                       }
+                       else
+                       {
+                               return get_var($varname,$method, $default);
+                       }
                }
-               else
-               {
-                       return get_var($varname,$method, $default);
-               }
-       }
        
        // TODO acl here
        function view()






reply via email to

[Prev in Thread] Current Thread [Next in Thread]