mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:15 +01:00
Add single_tpl() - allows an included file to return a value instead of echo, etc.
This commit is contained in:
parent
84eb1201ce
commit
3ea803c565
@ -157,6 +157,40 @@
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
@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
|
||||
|
Loading…
Reference in New Issue
Block a user