Merged formats, from CMS_NODE_API and CMS_API, into CMS_API.formats: CMS_FORMATS.

This commit is contained in:
2015-07-09 13:41:42 +02:00
parent 16cae0047d
commit 31095b1b66
4 changed files with 66 additions and 68 deletions

View File

@@ -38,26 +38,14 @@ feature {NONE} -- Initialization
-- Initialize content type system.
local
ct: CMS_PAGE_NODE_TYPE
f: CMS_FORMAT
do
-- Initialize built-in formats
create available_content_formats.make (4)
create f.make_from_format (create {PLAIN_TEXT_CONTENT_FORMAT})
add_content_format (f)
create f.make_from_format (create {FILTERED_HTML_CONTENT_FORMAT})
add_content_format (f)
create f.make_from_format (create {FULL_HTML_CONTENT_FORMAT})
add_content_format (f)
create f.make ("cms_editor", "CMS HTML content")
add_content_format (f)
-- Initialize content types.
create content_types.make (1)
create content_type_webform_managers.make (1)
create ct
--| For now, add all available formats to content type `ct'.
across
available_content_formats as ic
cms_api.formats as ic
loop
ct.extend_format (ic.item)
end
@@ -183,31 +171,6 @@ feature -- Content type webform
end
end
feature -- Content formats
available_content_formats: ARRAYED_LIST [CONTENT_FORMAT]
-- Available content formats.
add_content_format (f: CONTENT_FORMAT)
-- Add content format `f' to `available_content_formats'.
do
available_content_formats.extend (f)
end
content_format (a_name: READABLE_STRING_GENERAL): detachable CONTENT_FORMAT
-- Format named `a_name' if available.
do
across
available_content_formats as ic
until
Result = Void
loop
if a_name.is_case_insensitive_equal (ic.item.name) then
Result := ic.item
end
end
end
feature -- URL
new_content_path (ct: detachable CMS_CONTENT_TYPE): STRING