Removed obsolete calls.
Updated code to make it clear what is the resource, and what is the associated module resource path.
This commit is contained in:
@@ -12,11 +12,12 @@ feature -- Factory
|
||||
template_block (a_module: CMS_MODULE; a_block_id: READABLE_STRING_8; a_response: CMS_RESPONSE): detachable CMS_SMARTY_TEMPLATE_BLOCK
|
||||
-- Smarty content block for `a_block_id' in the context of `a_module' and `a_response'.
|
||||
local
|
||||
res: PATH
|
||||
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.module_resource_path (a_module, p)
|
||||
create res.make_from_string ("templates")
|
||||
res := res.extended ("block_").appended (a_block_id).appended_with_extension ("tpl")
|
||||
p := a_response.module_resource_path (a_module, res)
|
||||
if p /= Void then
|
||||
if attached p.entry as e then
|
||||
create Result.make (a_block_id, Void, p.parent, e)
|
||||
|
||||
@@ -145,9 +145,9 @@ feature -- Settings: router
|
||||
create l_root_handler.make (api)
|
||||
create l_methods
|
||||
l_methods.enable_get
|
||||
a_router.handle_with_request_methods ("/", l_root_handler, l_methods)
|
||||
a_router.handle_with_request_methods ("", l_root_handler, l_methods)
|
||||
map_uri_agent_with_request_methods ("/favicon.ico", agent handle_favicon, a_router.methods_head_get)
|
||||
a_router.handle ("/", l_root_handler, l_methods)
|
||||
a_router.handle ("", l_root_handler, l_methods)
|
||||
map_uri_agent ("/favicon.ico", agent handle_favicon, a_router.methods_head_get)
|
||||
end
|
||||
|
||||
configure_api_file_handler (a_router: WSF_ROUTER)
|
||||
@@ -162,7 +162,7 @@ feature -- Settings: router
|
||||
do
|
||||
execute_default (ia_req, ia_res)
|
||||
end)
|
||||
a_router.handle_with_request_methods ("/theme/", fhdl, router.methods_GET)
|
||||
a_router.handle ("/theme/", fhdl, router.methods_GET)
|
||||
|
||||
|
||||
create fhdl.make_hidden_with_path (setup.environment.www_path)
|
||||
@@ -171,7 +171,7 @@ feature -- Settings: router
|
||||
do
|
||||
execute_default (ia_req, ia_res)
|
||||
end)
|
||||
a_router.handle_with_request_methods ("/", fhdl, router.methods_GET)
|
||||
a_router.handle ("/", fhdl, router.methods_GET)
|
||||
end
|
||||
|
||||
feature -- Execute Filter
|
||||
|
||||
@@ -160,9 +160,11 @@ feature -- Module
|
||||
rp: PATH
|
||||
ut: FILE_UTILITIES
|
||||
do
|
||||
-- Check first in selected theme folder.
|
||||
rp := module_assets_theme_location (a_module)
|
||||
Result := rp.extended_path (a_resource)
|
||||
if not ut.file_path_exists (Result) then
|
||||
-- And if not found, look into site/modules/$a_module.name/.... folders.
|
||||
rp := module_assets_location (a_module)
|
||||
Result := rp.extended_path (a_resource)
|
||||
if not ut.file_path_exists (Result) then
|
||||
|
||||
Reference in New Issue
Block a user