Layout: got rid of onces per thread function.
Renamed `launch_cms' as `initialize_cms' which reflects better the implementation. Minor cosmetic or warning changes.
This commit is contained in:
@@ -16,8 +16,6 @@ feature {NONE} -- Initialization
|
||||
|
||||
make (a_layout: CMS_LAYOUT)
|
||||
-- Initialize `Current'.
|
||||
local
|
||||
p: PATH
|
||||
do
|
||||
layout := a_layout
|
||||
create options.make_equal (10)
|
||||
@@ -169,8 +167,6 @@ feature -- Change
|
||||
end
|
||||
|
||||
get_root_location
|
||||
local
|
||||
utf: UTF_CONVERTER
|
||||
do
|
||||
root_location := layout.www_path
|
||||
end
|
||||
|
||||
@@ -93,7 +93,6 @@ feature {NONE} -- Initialization
|
||||
|
||||
build_api_service
|
||||
local
|
||||
dn: PATH
|
||||
l_database: DATABASE_CONNECTION
|
||||
do
|
||||
to_implement ("Refactor database setup")
|
||||
|
||||
@@ -19,14 +19,34 @@ feature -- Access
|
||||
|
||||
theme_path: PATH
|
||||
-- Directory for templates (HTML, etc).
|
||||
once
|
||||
Result := www_path.extended ("theme")
|
||||
local
|
||||
p: detachable PATH
|
||||
do
|
||||
p := internal_theme_path
|
||||
if p = Void then
|
||||
p := www_path.extended ("theme")
|
||||
internal_theme_path := p
|
||||
end
|
||||
Result := p
|
||||
end
|
||||
|
||||
cms_config_ini_path: PATH
|
||||
-- Database Configuration file path.
|
||||
once
|
||||
Result := config_path.extended ("cms.ini")
|
||||
local
|
||||
p: detachable PATH
|
||||
do
|
||||
p := internal_cms_config_ini_path
|
||||
if p = Void then
|
||||
p := config_path.extended ("cms.ini")
|
||||
internal_cms_config_ini_path := p
|
||||
end
|
||||
Result := p
|
||||
end
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
internal_theme_path: detachable like theme_path
|
||||
|
||||
internal_cms_config_ini_path: detachable like cms_config_ini_path
|
||||
|
||||
end
|
||||
|
||||
@@ -27,7 +27,7 @@ feature -- Router
|
||||
|
||||
feature -- Filter
|
||||
|
||||
filters: detachable LIST[WSF_FILTER]
|
||||
filters: detachable LIST [WSF_FILTER]
|
||||
-- Possibly list of Filter's module.
|
||||
|
||||
feature -- Element Change: Filter
|
||||
@@ -39,7 +39,7 @@ feature -- Element Change: Filter
|
||||
do
|
||||
l_filters := filters
|
||||
if l_filters = Void then
|
||||
create {ARRAYED_LIST[WSF_FILTER]}l_filters.make (1)
|
||||
create {ARRAYED_LIST [WSF_FILTER]} l_filters.make (1)
|
||||
filters := l_filters
|
||||
end
|
||||
l_filters.force (a_filter)
|
||||
|
||||
@@ -136,7 +136,6 @@ feature -- Filters
|
||||
-- Create `filter'.
|
||||
local
|
||||
f, l_filter: detachable WSF_FILTER
|
||||
fh: WSF_CUSTOM_HEADER_FILTER
|
||||
do
|
||||
l_filter := Void
|
||||
-- Maintenance
|
||||
|
||||
@@ -45,19 +45,25 @@ feature -- Access
|
||||
local
|
||||
i: INTEGER
|
||||
utf: UTF_CONVERTER
|
||||
once
|
||||
if attached information.regions as tb and then not tb.is_empty then
|
||||
i := 1
|
||||
create Result.make_filled ("", i, i + tb.count - 1)
|
||||
across
|
||||
tb as ic
|
||||
loop
|
||||
Result.force (utf.utf_32_string_to_utf_8_string_8 (ic.key), i) -- NOTE: UTF-8 encoded !
|
||||
i := i + 1
|
||||
l_regions: like internal_regions
|
||||
do
|
||||
l_regions := internal_regions
|
||||
if l_regions = Void then
|
||||
if attached information.regions as tb and then not tb.is_empty then
|
||||
i := 1
|
||||
create l_regions.make_filled ("", i, i + tb.count - 1)
|
||||
across
|
||||
tb as ic
|
||||
loop
|
||||
l_regions.force (utf.utf_32_string_to_utf_8_string_8 (ic.key), i) -- NOTE: UTF-8 encoded !
|
||||
i := i + 1
|
||||
end
|
||||
else
|
||||
l_regions := <<"header", "content", "footer", "first_sidebar", "second_sidebar">>
|
||||
end
|
||||
else
|
||||
Result := <<"header", "content", "footer", "first_sidebar", "second_sidebar">>
|
||||
internaL_regions := l_regions
|
||||
end
|
||||
Result := l_regions
|
||||
end
|
||||
|
||||
page_template: SMARTY_CMS_PAGE_TEMPLATE
|
||||
@@ -87,6 +93,8 @@ feature -- Conversion
|
||||
|
||||
feature {NONE} -- Internal
|
||||
|
||||
internal_regions: detachable like regions
|
||||
|
||||
internal_page_template: detachable like page_template
|
||||
|
||||
invariant
|
||||
|
||||
Reference in New Issue
Block a user