From 24604bdb5de3d50dce831850bf570e9a759524c1 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 3 May 2013 15:31:09 +0000 Subject: [PATCH] method to test which apps implement a hook --- phpgwapi/inc/class.hooks.inc.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/phpgwapi/inc/class.hooks.inc.php b/phpgwapi/inc/class.hooks.inc.php index 86244ee219..f88ed0ba63 100644 --- a/phpgwapi/inc/class.hooks.inc.php +++ b/phpgwapi/inc/class.hooks.inc.php @@ -201,6 +201,18 @@ class hooks return count($this->locations[$location][$app]); } + /** + * check which apps implement a given hook + * + * @param string $location location-name + * @return array of apps implementing given hook + */ + function hook_implemented($location) + { + //error_log(__METHOD__.__LINE__.array2string($this->locations[$location])); + return isset($this->locations[$location]) ? array_keys($this->locations[$location]) : array(); + } + /** * Register and/or de-register an application's hooks *