Moved all location related queries into CMS_API, instead of CMS_SETUP.
Note that CMS_SETUP provides locations set by default or from configuration file. Now theme related resources can be found under site/modules/$mod_name/... or site/themes/$theme/modules/... so only theme related resources can be overriden for now.
This commit is contained in:
@@ -61,11 +61,18 @@ feature {NONE} -- Initialization
|
||||
-- Can be also used to precise the "From:" value for email.
|
||||
site_email := text_item_or_default ("site.email", "webmaster")
|
||||
|
||||
-- Location for theme folders.
|
||||
-- Location for modules folders.
|
||||
if attached text_item ("modules-dir") as s then
|
||||
create modules_location.make_from_string (s)
|
||||
else
|
||||
modules_location := environment.modules_path
|
||||
end
|
||||
|
||||
-- Location for themes folders.
|
||||
if attached text_item ("themes-dir") as s then
|
||||
create themes_location.make_from_string (s)
|
||||
else
|
||||
themes_location := environment.www_path.extended ("themes")
|
||||
themes_location := environment.themes_path
|
||||
end
|
||||
|
||||
-- Selected theme's name
|
||||
@@ -76,7 +83,6 @@ feature {NONE} -- Initialization
|
||||
end
|
||||
|
||||
compute_theme_location
|
||||
compute_theme_assets_location
|
||||
end
|
||||
|
||||
initialize_storages
|
||||
@@ -163,15 +169,4 @@ feature -- Theme: Compute location
|
||||
theme_location := themes_location.extended (theme_name)
|
||||
end
|
||||
|
||||
compute_theme_assets_location
|
||||
-- assets (js, css, images, etc)
|
||||
-- Not used at the moment.
|
||||
do
|
||||
debug ("refactor_fixme")
|
||||
fixme ("Check if we really need it")
|
||||
end
|
||||
-- Check how to get this path from the CMS_THEME information.
|
||||
theme_assets_location := theme_location.extended ("assets")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -23,15 +23,35 @@ create
|
||||
|
||||
feature -- Access
|
||||
|
||||
theme_path: PATH
|
||||
site_path: PATH
|
||||
-- Directory containing the site.
|
||||
--| For now, an alias for `path'.
|
||||
do
|
||||
Result := path
|
||||
end
|
||||
|
||||
modules_path: PATH
|
||||
-- Directory for templates (HTML, etc).
|
||||
local
|
||||
p: detachable PATH
|
||||
do
|
||||
p := internal_theme_path
|
||||
p := internal_modules_path
|
||||
if p = Void then
|
||||
p := www_path.extended ("theme")
|
||||
internal_theme_path := p
|
||||
p := site_path.extended ("modules")
|
||||
internal_modules_path := p
|
||||
end
|
||||
Result := p
|
||||
end
|
||||
|
||||
themes_path: PATH
|
||||
-- Directory for cms themes.
|
||||
local
|
||||
p: detachable PATH
|
||||
do
|
||||
p := internal_themes_path
|
||||
if p = Void then
|
||||
p := site_path.extended ("themes")
|
||||
internal_themes_path := p
|
||||
end
|
||||
Result := p
|
||||
end
|
||||
@@ -58,7 +78,9 @@ feature -- Access
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
internal_theme_path: detachable like theme_path
|
||||
internal_modules_path: detachable like modules_path
|
||||
|
||||
internal_themes_path: detachable like themes_path
|
||||
|
||||
internal_cms_config_ini_path: detachable like cms_config_ini_path
|
||||
|
||||
|
||||
@@ -90,7 +90,10 @@ feature -- Query
|
||||
deferred
|
||||
end
|
||||
|
||||
feature -- Access: Theme
|
||||
feature -- Access: Theme
|
||||
|
||||
modules_location: PATH
|
||||
-- Path to modules.
|
||||
|
||||
themes_location: PATH
|
||||
-- Path to themes.
|
||||
@@ -98,9 +101,6 @@ feature -- Access: Theme
|
||||
theme_location: PATH
|
||||
-- Path to a active theme.
|
||||
|
||||
theme_assets_location: PATH
|
||||
-- Path to a active theme assets folder.
|
||||
|
||||
theme_information_location: PATH
|
||||
-- Active theme informations.
|
||||
do
|
||||
|
||||
Reference in New Issue
Block a user