phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: phpgwapi/inc class.hooks.inc.php,1.11,1.12


From: Miles Lott <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgwapi/inc class.hooks.inc.php,1.11,1.12
Date: Sun, 10 Feb 2002 14:34:14 -0500

Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv13798/phpgwapi/inc

Modified Files:
        class.hooks.inc.php 
Log Message:
Add single_tpl() - allows an included file to return a value instead of echo, 
etc.



Index: class.hooks.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.hooks.inc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** class.hooks.inc.php 10 Feb 2002 12:17:19 -0000      1.11
--- class.hooks.inc.php 10 Feb 2002 19:34:11 -0000      1.12
***************
*** 159,162 ****
--- 159,196 ----
  
                /*!
+               @function single_tpl
+               @abstract call the hooks for a single application, return 
output from the hook
+               @discussion This is only used so far for the wcm app (website 
hook) - Milosch.
+               @param $location hook location - required
+               @param $appname application name - optional
+               */
+               function single_tpl($location, $appname='', 
$no_permission_check=False)
+               {
+                       if(!$appname)
+                       {
+                               $appname = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       }
+                       $SEP = filesystem_separator();
+ 
+                       if(@isset($this->found_hooks[$appname][$location]))
+                       {
+                               $f = PHPGW_SERVER_ROOT . $SEP . $appname . $SEP 
. 'inc' . $SEP . $this->found_hooks[$appname][$location];
+                               if(@file_exists($f) &&
+                                       ( 
$GLOBALS['phpgw_info']['user']['apps'][$appname] || (($no_permission_check || 
$location == 'config' || $appname == 'phpgwapi') && $appname)) )
+                               {
+                                       return include($f);
+                               }
+                               else
+                               {
+                                       return '';
+                               }
+                       }
+                       else
+                       {
+                               return '';
+                       }
+               }
+ 
+               /*!
                @function count
                @abstract loop through the applications and count the hooks




reply via email to

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