Merge pull request #9 from jocelyn/auto_hook_20141112
Restored implementation for auto register hooks.
This commit is contained in:
@@ -16,24 +16,20 @@ inherit
|
||||
|
||||
feature -- Hook
|
||||
|
||||
hook_auto_register (a_response: CMS_RESPONSE)
|
||||
auto_subscribe_to_hooks (a_response: CMS_RESPONSE)
|
||||
do
|
||||
if attached {CMS_HOOK_MENU_ALTER} Current as h_menu_alter then
|
||||
debug ("refactor_fixme")
|
||||
-- Fixme: CMS_RESPONSE.add_menu_alter_hook : a_response.add_menu_alter_hook (h_menu_alter)
|
||||
if attached {CMS_HOOK_MENU_SYSTEM_ALTER} Current as h_menu_system_alter then
|
||||
a_response.subscribe_to_menu_system_alter_hook (h_menu_system_alter)
|
||||
end
|
||||
if attached {CMS_HOOK_MENU_ALTER} Current as h_menu_alter then
|
||||
a_response.subscribe_to_menu_alter_hook (h_menu_alter)
|
||||
end
|
||||
if attached {CMS_HOOK_BLOCK} Current as h_block then
|
||||
debug ("refactor_fixme")
|
||||
-- Fixme: CMS_RESPONSE.add_block_hook a_response.add_block_hook (h_block)
|
||||
a_response.subscribe_to_block_hook (h_block)
|
||||
end
|
||||
if attached {CMS_HOOK_FORM_ALTER} Current as h_form then
|
||||
a_response.subscribe_to_form_alter_hook (h_form)
|
||||
end
|
||||
if attached {CMS_HOOK_FORM_ALTER} Current as h_block then
|
||||
debug ("refactor_fixme")
|
||||
-- CMS_RESPONSE.add_form_alter_hook a_response.add_form_alter_hook (h_block)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -44,6 +44,9 @@ feature {NONE} -- Initialization
|
||||
loop
|
||||
l_module := ic.item
|
||||
if l_module.is_enabled then
|
||||
if attached {CMS_HOOK_AUTO_REGISTER} l_module as l_auto then
|
||||
l_auto.auto_subscribe_to_hooks (Current)
|
||||
end
|
||||
l_module.register_hooks (Current)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user