You are here

function watchdog_triggers_action_info_alter in Logging and alerts 7

Same name and namespace in other branches
  1. 6.2 watchdog_triggers/watchdog_triggers.module \watchdog_triggers_action_info_alter()
  2. 6 watchdog_triggers/watchdog_triggers.module \watchdog_triggers_action_info_alter()
  3. 7.2 watchdog_triggers/watchdog_triggers.module \watchdog_triggers_action_info_alter()

Implements hook_action_info_alter().

File

watchdog_triggers/watchdog_triggers.module, line 42
Provides a Trigger and Action integration for watchdog events.

Code

function watchdog_triggers_action_info_alter(&$info) {
  foreach ($info as $type => $data) {
    if (stripos($type, "user_") === 0 || stripos($type, "system_") === 0) {
      if (isset($info[$type]['hooks']['application'])) {
        $info[$type]['hooks']['watchdog_logged'] = array_merge($info[$type]['hooks']['watchdog_logged'], array(
          'watchdog_logged',
        ));
      }
      else {
        $info[$type]['hooks']['watchdog_logged'] = array(
          'watchdog_logged',
        );
      }
    }
  }
}