diff --git a/modules/recent_changes/cms_recent_changes_module.e b/modules/recent_changes/cms_recent_changes_module.e index bf26f46..f5c6a41 100644 --- a/modules/recent_changes/cms_recent_changes_module.e +++ b/modules/recent_changes/cms_recent_changes_module.e @@ -70,6 +70,7 @@ feature -- Hook b: CMS_CONTENT_BLOCK s, l_content: STRING gen: FEED_TO_XHTML_VISITOR + nb: NATURAL_32 do if a_block_id.same_string_general ("recent_changes") then create l_content.make (1024) @@ -81,7 +82,16 @@ feature -- Hook s.append_string ("") gen.set_footer (s) - recent_changes_feed (a_response, 10, Void).accept (gen) + nb := 10 + if + attached a_response.block_options (a_block_id) as l_options and then + attached {READABLE_STRING_GENERAL} l_options.item ("size") as l_size and then + l_size.is_integer + then + nb := l_size.to_natural_32 + end + + recent_changes_feed (a_response, nb, Void).accept (gen) create b.make (a_block_id, Void, l_content, Void) a_response.put_block (b, Void, False) diff --git a/src/service/response/cms_response.e b/src/service/response/cms_response.e index 2ff4f46..75e9a21 100644 --- a/src/service/response/cms_response.e +++ b/src/service/response/cms_response.e @@ -465,6 +465,14 @@ feature -- Block management end end + block_options (a_block_id: READABLE_STRING_8): detachable STRING_TABLE [READABLE_STRING_32] + -- Options associated with `a_block_id' in configuration, if any. + do + if attached setup.text_table_item ("blocks." + a_block_id + ".options") as tb then + Result := tb + end + end + is_block_included (a_block_id: READABLE_STRING_8; dft: BOOLEAN): BOOLEAN -- Is block `a_block_id' included in current response? -- If no preference, return `dft'.