Updated CMS code.
Separated code to have a lib and an example. Improved design, fixed a few issues related to folder location. This is still experimental and require more work to be really friendly to use.
This commit is contained in:
10
draft/application/cms/src/hooks/cms_hook.e
Normal file
10
draft/application/cms/src/hooks/cms_hook.e
Normal file
@@ -0,0 +1,10 @@
|
||||
note
|
||||
description: "Summary description for {CMS_HOOK}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
CMS_HOOK
|
||||
|
||||
end
|
||||
29
draft/application/cms/src/hooks/cms_hook_auto_register.e
Normal file
29
draft/application/cms/src/hooks/cms_hook_auto_register.e
Normal file
@@ -0,0 +1,29 @@
|
||||
note
|
||||
description: "[
|
||||
Summary description for {CMS_HOOK_AUTO_REGISTER}.
|
||||
When inheriting from this class, the declared hooks are automatically
|
||||
registered, otherwise, each descendant has to add it to the cms service
|
||||
itself.
|
||||
]"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
CMS_HOOK_AUTO_REGISTER
|
||||
|
||||
inherit
|
||||
CMS_HOOK
|
||||
|
||||
feature -- Hook
|
||||
|
||||
hook_auto_register (a_service: CMS_SERVICE)
|
||||
do
|
||||
if attached {CMS_HOOK_MENU_ALTER} Current as h_menu_alter then
|
||||
a_service.add_menu_alter_hook (h_menu_alter)
|
||||
end
|
||||
if attached {CMS_HOOK_BLOCK} Current as h_block then
|
||||
a_service.add_block_hook (h_block)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
23
draft/application/cms/src/hooks/cms_hook_block.e
Normal file
23
draft/application/cms/src/hooks/cms_hook_block.e
Normal file
@@ -0,0 +1,23 @@
|
||||
note
|
||||
description: "Summary description for {CMS_HOOK_BLOCK}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
CMS_HOOK_BLOCK
|
||||
|
||||
inherit
|
||||
CMS_HOOK
|
||||
|
||||
feature -- Hook
|
||||
|
||||
block_list: ITERABLE [like {CMS_BLOCK}.name]
|
||||
deferred
|
||||
end
|
||||
|
||||
get_block_view (a_block_id: detachable READABLE_STRING_8; a_execution: CMS_EXECUTION)
|
||||
deferred
|
||||
end
|
||||
|
||||
end
|
||||
19
draft/application/cms/src/hooks/cms_hook_form_alter.e
Normal file
19
draft/application/cms/src/hooks/cms_hook_form_alter.e
Normal file
@@ -0,0 +1,19 @@
|
||||
note
|
||||
description: "Summary description for {CMS_HOOK_FORM_ALTER}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
CMS_HOOK_FORM_ALTER
|
||||
|
||||
inherit
|
||||
CMS_HOOK
|
||||
|
||||
feature -- Hook
|
||||
|
||||
form_alter (a_form: CMS_FORM; a_execution: CMS_EXECUTION)
|
||||
deferred
|
||||
end
|
||||
|
||||
end
|
||||
19
draft/application/cms/src/hooks/cms_hook_menu_alter.e
Normal file
19
draft/application/cms/src/hooks/cms_hook_menu_alter.e
Normal file
@@ -0,0 +1,19 @@
|
||||
note
|
||||
description: "Summary description for {CMS_HOOK_MENU_ALTER}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
CMS_HOOK_MENU_ALTER
|
||||
|
||||
inherit
|
||||
CMS_HOOK
|
||||
|
||||
feature -- Hook
|
||||
|
||||
menu_alter (a_menu_system: CMS_MENU_SYSTEM; a_execution: CMS_EXECUTION)
|
||||
deferred
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user