Updated CMS_HOOK_BLOCK, to provide a better block_identifiers (CMS_RESPONSE): detachable ITERABLE [READABLE_STRING_8] query, to be implemented by CMS_HOOK_RESPONSE_BLOCK descendants.
Added CONFIG_READER.table_keys: detachable LIST [READABLE_STRING_32].
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
note
|
||||
description: "[
|
||||
Hook providing a way to alter a block.
|
||||
Hook providing a way to provide blocks.
|
||||
]"
|
||||
date: "$Date: 2014-11-19 20:00:19 +0100 (mer., 19 nov. 2014) $"
|
||||
revision: "$Revision: 96123 $"
|
||||
@@ -13,13 +13,21 @@ inherit
|
||||
|
||||
feature -- Hook
|
||||
|
||||
block_list: ITERABLE [like {CMS_BLOCK}.name]
|
||||
block_list: detachable ITERABLE [like {CMS_BLOCK}.name]
|
||||
-- List of block names, managed by current object.
|
||||
-- If prefixed by "?", condition will be check
|
||||
-- If prefixed by "?", condition will be checked
|
||||
-- to determine if it should be displayed (and computed) or not.
|
||||
deferred
|
||||
end
|
||||
|
||||
block_identifiers (a_response: detachable CMS_RESPONSE): detachable ITERABLE [like {CMS_BLOCK}.name]
|
||||
-- List of block names, managed by current object, in the context of `a_response' if set.
|
||||
-- If prefixed by "?", condition will be checked
|
||||
-- to determine if it should be displayed (and computed) or not.
|
||||
do
|
||||
Result := block_list
|
||||
end
|
||||
|
||||
get_block_view (a_block_id: READABLE_STRING_8; a_response: CMS_RESPONSE)
|
||||
-- Get block object identified by `a_block_id' and associate with `a_response'.
|
||||
deferred
|
||||
|
||||
@@ -150,9 +150,12 @@ feature -- Hook: block
|
||||
across
|
||||
lst as c
|
||||
loop
|
||||
if attached {CMS_HOOK_BLOCK} c.item as h then
|
||||
if
|
||||
attached {CMS_HOOK_BLOCK} c.item as h and then
|
||||
attached h.block_identifiers (a_response) as l_names
|
||||
then
|
||||
across
|
||||
h.block_list as blst
|
||||
l_names as blst
|
||||
loop
|
||||
bl := blst.item
|
||||
bl_optional := bl.count > 0 and bl[1] = '?'
|
||||
@@ -252,6 +255,6 @@ feature -- Hook: export
|
||||
end
|
||||
|
||||
note
|
||||
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
||||
copyright: "2011-2016, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
end
|
||||
|
||||
45
src/hooks/cms_hook_response_block.e
Normal file
45
src/hooks/cms_hook_response_block.e
Normal file
@@ -0,0 +1,45 @@
|
||||
note
|
||||
description: "[
|
||||
Hook providing a way to provide blocks,
|
||||
within the context of a response.
|
||||
]"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
CMS_HOOK_RESPONSE_BLOCK
|
||||
|
||||
inherit
|
||||
CMS_HOOK_BLOCK
|
||||
rename
|
||||
block_identifiers as old_block_identifiers
|
||||
redefine
|
||||
old_block_identifiers
|
||||
end
|
||||
|
||||
feature -- Hook
|
||||
|
||||
frozen block_list: detachable ITERABLE [like {CMS_BLOCK}.name]
|
||||
-- List of block names, managed by current object.
|
||||
-- If prefixed by "?", condition will be checked
|
||||
-- to determine if it should be displayed (and computed) or not.
|
||||
do
|
||||
Result := block_identifiers (Void)
|
||||
end
|
||||
|
||||
frozen old_block_identifiers (a_response: detachable CMS_RESPONSE): detachable ITERABLE [like {CMS_BLOCK}.name]
|
||||
do
|
||||
Result := block_identifiers (a_response)
|
||||
end
|
||||
|
||||
block_identifiers (a_response: detachable CMS_RESPONSE): detachable ITERABLE [like {CMS_BLOCK}.name]
|
||||
-- List of block names, managed by current object, in the context of `a_response' if set.
|
||||
-- If prefixed by "?", condition will be checked
|
||||
-- to determine if it should be displayed (and computed) or not.
|
||||
deferred
|
||||
end
|
||||
|
||||
note
|
||||
copyright: "2011-2016, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||
end
|
||||
Reference in New Issue
Block a user