Browse Source

Added Redmine::Plugin::Hook::Manager.clear_listeners to remove all hook listeners.

plugin-hooks
Eric Davis 16 years ago
parent
commit
cb485c92ef
1 changed files with 7 additions and 0 deletions
  1. 7
    0
      lib/redmine/plugin.rb

+ 7
- 0
lib/redmine/plugin.rb View File

@@ -191,6 +191,13 @@ module Redmine #:nodoc:
puts "Listener added for #{hook_name.to_s}"
end
end

# Removes all listeners
def clear_listeners()
@@hooks.each do |hook, registrations|
@@hooks[hook] = []
end
end
# Run all the hooks for +hook_name+ passing in +context+
def call_hook(hook_name, context = { })

Loading…
Cancel
Save