Adapted to new layout, with module files inside site/modules/$module_name/...
This commit is contained in:
@@ -21,7 +21,7 @@ feature {NONE} -- Initialization
|
||||
s: detachable READABLE_STRING_32
|
||||
l_contact_email, l_subject_register, l_subject_activate, l_subject_password, l_subject_oauth: detachable READABLE_STRING_8
|
||||
do
|
||||
setup := a_cms_api.setup
|
||||
cms_api := a_cms_api
|
||||
-- Use global smtp setting if any, otherwise "localhost"
|
||||
smtp_server := utf.escaped_utf_32_string_to_utf_8_string_8 (a_cms_api.setup.text_item_or_default ("smtp", "localhost"))
|
||||
l_site_name := utf.escaped_utf_32_string_to_utf_8_string_8 (a_cms_api.setup.site_name)
|
||||
@@ -92,6 +92,8 @@ feature {NONE} -- Initialization
|
||||
|
||||
feature -- Access
|
||||
|
||||
cms_api: CMS_API
|
||||
|
||||
smtp_server: IMMUTABLE_STRING_8
|
||||
|
||||
admin_email: IMMUTABLE_STRING_8
|
||||
@@ -132,8 +134,11 @@ feature {NONE} -- Implementation: Template
|
||||
|
||||
template_path (a_name: READABLE_STRING_GENERAL): PATH
|
||||
-- Location of template named `a_name'.
|
||||
local
|
||||
p: PATH
|
||||
do
|
||||
Result := setup.environment.config_path.extended ("modules").extended ("login").extended (a_name)
|
||||
create p.make_from_string (a_name)
|
||||
Result := cms_api.module_location_by_name ("login").extended ("mail_templates").extended (a_name)
|
||||
end
|
||||
|
||||
template_string (a_name: READABLE_STRING_GENERAL; a_default: STRING): STRING
|
||||
@@ -151,8 +156,6 @@ feature {NONE} -- Implementation: Template
|
||||
|
||||
feature {NONE} -- Implementation
|
||||
|
||||
setup: CMS_SETUP
|
||||
|
||||
read_template_file (a_path: PATH): detachable STRING
|
||||
-- Read the content of the file at path `a_path'.
|
||||
local
|
||||
|
||||
@@ -102,13 +102,13 @@ feature {CMS_API} -- Module management
|
||||
if attached {CMS_STORAGE_SQL_I} api.storage as l_sql_storage then
|
||||
if not l_sql_storage.sql_table_exists ("oauth2_consumers") then
|
||||
--| Schema
|
||||
l_sql_storage.sql_execute_file_script (l_setup.environment.path.extended ("scripts").extended ("oauth2_consumers.sql"))
|
||||
l_sql_storage.sql_execute_file_script (api.modules_location.extended ("scripts").extended ("oauth2_consumers.sql"))
|
||||
|
||||
if l_sql_storage.has_error then
|
||||
api.logger.put_error ("Could not initialize database for blog module", generating_type)
|
||||
end
|
||||
-- TODO workaround.
|
||||
l_sql_storage.sql_execute_file_script (l_setup.environment.path.extended ("scripts").extended ("oauth2_consumers_initialize.sql"))
|
||||
l_sql_storage.sql_execute_file_script (api.modules_location.extended ("scripts").extended ("oauth2_consumers_initialize.sql"))
|
||||
end
|
||||
|
||||
-- TODO workaround, until we have an admin module
|
||||
@@ -131,7 +131,7 @@ feature {CMS_API} -- Module management
|
||||
if not l_sql_storage.sql_table_exists (ic.item) then
|
||||
create l_params.make (1)
|
||||
l_params.force (ic.item, "table_name")
|
||||
l_sql_storage.sql_execute_file_script_with_params (l_setup.environment.path.extended ("scripts").extended ("oauth2_template.sql"), l_params)
|
||||
l_sql_storage.sql_execute_file_script_with_params (api.modules_location.extended ("scripts").extended ("oauth2_template.sql"), l_params)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user