Reuse improved CMS_HOOK_BLOCK_HELPER to help creation of block templates.

Fixed typo in basic auth login form.
This commit is contained in:
2016-02-18 16:13:58 +01:00
parent ff58593bff
commit fbda2c9eb2
11 changed files with 52 additions and 84 deletions

View File

@@ -16,6 +16,8 @@ inherit
CMS_HOOK_MENU_SYSTEM_ALTER
CMS_HOOK_BLOCK_HELPER
SHARED_LOGGER
feature {NONE} -- Initialization
@@ -86,23 +88,4 @@ feature -- Hooks
end
end
feature {NONE} -- Helpers
template_block (a_block_id: READABLE_STRING_8; a_response: CMS_RESPONSE): detachable CMS_SMARTY_TEMPLATE_BLOCK
-- Smarty content block for `a_block_id'
local
p: detachable PATH
do
create p.make_from_string ("templates")
p := p.extended ("block_").appended (a_block_id).appended_with_extension ("tpl")
p := a_response.api.module_theme_resource_location (Current, p)
if p /= Void then
if attached p.entry as e then
create Result.make (a_block_id, Void, p.parent, e)
else
create Result.make (a_block_id, Void, p.parent, p)
end
end
end
end