Files
ROC/src/hooks/cms_hook_manager.e
Jocelyn Fiat 46014da3d8 Added recent_changes module.
Revisited hooks management, and added new CMS_HOOK_MANAGER.
Added admin, and other link into navigation menu that goes into first sidebar.
Fixed theme info, and template for sidebar ids.
Better css class name for cms node content.
2015-08-12 17:30:07 +02:00

56 lines
1.1 KiB
Plaintext

note
description: "Hooks manager."
date: "$Date$"
revision: "$Revision$"
class
CMS_HOOK_MANAGER
create
make
feature {NONE} -- Initialization
make
do
create all_subscribers.make (0)
end
feature -- Access
subscribers (a_type: TYPE [CMS_HOOK]): detachable LIST [CMS_HOOK]
-- Subscribers of hook typed `a_type'.
do
Result := all_subscribers.item (a_type)
end
feature -- Change
subscribe_to_hook (h: CMS_HOOK; a_hook_type: TYPE [CMS_HOOK])
-- Subscribe `h' to hooks identified by `a_hook_type'.
local
lst: detachable LIST [CMS_HOOK]
do
lst := all_subscribers.item (a_hook_type)
if lst = Void then
create {ARRAYED_LIST [CMS_HOOK]} lst.make (1)
all_subscribers.force (lst, a_hook_type)
end
if not lst.has (h) then
lst.force (h)
end
end
feature {NONE} -- Implementation
all_subscribers: HASH_TABLE [LIST [CMS_HOOK], TYPE [CMS_HOOK]]
invariant
all_subscribers /= Void
note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end