quietened PHP Warning: array_keys() expects parameter 1 to be array, null given on line 106

This commit is contained in:
Ralf Becker 2011-08-11 07:31:47 +00:00
parent 9c82896a7b
commit 4f54abdda2

View File

@ -43,7 +43,7 @@ class hooks
var $table = 'egw_hooks'; var $table = 'egw_hooks';
/** /**
* Hooks by location and appname * Hooks by location and appname
* *
* @var array $location => $app => $file * @var array $location => $app => $file
*/ */
var $locations; var $locations;
@ -78,7 +78,7 @@ class hooks
/** /**
* Executes all the hooks (the user has rights to) for a given location * Executes all the hooks (the user has rights to) for a given location
* *
* If no $order given, hooks are executed in the order of the applications! * If no $order given, hooks are executed in the order of the applications!
* *
* @param string|array $args location-name as string or array with keys location and * @param string|array $args location-name as string or array with keys location and
@ -103,7 +103,7 @@ class hooks
if (!$no_permission_check) if (!$no_permission_check)
{ {
// on install of a new egroupware both hook-apps and user apps may be empty/not set // on install of a new egroupware both hook-apps and user apps may be empty/not set
$apps = array_intersect((array)$apps,(array)array_keys($GLOBALS['egw_info']['user']['apps'])); $apps = array_intersect((array)$apps,array_keys((array)$GLOBALS['egw_info']['user']['apps']));
} }
if ($order) if ($order)
{ {
@ -254,9 +254,9 @@ class hooks
// some apps have setup_info for more then themselfs (eg. phpgwapi for groupdav) // some apps have setup_info for more then themselfs (eg. phpgwapi for groupdav)
foreach($setup_info as $appname => $data) foreach($setup_info as $appname => $data)
{ {
if ($data['hooks']) if ($data['hooks'])
{ {
if ($hdata[$appname]) if ($hdata[$appname])
{ {
$hdata[$appname]['hooks'] = array_merge($hdata[$appname]['hooks'],$data['hooks']); $hdata[$appname]['hooks'] = array_merge($hdata[$appname]['hooks'],$data['hooks']);
} }