note description: "Summary description for {CMS_DEBUG_MODULE}." date: "$Date: 2014-12-18 16:47:20 +0100 (jeu., 18 déc. 2014) $" revision: "$Revision: 96384 $" class CMS_DEBUG_MODULE inherit CMS_MODULE redefine register_hooks end CMS_HOOK_BLOCK CMS_HOOK_AUTO_REGISTER SHARED_EXECUTION_ENVIRONMENT export {NONE} all end create make feature {NONE} -- Initialization make do name := "debug" version := "1.0" description := "Debug" package := "cms" end feature -- Router router (a_api: CMS_API): WSF_ROUTER -- Router configuration. do create Result.make (1) Result.handle ("/debug/", create {WSF_URI_TEMPLATE_AGENT_HANDLER}.make (agent handle_debug (a_api, ?, ?))) end feature -- Hooks configuration register_hooks (a_response: CMS_RESPONSE) -- Module hooks configuration. do auto_subscribe_to_hooks (a_response) a_response.subscribe_to_block_hook (Current) end feature -- Hooks block_list: ITERABLE [like {CMS_BLOCK}.name] do Result := <<"debug-info">> end get_block_view (a_block_id: READABLE_STRING_8; a_response: CMS_RESPONSE) local b: CMS_CONTENT_BLOCK dbg: WSF_DEBUG_INFORMATION s: STRING do if a_response.theme.has_region ("debug") then create dbg.make create s.make_empty dbg.append_information_to (a_response.request, a_response.response, s) create b.make ("debug-info", "Debug", s, a_response.api.formats.plain_text) a_response.add_block (b, "footer") end end feature -- Handler handle_debug (api: CMS_API; req: WSF_REQUEST; res: WSF_RESPONSE) local r: CMS_RESPONSE s: STRING do if req.is_get_request_method then create {GENERIC_VIEW_CMS_RESPONSE} r.make (req, res, api) r.set_title ("DEBUG") create s.make_empty append_info_to ("Name", api.setup.site_name, r, s) append_info_to ("Url", api.setup.site_url, r, s) if attached api.setup.environment.cms_config_ini_path as l_loc then s.append ("