Improved site_url and base_url interface and initialization.

Added CMS_CUSTOM_RESPONSE_MESSAGE interface to send easily simple response message.
Updated CMS_RESPONSE to use CMS_CUSTOM_RESPONSE_MESSAGE
This commit is contained in:
2015-05-22 22:37:18 +02:00
parent 036013a0a2
commit 77f52388c1
4 changed files with 109 additions and 15 deletions

View File

@@ -1,7 +1,7 @@
note
description: "Abstract class describing a generic theme"
date: "$Date: 2015-02-16 12:52:35 +0100 (lun., 16 févr. 2015) $"
revision: "$Revision: 96630 $"
date: "$Date: 2015-05-20 11:48:26 +0200 (mer., 20 mai 2015) $"
revision: "$Revision: 97327 $"
deferred class
CMS_THEME
@@ -18,10 +18,10 @@ feature {NONE} -- Access
setup: CMS_SETUP
site_url: READABLE_STRING_8 assign set_site_url
site_url: IMMUTABLE_STRING_8
-- Absolute URL for Current CMS site.
base_url: detachable READABLE_STRING_8
base_url: detachable IMMUTABLE_STRING_8
-- Optional base url of current CMS site.
feature -- Access
@@ -59,16 +59,17 @@ feature -- Element change
i,j: INTEGER
do
base_url := Void
if a_url[a_url.count] = '/' then
site_url := a_url
if a_url [a_url.count] = '/' then
create site_url.make_from_string (a_url)
else
site_url := a_url + "/"
create site_url.make_from_string (a_url + "/")
end
i := a_url.substring_index ("://", 1)
if i > 0 then
j := a_url.index_of ('/', i + 3)
if j > 0 then
base_url := a_url.substring (j, a_url.count)
create base_url.make_from_string (a_url.substring (j, a_url.count))
end
end
end