diff --git a/hooks/lib/redmine/hook.rb b/hooks/lib/redmine/hook.rb index fecdfed9a..79961b2bb 100644 --- a/hooks/lib/redmine/hook.rb +++ b/hooks/lib/redmine/hook.rb @@ -104,9 +104,11 @@ module Redmine # in views like this: # <%= call_hook(:some_hook) %> # <%= call_hook(:another_hook, :foo => 'bar' %> + # + # Current project is automatically added to the call context. module Helper def call_hook(hook, context={}) - Redmine::Hook.call_hook(hook, context) + Redmine::Hook.call_hook(hook, {:project => @project}.merge(context)) end end end @@ -114,3 +116,9 @@ end ApplicationHelper.send(:include, Redmine::Hook::Helper) +class Hello < Redmine::Hook::ViewListener + def view_layouts_base_html_head(context) + context[:project].to_s + end +end +