fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10022] API: new function for getting phpgw_link from


From: Sigurd Nes
Subject: [Fmsystem-commits] [10022] API: new function for getting phpgw_link from xsl-templates
Date: Fri, 21 Sep 2012 14:12:36 +0000

Revision: 10022
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10022
Author:   sigurdne
Date:     2012-09-21 14:12:35 +0000 (Fri, 21 Sep 2012)
Log Message:
-----------
API: new function for getting phpgw_link from xsl-templates

Modified Paths:
--------------
    trunk/phpgwapi/inc/functions.inc.php

Modified: trunk/phpgwapi/inc/functions.inc.php
===================================================================
--- trunk/phpgwapi/inc/functions.inc.php        2012-09-21 13:27:29 UTC (rev 
10021)
+++ trunk/phpgwapi/inc/functions.inc.php        2012-09-21 14:12:35 UTC (rev 
10022)
@@ -92,7 +92,7 @@
 
        /**
         * Get global phpgw_info from XSLT templates
-        * @param string on the format 'user|preferences|common|dateformat'
+        * @param string $key on the format 'user|preferences|common|dateformat'
         * @return array or string depending on if param is representing a node
         */
 
@@ -108,7 +108,33 @@
                return $ret;
        }
 
+
        /**
+        * Get global phpgw_link from XSLT templates
+        * @param string $path on the format 'index.php'
+        * @param string $params on the format 'param1:value1,param2:value2'
+        * @return string containing url
+        */
+
+       function get_phpgw_link($path, $params)
+       {
+               $link_data = array();
+
+               $_param_sets = explode(',',$params);
+               foreach ($_param_sets as $_param_set)
+               {
+                       $__param_set = explode(':',$_param_set);
+                       if(isset($__param_set[1]) && $__param_set[1])
+                       {
+                               $link_data[trim($__param_set[0])] = 
trim($__param_set[1]);
+                       }
+               }
+               return $GLOBALS['phpgw']->link($path, $link_data);
+       }
+
+
+
+       /**
        * cleans up a backtrace array and converts it to a string
        *
        * @internal this is such an ugly piece of code due to a reference to 
the error context




reply via email to

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