From 21800e71d339991bad9d27236d4815caabe4dae5 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Thu, 11 Jun 2015 23:03:34 +0200 Subject: [PATCH] Removed obsolete calls. Updated code to make it clear what is the resource, and what is the associated module resource path. --- src/hooks/cms_hook_block_helper.e | 7 ++++--- src/service/cms_execution.e | 10 +++++----- src/service/response/cms_response.e | 2 ++ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/hooks/cms_hook_block_helper.e b/src/hooks/cms_hook_block_helper.e index b36e12e..c0da7de 100644 --- a/src/hooks/cms_hook_block_helper.e +++ b/src/hooks/cms_hook_block_helper.e @@ -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) diff --git a/src/service/cms_execution.e b/src/service/cms_execution.e index 823ec8e..2160cb6 100644 --- a/src/service/cms_execution.e +++ b/src/service/cms_execution.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 diff --git a/src/service/response/cms_response.e b/src/service/response/cms_response.e index ca409a9..234a0c8 100644 --- a/src/service/response/cms_response.e +++ b/src/service/response/cms_response.e @@ -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