mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-20 09:58:04 +02:00
Switch to local hook function to avoid catch_22/chicken-egg/cart-horse situation
This commit is contained in:
parent
a012283ba5
commit
0740e85b12
@ -158,12 +158,10 @@
|
|||||||
var $accounts;
|
var $accounts;
|
||||||
var $applications;
|
var $applications;
|
||||||
var $db;
|
var $db;
|
||||||
var $hooks;
|
|
||||||
}
|
}
|
||||||
$GLOBALS['phpgw'] = new phpgw;
|
$GLOBALS['phpgw'] = new phpgw;
|
||||||
$GLOBALS['phpgw']->common = CreateObject('phpgwapi.common');
|
$GLOBALS['phpgw']->common = CreateObject('phpgwapi.common');
|
||||||
$GLOBALS['phpgw']->db = $phpgw_setup->db;
|
$GLOBALS['phpgw']->db = $phpgw_setup->db;
|
||||||
$GLOBALS['phpgw']->hooks = CreateObject('phpgwapi.hooks');
|
|
||||||
|
|
||||||
$cfg_apps = array('phpgwapi','admin','preferences');
|
$cfg_apps = array('phpgwapi','admin','preferences');
|
||||||
while(list(,$cfg_app) = each($cfg_apps))
|
while(list(,$cfg_app) = each($cfg_apps))
|
||||||
@ -179,7 +177,7 @@
|
|||||||
$t->set_var('row_off', 'EEEEEE');
|
$t->set_var('row_off', 'EEEEEE');
|
||||||
|
|
||||||
$vars = $t->get_undefined('body');
|
$vars = $t->get_undefined('body');
|
||||||
$GLOBALS['phpgw']->hooks->single('config',$cfg_app);
|
$phpgw_setup->hook('config',$cfg_app);
|
||||||
|
|
||||||
while (list($null,$value) = each($vars))
|
while (list($null,$value) = each($vars))
|
||||||
{
|
{
|
||||||
|
@ -532,6 +532,32 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@function hook
|
||||||
|
@abstract call the hooks for a single application
|
||||||
|
@param $location hook location - required
|
||||||
|
@param $appname application name - optional
|
||||||
|
*/
|
||||||
|
function hook($location, $appname = '')
|
||||||
|
{
|
||||||
|
if (! $appname)
|
||||||
|
{
|
||||||
|
$appname = $GLOBALS['phpgw_info']['flags']['currentapp'];
|
||||||
|
}
|
||||||
|
$SEP = filesystem_separator();
|
||||||
|
|
||||||
|
$f = PHPGW_SERVER_ROOT . $SEP . $appname . $SEP . 'inc' . $SEP . 'hook_' . $location . '.inc.php';
|
||||||
|
if (file_exists($f))
|
||||||
|
{
|
||||||
|
include($f);
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
@function alessthanb
|
@function alessthanb
|
||||||
@abstract phpgw version checking, is param 1 < param 2 in phpgw versionspeak?
|
@abstract phpgw version checking, is param 1 < param 2 in phpgw versionspeak?
|
||||||
@param $a phpgw version number to check if less than $b
|
@param $a phpgw version number to check if less than $b
|
||||||
|
Loading…
x
Reference in New Issue
Block a user