From: cajus Date: Thu, 20 Aug 2009 09:44:57 +0000 (+0000) Subject: Added function tog et events by category X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e9929eda5ace576f2ed01212e4bab5b464c358af;p=gosa.git Added function tog et events by category git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14090 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc b/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc index 575626165..bf9b968d7 100644 --- a/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc +++ b/gosa-plugins/goto/addons/goto/events/class_DaemonEvent.inc @@ -358,6 +358,26 @@ class DaemonEvent } + /*! \brief Returns a complete list of all available events. + @return Array Containing $this->get_event_info() for all available events. + */ + static function get_event_types_by_category($categories) + { + $types= array(); + + foreach ($categories as $category) { + if (preg_match('/^users$/', $category)) { + $types= array_merge($types, DaemonEvent::get_event_types(USER_EVENT)); + } + if (preg_match('/^systems$/', $category)) { + $types= array_merge($types, DaemonEvent::get_event_types(SYSTEM_EVENT)); + } + } + + return $types; + } + + /*! \brief Returns a complete list of all available events. @return Array Containing $this->get_event_info() for all available events. */