Improved block condition "path:..." by allowing wildchar.

Added weight data to CMS_BLOCK to be able to sort the block lists,
  and thus order the display of blocks.
Set negative weight for various core block, so that they appear first as expected.
The weight can be set and overwritten in cms.ini , by pref  blocks.{block_id}.weight=integer_weight.
This commit is contained in:
2015-10-16 17:22:22 +02:00
parent 788cf3738d
commit 05472abdd7
7 changed files with 91 additions and 8 deletions

View File

@@ -6,7 +6,12 @@ deferred class
CMS_BLOCK
inherit
COMPARABLE
DEBUG_OUTPUT
undefine
is_equal
end
feature -- Access
@@ -23,6 +28,10 @@ feature -- Access
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
@@ -42,6 +51,14 @@ feature -- Status report
conditions: detachable LIST [CMS_BLOCK_CONDITION]
-- Optional block condition to be enabled.
feature -- Comparison
is_less alias "<" (other: like Current): BOOLEAN
-- <Precursor>.
do
Result := weight < other.weight
end
feature -- Element change
add_css_class (a_class: READABLE_STRING_8)
@@ -83,6 +100,12 @@ feature -- Element change
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