Merge branch 'v0' of https://www.github.com/EiffelWebFramework/ROC
This commit is contained in:
@@ -15,7 +15,7 @@ inherit
|
||||
|
||||
REFACTORING_HELPER
|
||||
|
||||
CMS_ENCODERS
|
||||
CMS_REQUEST_UTIL
|
||||
|
||||
create
|
||||
make
|
||||
@@ -292,6 +292,26 @@ feature -- Logging
|
||||
end
|
||||
end
|
||||
|
||||
feature -- Internationalization (i18n)
|
||||
|
||||
translation (a_text: READABLE_STRING_GENERAL; opts: detachable CMS_API_OPTIONS): STRING_32
|
||||
-- Translated text `a_text' according to expected context (lang, ...)
|
||||
-- and adapt according to options eventually set by `opts'.
|
||||
do
|
||||
to_implement ("Implement i18n support [2015-may]")
|
||||
Result := a_text.as_string_32
|
||||
end
|
||||
|
||||
formatted_string (a_text: READABLE_STRING_GENERAL; args: TUPLE): STRING_32
|
||||
-- Format `a_text' using arguments `args'.
|
||||
--| ex: formatted_string ("hello $1, see page $title.", ["bob", "contact"] -> "hello bob, see page contact"
|
||||
local
|
||||
l_formatter: CMS_STRING_FORMATTER
|
||||
do
|
||||
create l_formatter
|
||||
Result := l_formatter.formatted_string (a_text, args)
|
||||
end
|
||||
|
||||
feature -- Emails
|
||||
|
||||
new_email (a_to_address: READABLE_STRING_8; a_subject: READABLE_STRING_8; a_content: READABLE_STRING_8): CMS_EMAIL
|
||||
@@ -407,7 +427,7 @@ feature {NONE} -- Hooks
|
||||
l_hooks: like hooks
|
||||
do
|
||||
l_hooks := hooks
|
||||
register_hooks (l_hooks)
|
||||
setup_core_hooks (l_hooks)
|
||||
across
|
||||
enabled_modules as ic
|
||||
loop
|
||||
@@ -436,7 +456,7 @@ feature -- Query: API
|
||||
|
||||
feature -- Hooks
|
||||
|
||||
register_hooks (a_hooks: CMS_HOOK_CORE_MANAGER)
|
||||
setup_core_hooks (a_hooks: CMS_HOOK_CORE_MANAGER)
|
||||
-- Register hooks associated with the cms core.
|
||||
do
|
||||
a_hooks.subscribe_to_export_hook (Current)
|
||||
|
||||
@@ -13,6 +13,11 @@ inherit
|
||||
|
||||
feature -- Access
|
||||
|
||||
identifier: detachable READABLE_STRING_32
|
||||
-- Optional identifier.
|
||||
deferred
|
||||
end
|
||||
|
||||
title: detachable READABLE_STRING_32
|
||||
-- Title associated with Current content.
|
||||
deferred
|
||||
@@ -37,6 +42,14 @@ feature -- Access
|
||||
|
||||
feature -- Status report
|
||||
|
||||
has_identifier: BOOLEAN
|
||||
-- Current content has identifier?
|
||||
do
|
||||
Result := identifier /= Void
|
||||
ensure
|
||||
Result implies identifier /= Void
|
||||
end
|
||||
|
||||
is_typed_as (a_content_type: READABLE_STRING_GENERAL): BOOLEAN
|
||||
-- Is current node of type `a_content_type' ?
|
||||
do
|
||||
|
||||
@@ -26,6 +26,9 @@ feature {NONE} -- Initialization
|
||||
|
||||
feature -- Access
|
||||
|
||||
identifier: detachable READABLE_STRING_32
|
||||
-- <Precursor>
|
||||
|
||||
title: detachable READABLE_STRING_32
|
||||
-- Title associated with Current content.
|
||||
|
||||
@@ -42,6 +45,15 @@ feature -- Access
|
||||
|
||||
feature -- Element change
|
||||
|
||||
set_identifier (a_identifier: detachable READABLE_STRING_GENERAL)
|
||||
do
|
||||
if a_identifier = Void then
|
||||
identifier := Void
|
||||
else
|
||||
create {IMMUTABLE_STRING_32} identifier.make_from_string_general (a_identifier)
|
||||
end
|
||||
end
|
||||
|
||||
set_title (a_title: detachable READABLE_STRING_GENERAL)
|
||||
do
|
||||
if a_title = Void then
|
||||
|
||||
@@ -72,7 +72,6 @@ feature {NONE} -- Initialization
|
||||
l_module: CMS_MODULE
|
||||
l_enabled_modules: CMS_MODULE_COLLECTION
|
||||
do
|
||||
api.register_hooks (hooks)
|
||||
l_enabled_modules := api.enabled_modules
|
||||
across
|
||||
l_enabled_modules as ic
|
||||
@@ -114,26 +113,6 @@ feature -- Access
|
||||
end
|
||||
end
|
||||
|
||||
feature -- Internationalization (i18n)
|
||||
|
||||
translation (a_text: READABLE_STRING_GENERAL; opts: detachable CMS_API_OPTIONS): STRING_32
|
||||
-- Translated text `a_text' according to expected context (lang, ...)
|
||||
-- and adapt according to options eventually set by `opts'.
|
||||
do
|
||||
to_implement ("Implement i18n support [2015-may]")
|
||||
Result := a_text.as_string_32
|
||||
end
|
||||
|
||||
formatted_string (a_text: READABLE_STRING_GENERAL; args: TUPLE): STRING_32
|
||||
-- Format `a_text' using arguments `args'.
|
||||
--| ex: formatted_string ("hello $1, see page $title.", ["bob", "contact"] -> "hello bob, see page contact"
|
||||
local
|
||||
l_formatter: CMS_STRING_FORMATTER
|
||||
do
|
||||
create l_formatter
|
||||
Result := l_formatter.formatted_string (a_text, args)
|
||||
end
|
||||
|
||||
feature -- API
|
||||
|
||||
api: CMS_API
|
||||
@@ -897,6 +876,22 @@ feature -- Menu: change
|
||||
m.extend (lnk)
|
||||
end
|
||||
|
||||
feature -- Internationalization (i18n)
|
||||
|
||||
translation (a_text: READABLE_STRING_GENERAL; opts: detachable CMS_API_OPTIONS): STRING_32
|
||||
-- Translated text `a_text' according to expected context (lang, ...)
|
||||
-- and adapt according to options eventually set by `opts'.
|
||||
do
|
||||
Result := api.translation (a_text, opts)
|
||||
end
|
||||
|
||||
formatted_string (a_text: READABLE_STRING_GENERAL; args: TUPLE): STRING_32
|
||||
-- Format `a_text' using arguments `args'.
|
||||
--| ex: formatted_string ("hello $1, see page $title.", ["bob", "contact"] -> "hello bob, see page contact"
|
||||
do
|
||||
Result := api.formatted_string (a_text, args)
|
||||
end
|
||||
|
||||
feature -- Message
|
||||
|
||||
add_message (a_msg: READABLE_STRING_8; a_category: detachable READABLE_STRING_8)
|
||||
@@ -984,6 +979,26 @@ feature -- Theme
|
||||
end
|
||||
end
|
||||
|
||||
feature -- Theme helpers
|
||||
|
||||
wsf_theme: WSF_THEME
|
||||
-- WSF Theme from CMS `theme' for Current response.
|
||||
local
|
||||
t: like internal_wsf_theme
|
||||
do
|
||||
t := internal_wsf_theme
|
||||
if t = Void then
|
||||
create {CMS_TO_WSF_THEME} t.make (Current, theme)
|
||||
internal_wsf_theme := t
|
||||
end
|
||||
Result := t
|
||||
end
|
||||
|
||||
feature {NONE} -- Theme helpers
|
||||
|
||||
internal_wsf_theme: detachable WSF_THEME
|
||||
-- Once per object for `wsf_theme'.
|
||||
|
||||
feature -- Element Change
|
||||
|
||||
set_status_code (a_status: INTEGER)
|
||||
|
||||
Reference in New Issue
Block a user