fix for bug in register_all_hooks: if apps define hooks for other apps last app wins: seen with/for perp_ar; now all available hooks are collected first and then registered with register_hooks (loop per app)

This commit is contained in:
Klaus Leithoff 2011-01-12 10:55:03 +00:00
parent fd4315fec3
commit 95906905e4

View File

@ -253,6 +253,20 @@ class hooks
if(@file_exists($f)) include($f);
// some apps have setup_info for more then themselfs (eg. phpgwapi for groupdav)
foreach($setup_info as $appname => $data)
{
if ($data['hooks'])
{
if ($hdata[$appname])
{
$hdata[$appname]['hooks'] = array_merge($hdata[$appname]['hooks'],$data['hooks']);
}
else
{
$hdata[$appname]['hooks'] = $data['hooks'];
}
}
}
foreach((array)$hdata as $appname => $data)
{
if ($data['hooks']) $this->register_hooks($appname,$data['hooks']);
}