Added feed aggregation module.
Improved the CMS Block system to support condition.
This commit is contained in:
24
src/kernel/content/block/condition/cms_block_condition.e
Normal file
24
src/kernel/content/block/condition/cms_block_condition.e
Normal file
@@ -0,0 +1,24 @@
|
||||
note
|
||||
description: "Condition for block to be displayed."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
deferred class
|
||||
CMS_BLOCK_CONDITION
|
||||
|
||||
feature -- Access
|
||||
|
||||
description: READABLE_STRING_32
|
||||
deferred
|
||||
end
|
||||
|
||||
feature -- Evaluation
|
||||
|
||||
satisfied_for_response (res: CMS_RESPONSE): BOOLEAN
|
||||
deferred
|
||||
end
|
||||
|
||||
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
|
||||
@@ -0,0 +1,46 @@
|
||||
note
|
||||
description: "Condition for block to be displayed."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
CMS_BLOCK_EXPRESSION_CONDITION
|
||||
|
||||
inherit
|
||||
CMS_BLOCK_CONDITION
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make (a_exp: READABLE_STRING_8)
|
||||
do
|
||||
expression := a_exp
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
description: READABLE_STRING_32
|
||||
do
|
||||
create Result.make_from_string_general ("Expression: %"")
|
||||
Result.append_string_general (expression)
|
||||
Result.append_character ('%"')
|
||||
end
|
||||
|
||||
expression: STRING
|
||||
|
||||
feature -- Evaluation
|
||||
|
||||
satisfied_for_response (res: CMS_RESPONSE): BOOLEAN
|
||||
do
|
||||
if expression.same_string ("is_front") then
|
||||
Result := res.is_front
|
||||
elseif expression.starts_with ("path=") then
|
||||
end
|
||||
end
|
||||
|
||||
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
|
||||
@@ -39,6 +39,9 @@ feature -- Status report
|
||||
deferred
|
||||
end
|
||||
|
||||
conditions: detachable LIST [CMS_BLOCK_CONDITION]
|
||||
-- Optional block condition to be enabled.
|
||||
|
||||
feature -- Element change
|
||||
|
||||
add_css_class (a_class: READABLE_STRING_8)
|
||||
|
||||
Reference in New Issue
Block a user