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
|
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'.
|
-- Smarty content block for `a_block_id' in the context of `a_module' and `a_response'.
|
||||||
local
|
local
|
||||||
|
res: PATH
|
||||||
p: detachable PATH
|
p: detachable PATH
|
||||||
do
|
do
|
||||||
create p.make_from_string ("templates")
|
create res.make_from_string ("templates")
|
||||||
p := p.extended ("block_").appended (a_block_id).appended_with_extension ("tpl")
|
res := res.extended ("block_").appended (a_block_id).appended_with_extension ("tpl")
|
||||||
p := a_response.module_resource_path (a_module, p)
|
p := a_response.module_resource_path (a_module, res)
|
||||||
if p /= Void then
|
if p /= Void then
|
||||||
if attached p.entry as e then
|
if attached p.entry as e then
|
||||||
create Result.make (a_block_id, Void, p.parent, e)
|
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_root_handler.make (api)
|
||||||
create l_methods
|
create l_methods
|
||||||
l_methods.enable_get
|
l_methods.enable_get
|
||||||
a_router.handle_with_request_methods ("/", l_root_handler, l_methods)
|
a_router.handle ("/", l_root_handler, l_methods)
|
||||||
a_router.handle_with_request_methods ("", l_root_handler, l_methods)
|
a_router.handle ("", l_root_handler, l_methods)
|
||||||
map_uri_agent_with_request_methods ("/favicon.ico", agent handle_favicon, a_router.methods_head_get)
|
map_uri_agent ("/favicon.ico", agent handle_favicon, a_router.methods_head_get)
|
||||||
end
|
end
|
||||||
|
|
||||||
configure_api_file_handler (a_router: WSF_ROUTER)
|
configure_api_file_handler (a_router: WSF_ROUTER)
|
||||||
@@ -162,7 +162,7 @@ feature -- Settings: router
|
|||||||
do
|
do
|
||||||
execute_default (ia_req, ia_res)
|
execute_default (ia_req, ia_res)
|
||||||
end)
|
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)
|
create fhdl.make_hidden_with_path (setup.environment.www_path)
|
||||||
@@ -171,7 +171,7 @@ feature -- Settings: router
|
|||||||
do
|
do
|
||||||
execute_default (ia_req, ia_res)
|
execute_default (ia_req, ia_res)
|
||||||
end)
|
end)
|
||||||
a_router.handle_with_request_methods ("/", fhdl, router.methods_GET)
|
a_router.handle ("/", fhdl, router.methods_GET)
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Execute Filter
|
feature -- Execute Filter
|
||||||
|
|||||||
@@ -160,9 +160,11 @@ feature -- Module
|
|||||||
rp: PATH
|
rp: PATH
|
||||||
ut: FILE_UTILITIES
|
ut: FILE_UTILITIES
|
||||||
do
|
do
|
||||||
|
-- Check first in selected theme folder.
|
||||||
rp := module_assets_theme_location (a_module)
|
rp := module_assets_theme_location (a_module)
|
||||||
Result := rp.extended_path (a_resource)
|
Result := rp.extended_path (a_resource)
|
||||||
if not ut.file_path_exists (Result) then
|
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)
|
rp := module_assets_location (a_module)
|
||||||
Result := rp.extended_path (a_resource)
|
Result := rp.extended_path (a_resource)
|
||||||
if not ut.file_path_exists (Result) then
|
if not ut.file_path_exists (Result) then
|
||||||
|
|||||||
Reference in New Issue
Block a user