Added notion of alias block, to provide a way to include a block content in mutiple regions.

This commit is contained in:
2015-10-16 23:02:47 +02:00
parent 05472abdd7
commit e90f82387f
9 changed files with 306 additions and 98 deletions

View File

@@ -6,6 +6,11 @@ deferred class
CMS_BLOCK
inherit
CMS_BLOCK_SETUP
undefine
is_equal
end
COMPARABLE
DEBUG_OUTPUT
@@ -20,18 +25,9 @@ feature -- Access
deferred
end
title: detachable READABLE_STRING_32
-- Optional title.
deferred
end
html_options: detachable CMS_HTML_OPTIONS
-- Optional addition html options.
weight: INTEGER
-- Weight used to order blocks.
-- Default: 0;
feature -- Status report
is_empty: BOOLEAN
@@ -48,9 +44,6 @@ feature -- Status report
deferred
end
conditions: detachable LIST [CMS_BLOCK_CONDITION]
-- Optional block condition to be enabled.
feature -- Comparison
is_less alias "<" (other: like Current): BOOLEAN
@@ -87,25 +80,6 @@ feature -- Element change
opts.remove_css_class (a_class)
end
add_condition (a_condition: CMS_BLOCK_CONDITION)
-- Add condition `a_condition'.
local
l_conditions: like conditions
do
l_conditions := conditions
if l_conditions = Void then
create {ARRAYED_LIST [CMS_BLOCK_CONDITION]} l_conditions.make (1)
conditions := l_conditions
end
l_conditions.force (a_condition)
end
set_weight (w: like weight)
-- Set `weight' to `w'.
do
weight := w
end
feature -- Conversion
to_html (a_theme: CMS_THEME): STRING_8