Added is_https: BOOLEAN query to CMS (on page, but also as 'is_https' value)

This commit is contained in:
2015-02-16 20:14:45 +01:00
parent 8d59d25ace
commit ca10c57b4b
3 changed files with 18 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
note
description: "Generic CMS Response.It builds the content to get process to render the output"
date: "$Date: 2015-02-13 13:08:13 +0100 (ven., 13 févr. 2015) $"
revision: "$Revision: 96616 $"
date: "$Date: 2015-02-16 20:14:19 +0100 (lun., 16 févr. 2015) $"
revision: "$Revision: 96643 $"
deferred class
CMS_RESPONSE
@@ -844,11 +844,13 @@ feature -- Generation
-- Variables
page.register_variable (request.absolute_script_url (""), "site_url")
page.register_variable (request.absolute_script_url (""), "host") -- Same as `site_url'.
page.register_variable (request.is_https, "is_https")
if attached current_user_name (request) as l_user then
page.register_variable (l_user, "user")
end
page.register_variable (title, "site_title")
page.set_is_front (is_front)
page.set_is_https (request.is_https)
-- Variables/Misc

View File

@@ -1,8 +1,8 @@
note
description: "Summary description for {CMS_HTML_PAGE}."
author: ""
date: "$Date: 2014-11-13 19:34:00 +0100 (jeu., 13 nov. 2014) $"
revision: "$Revision: 96086 $"
date: "$Date: 2015-02-16 20:14:19 +0100 (lun., 16 févr. 2015) $"
revision: "$Revision: 96643 $"
class
CMS_HTML_PAGE
@@ -40,6 +40,8 @@ feature -- Access
is_front: BOOLEAN
is_https: BOOLEAN
title: detachable READABLE_STRING_32
language: STRING
@@ -96,6 +98,12 @@ feature -- Element change
is_front := b
end
set_is_https (b: BOOLEAN)
-- Set `is_https' to `b'.
do
is_https := b
end
register_variable (a_value: detachable ANY; k: READABLE_STRING_GENERAL)
do
variables.force (a_value, k)

View File

@@ -1,8 +1,8 @@
note
description: "Summary description for {SMARTY_CMS_HTML_PAGE_INSPECTOR}."
author: ""
date: "$Date: 2014-11-13 16:23:47 +0100 (jeu., 13 nov. 2014) $"
revision: "$Revision: 96085 $"
date: "$Date: 2015-02-16 20:14:19 +0100 (lun., 16 févr. 2015) $"
revision: "$Revision: 96643 $"
class
SMARTY_CMS_HTML_PAGE_INSPECTOR
@@ -38,6 +38,8 @@ feature {TEMPLATE_ROUTINES}
end
elseif l_fn.is_case_insensitive_equal ("is_front") then
Result := cell_of (l_page.is_front)
elseif l_fn.is_case_insensitive_equal ("is_https") then
Result := cell_of (l_page.is_https)
elseif l_fn.starts_with_general ("region_") then
l_fn.remove_head (7) -- remove "region_"
Result := cell_of (l_page.region (l_fn))