Renamed node_api and node_storage by blog_api and blog_storage in related CMS_BLOG_* classes. Mainly to avoid confusion with NODE_ classes.

Merged CMS_BLOG_CONFIG with CMS_BLOG_API.
In CMS_BLOG_API, prefer argument of type CMS_USER, rather than using directly user id.
Added a CMS_EDITOR_CONTENT_FORMAT for now, to be the format editable by the WYSIWYG editor.
Added CMS_MODULE.is_initialized: BOOLEAN to equip router, and module_api with expected preconditions.

Fixed typo, especially in log output.
Corrected a few routine names such as add_authors that should not be a function according to its name.
Converted various function returning html content, to procedure appending html content to an output string to minimize temporary string object creation.
Cosmetic: added spaces to make code easier to read, and indentation.
This commit is contained in:
2015-05-27 19:00:32 +02:00
parent e35893fdb9
commit c871eae10e
20 changed files with 376 additions and 303 deletions

View File

@@ -18,8 +18,10 @@ feature -- Forms ...
ta, sum: CMS_FORM_TEXTAREA
tselect: WSF_FORM_SELECT
opt: WSF_FORM_SELECT_OPTION
full_format: FULL_HTML_CONTENT_FORMAT
cms_format: CMS_EDITOR_CONTENT_FORMAT
do
create cms_format
create ti.make ("title")
ti.set_label ("Title")
ti.set_size (70)
@@ -31,18 +33,16 @@ feature -- Forms ...
f.extend_html_text ("<br/>")
-- Select field has to be initialized before textareas are replaced, because they depend on the selection of the field
-- Select field has to be initialized before textareas are replaced, because they depend on the selection of the field
create tselect.make ("format")
tselect.set_label ("Body's format")
tselect.set_is_required (True)
create full_format.default_create
-- Main Content
-- Main Content
create ta.make ("body")
ta.set_rows (10)
ta.set_cols (70)
ta.show_as_editor_if_selected (tselect, full_format.name)
ta.show_as_editor_if_selected (tselect, cms_format.name)
if a_node /= Void then
ta.set_text_value (a_node.content)
end
@@ -50,12 +50,12 @@ feature -- Forms ...
ta.set_description ("This is the main content")
ta.set_is_required (False)
-- Summary
-- Summary
create sum.make ("summary")
sum.set_rows (10)
sum.set_rows (3)
sum.set_cols (70)
-- if full_html is selected
sum.show_as_editor_if_selected (tselect, full_format.name)
-- if cms_html is selected
sum.show_as_editor_if_selected (tselect, cms_format.name)
if a_node /= Void then
sum.set_text_value (a_node.summary)
end
@@ -66,15 +66,14 @@ feature -- Forms ...
create fset.make
fset.set_legend ("Body")
-- Add summary
-- Add summary
fset.extend (sum)
fset.extend_html_text("<br />")
-- Add content (body)
-- Add content (body)
fset.extend (ta)
fset.extend_html_text ("<br/>")
across
content_type.available_formats as c
loop
@@ -92,7 +91,7 @@ feature -- Forms ...
f.extend (fset)
-- Path aliase
-- Path alias
create ti.make ("path_alias")
ti.set_label ("Path")
ti.set_size (70)