Added notion of "front" page.
Changed CMS_HOOK_BLOCK.get_block_view to accept only attached string for `a_block_id'. Keep simple name in CMS_MENU_SYSTEM. Module that implements a CMS_HOOK need now to redefine CMS_MODULE.register_hooks . Added simple code for NODE_MODULE, in order to see something. Added CMS_URL_UTILITIES that should be used to compute url for cms path such as "/foo/bar". Implemented get_active in CMS_RESPONSE to update the "is_active" on each link. Added NOT_IMPLEMENTED_ERROR_CMS_RESPONSE. Implemented a few hooks in DEMO module, for testing. Updated smarty template related code.
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||
<library name="base_extension" location="$ISE_LIBRARY\library\base_extension\base_extension-safe.ecf"/>
|
||||
<library name="cms" location="..\..\..\..\cms\cms-safe.ecf" readonly="false"/>
|
||||
<library name="cms_model" location="..\..\..\..\model\model-safe.ecf" readonly="false"/>
|
||||
<library name="http" location="$ISE_LIBRARY\contrib\library\network\protocol\http\http-safe.ecf"/>
|
||||
<library name="json" location="$ISE_LIBRARY\contrib\library\text\parser\json\library\json-safe.ecf" readonly="false"/>
|
||||
<library name="time" location="$ISE_LIBRARY\library\time\time-safe.ecf"/>
|
||||
|
||||
@@ -9,6 +9,13 @@ class
|
||||
|
||||
inherit
|
||||
CMS_MODULE
|
||||
redefine
|
||||
register_hooks
|
||||
end
|
||||
|
||||
CMS_HOOK_MENU_ALTER
|
||||
|
||||
CMS_HOOK_BLOCK
|
||||
|
||||
create
|
||||
make
|
||||
@@ -30,20 +37,63 @@ feature -- Access: router
|
||||
do
|
||||
create Result.make (2)
|
||||
|
||||
map_uri_template_agent (Result, "/demo/", agent handle_demo)
|
||||
map_uri_template_agent (Result, "/book/{id}", agent handle_demo_entry)
|
||||
map_uri_template_agent (Result, "/demo/", agent handle_demo (?,?,a_api))
|
||||
map_uri_template_agent (Result, "/demo/{id}", agent handle_demo_entry (?,?,a_api))
|
||||
end
|
||||
|
||||
feature -- Hooks
|
||||
|
||||
register_hooks (a_response: CMS_RESPONSE)
|
||||
do
|
||||
a_response.add_menu_alter_hook (Current)
|
||||
a_response.add_block_hook (Current)
|
||||
end
|
||||
|
||||
block_list: ITERABLE [like {CMS_BLOCK}.name]
|
||||
do
|
||||
Result := <<"demo-info">>
|
||||
end
|
||||
|
||||
get_block_view (a_block_id: READABLE_STRING_8; a_response: CMS_RESPONSE)
|
||||
local
|
||||
b: CMS_CONTENT_BLOCK
|
||||
mb: CMS_MENU_BLOCK
|
||||
m: CMS_MENU
|
||||
lnk: CMS_LOCAL_LINK
|
||||
do
|
||||
if a_block_id.is_case_insensitive_equal_general ("demo-info") then
|
||||
if a_response.request.request_uri.starts_with ("/demo/") then
|
||||
create m.make_with_title (a_block_id, "Demo", 2)
|
||||
create lnk.make ("/demo/abc", a_response.url ("/demo/abc", Void))
|
||||
m.extend (lnk)
|
||||
create lnk.make ("/demo/123", a_response.url ("/demo/123", Void))
|
||||
m.extend (lnk)
|
||||
create mb.make (m)
|
||||
a_response.add_block (mb, "sidebar_second")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
menu_alter (a_menu_system: CMS_MENU_SYSTEM; a_response: CMS_RESPONSE)
|
||||
local
|
||||
lnk: CMS_LOCAL_LINK
|
||||
-- perms: detachable ARRAYED_LIST [READABLE_STRING_8]
|
||||
do
|
||||
create lnk.make ("Demo", "/demo/")
|
||||
a_menu_system.primary_menu.extend (lnk)
|
||||
end
|
||||
|
||||
feature -- Handler
|
||||
|
||||
handle_demo,
|
||||
handle_demo_entry (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||
handle_demo_entry (req: WSF_REQUEST; res: WSF_RESPONSE; a_api: CMS_API)
|
||||
local
|
||||
m: WSF_NOT_FOUND_RESPONSE
|
||||
r: NOT_IMPLEMENTED_ERROR_CMS_RESPONSE
|
||||
do
|
||||
create m.make (req)
|
||||
m.set_body ("Not yet implemented!")
|
||||
res.send (m)
|
||||
create r.make (req, res, a_api)
|
||||
r.set_main_content ("NODE module does not yet implement %"" + req.path_info + "%" ...")
|
||||
r.add_error_message ("NODE Module: not yet implemented")
|
||||
r.execute
|
||||
end
|
||||
|
||||
feature -- Mapping helper: uri template
|
||||
@@ -86,11 +136,4 @@ feature -- Mapping helper: uri template agent
|
||||
map_uri_template_with_request_methods (a_router, a_tpl, create {WSF_URI_TEMPLATE_AGENT_HANDLER}.make (proc), rqst_methods)
|
||||
end
|
||||
|
||||
|
||||
feature -- Hooks
|
||||
|
||||
register_hooks (a_response: CMS_RESPONSE)
|
||||
do
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -21,11 +21,11 @@
|
||||
</head>
|
||||
<body>
|
||||
<head>
|
||||
<title>{$page_title/}</title>
|
||||
<title>{$head_title/}</title>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Page Top -->
|
||||
{if isset="$top"}
|
||||
{if isset="$region_top"}
|
||||
{$region_top/}
|
||||
{/if}
|
||||
<!-- Body -->
|
||||
@@ -35,40 +35,47 @@
|
||||
<div id="header">
|
||||
{if isset="$page.primary_nav"}
|
||||
{$page.primary_nav/}
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<!-- General Page Content -->
|
||||
<div id='content' class='row-fluid'>
|
||||
|
||||
<!-- Left Sidebar sidebar_first -->
|
||||
{unless empty="$page.region_sidebar_first"}
|
||||
<div style="float: left;">
|
||||
{$page.region_sidebar_first/}
|
||||
</div>
|
||||
{/unless}
|
||||
|
||||
<!-- Left Side Bard sidebar_first -->
|
||||
{$region_sidebar_first/}
|
||||
|
||||
<!-- Highlighted, Help, Content -->
|
||||
<div class='span8 main'>
|
||||
<!-- Highlighted Section -->
|
||||
{$region_highlighted/}
|
||||
{$page.region_highlighted/}
|
||||
|
||||
|
||||
<!-- Help Section -->
|
||||
{$region_help/}
|
||||
|
||||
{$page.region_help/}
|
||||
|
||||
<!-- Main Content Section -->
|
||||
{$region_main/}
|
||||
{unless empty="$page_title"}<h1 class="page-title">{$page_title/}</h1>{/unless}
|
||||
{$page.region_content/}
|
||||
</div>
|
||||
|
||||
<!-- Right Side Bard sidebar_second-->
|
||||
{$region_sidebar_second/}
|
||||
<!-- Right Sidebar sidebar_second-->
|
||||
{unless empty="$page.region_sidebar_second"}
|
||||
<div style="float: right;">
|
||||
{$page.region_sidebar_second/}
|
||||
</div>
|
||||
{/unless}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--Page footer -->
|
||||
{$region_footer/}
|
||||
{$page.region_footer/}
|
||||
|
||||
<!-- Page Bottom -->
|
||||
{$region_bottom/}
|
||||
{$page.region_bottom/}
|
||||
</body>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="${site_url/}" itemprop="home" rel="home">{$site_name/}</a>
|
||||
<a class="navbar-brand" href="https://www2.eiffel.com/beta" itemprop="home" rel="home">Eiffel CMS</a>
|
||||
<a class="navbar-brand" href="{$site_url/}" itemprop="home" rel="home">{unless isset="$site_name"}Eiffel CMS{/unless}{if isset="$site_name"}{$site_name/}{/if}</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user