')
if attached label as lab then
- Result.append ("")
+ a_html.append ("")
if is_required then
- Result.append (" (required)")
+ a_html.append (" (required)")
end
- Result.append (" %N")
+ a_html.append (" %N")
end
- Result.append (item_to_html (a_theme))
+ append_item_to_html (a_theme, a_html)
if attached description as desc then
if is_description_collapsible then
- Result.append ("
")
end
end
diff --git a/draft/application/cms/src/kernel/form/cms_form_input.e b/draft/application/cms/src/kernel/form/cms_form_input.e
index f1dfca1c..ae74f5c1 100644
--- a/draft/application/cms/src/kernel/form/cms_form_input.e
+++ b/draft/application/cms/src/kernel/form/cms_form_input.e
@@ -78,45 +78,50 @@ feature -- Element change
feature -- Conversion
- item_to_html (a_theme: CMS_THEME): STRING_8
+ append_item_to_html (a_theme: CMS_THEME; a_html: STRING_8)
+ local
+ old_count: INTEGER
do
- Result := " 0 then
- Result.append (" size=%"" + size.out + "%"")
+ a_html.append (" size=%"" + size.out + "%"")
end
if maxlength > 0 then
- Result.append (" maxlength=%"" + maxlength.out + "%"")
+ a_html.append (" maxlength=%"" + maxlength.out + "%"")
end
if attached specific_input_attributes_string as s then
- Result.append_character (' ')
- Result.append (s)
+ a_html.append_character (' ')
+ a_html.append (s)
end
- if attached child_to_html (a_theme) as s then
- Result.append (">")
- Result.append (s)
- Result.append ("")
+ a_html.append (">")
+ old_count := a_html.count
+ append_child_to_html (a_theme, a_html)
+ if a_html.count > old_count then
+ a_html.append ("")
else
- Result.append ("/>")
+ check a_html.item (a_html.count) = '>' end
+ a_html.put ('/', a_html.count) -- replace previous '>'
+ a_html.append (">")
end
end
feature {NONE} -- Implementation
- child_to_html (a_theme: CMS_THEME): detachable READABLE_STRING_8
+ append_child_to_html (a_theme: CMS_THEME; a_html: STRING_8)
-- Specific child element if any.
--| To redefine if needed
do
diff --git a/draft/application/cms/src/kernel/form/cms_form_item.e b/draft/application/cms/src/kernel/form/cms_form_item.e
index 2718568d..7b7f908f 100644
--- a/draft/application/cms/src/kernel/form/cms_form_item.e
+++ b/draft/application/cms/src/kernel/form/cms_form_item.e
@@ -14,8 +14,14 @@ inherit
feature -- Conversion
- to_html (a_theme: CMS_THEME): STRING_8
+ append_to_html (a_theme: CMS_THEME; a_html: STRING_8)
deferred
end
+ to_html (a_theme: CMS_THEME): STRING_8
+ do
+ create Result.make_empty
+ append_to_html (a_theme, Result)
+ end
+
end
diff --git a/draft/application/cms/src/kernel/form/cms_form_raw_text.e b/draft/application/cms/src/kernel/form/cms_form_raw_text.e
index bd5df16f..915dace7 100644
--- a/draft/application/cms/src/kernel/form/cms_form_raw_text.e
+++ b/draft/application/cms/src/kernel/form/cms_form_raw_text.e
@@ -10,7 +10,7 @@ class
inherit
CMS_FORM_ITEM
redefine
- to_html
+ append_to_html
end
create
@@ -36,14 +36,14 @@ feature -- Element change
feature -- Conversion
- to_html (a_theme: CMS_THEME): STRING_8
+ append_to_html (a_theme: CMS_THEME; a_html: STRING_8)
do
- Result := item_to_html (a_theme)
+ append_item_html_to (a_theme, a_html)
end
- item_to_html (a_theme: CMS_THEME): STRING_8
+ append_item_html_to (a_theme: CMS_THEME; a_html: STRING_8)
do
- Result := text
+ a_html.append (text)
end
end
diff --git a/draft/application/cms/src/kernel/form/cms_form_select.e b/draft/application/cms/src/kernel/form/cms_form_select.e
index b793df82..acdd6db6 100644
--- a/draft/application/cms/src/kernel/form/cms_form_select.e
+++ b/draft/application/cms/src/kernel/form/cms_form_select.e
@@ -103,38 +103,38 @@ feature -- Element change
feature -- Conversion
- item_to_html (a_theme: CMS_THEME): STRING_8
+ append_item_to_html (a_theme: CMS_THEME; a_html: STRING_8)
local
l_is_already_selected: BOOLEAN
h: detachable STRING_8
do
- Result := "")
+ a_html.append (" readonly=%"readonly%" />")
else
- Result.append ("/>")
+ a_html.append ("/>")
end
across
options as o
loop
- Result.append ("%N")
+ a_html.append (">" + o.item.text + "%N")
if attached o.item.description as d then
if h = Void then
create h.make_empty
@@ -142,9 +142,9 @@ feature -- Conversion
h.append ("
"+ o.item.text +":"+ d + "
")
end
end
- Result.append ("%N")
+ a_html.append ("%N")
if h /= Void then
- Result.append ("
" + h + "
%N")
+ a_html.append ("
" + h + "
%N")
end
end
diff --git a/draft/application/cms/src/kernel/form/cms_form_textarea.e b/draft/application/cms/src/kernel/form/cms_form_textarea.e
index dd6f37fe..b71bb5ba 100644
--- a/draft/application/cms/src/kernel/form/cms_form_textarea.e
+++ b/draft/application/cms/src/kernel/form/cms_form_textarea.e
@@ -61,30 +61,29 @@ feature -- Element change
feature -- Conversion
- item_to_html (a_theme: CMS_THEME): STRING_8
+ append_item_to_html (a_theme: CMS_THEME; a_html: STRING_8)
do
- Result := "")
+ a_html.append ("")
end
end
diff --git a/draft/application/cms/src/modules/node/node_add_cms_execution.e b/draft/application/cms/src/modules/node/node_add_cms_execution.e
index 0176576b..bfe43dba 100644
--- a/draft/application/cms/src/modules/node/node_add_cms_execution.e
+++ b/draft/application/cms/src/modules/node/node_add_cms_execution.e
@@ -82,7 +82,7 @@ feature -- Execution
end
fd.apply_to_associated_form
end
- b.append (f.to_html (theme))
+ f.append_to_html (theme, b)
end
else
set_title ("Access denied")
diff --git a/draft/application/cms/src/modules/node/node_edit_cms_execution.e b/draft/application/cms/src/modules/node/node_edit_cms_execution.e
index 778c12d1..3153c177 100644
--- a/draft/application/cms/src/modules/node/node_edit_cms_execution.e
+++ b/draft/application/cms/src/modules/node/node_edit_cms_execution.e
@@ -87,7 +87,7 @@ feature -- Execution
end
fd.apply_to_associated_form
end
- b.append (f.to_html (theme))
+ f.append_to_html (theme, b)
end
else
b.append ("
Access denied
")
diff --git a/draft/application/cms/src/modules/user/user_cms_execution.e b/draft/application/cms/src/modules/user/user_cms_execution.e
index 6061694d..6f063958 100644
--- a/draft/application/cms/src/modules/user/user_cms_execution.e
+++ b/draft/application/cms/src/modules/user/user_cms_execution.e
@@ -112,7 +112,7 @@ feature -- Execution
end
fd.apply_to_associated_form
end
- b.append (f.to_html (theme))
+ f.append_to_html (theme, b)
set_main_content (b)
end
end
diff --git a/draft/application/cms/src/modules/user/user_edit_cms_execution.e b/draft/application/cms/src/modules/user/user_edit_cms_execution.e
index b0af2ec5..d4930d69 100644
--- a/draft/application/cms/src/modules/user/user_edit_cms_execution.e
+++ b/draft/application/cms/src/modules/user/user_edit_cms_execution.e
@@ -105,7 +105,7 @@ feature -- Execution
end
fd.apply_to_associated_form
end
- b.append (f.to_html (theme))
+ f.append_to_html (theme, b)
end
end
set_main_content (b)
diff --git a/draft/application/cms/src/modules/user/user_new_password_cms_execution.e b/draft/application/cms/src/modules/user/user_new_password_cms_execution.e
index 550f0676..00b1af92 100644
--- a/draft/application/cms/src/modules/user/user_new_password_cms_execution.e
+++ b/draft/application/cms/src/modules/user/user_new_password_cms_execution.e
@@ -34,7 +34,7 @@ feature -- Execution
if attached u.email as l_email then
f := new_password_form (url (request.path_info, Void), "new-password")
b.append ("Password reset instructions will be mailed to " + l_email + ". You must " + link ("log out", "/user/logout", Void) + " to use the password reset link in the e-mail.")
- b.append (f.to_html (theme))
+ f.append_to_html (theme, b)
else
b.append ("Your account does not have any email address set!")
set_redirection (url ("/user/"+ u.id.out +"/edit", Void))
@@ -84,7 +84,7 @@ feature -- Execution
end
fd.apply_to_associated_form
end
- b.append (f.to_html (theme))
+ f.append_to_html (theme, b)
end
end
set_main_content (b)
diff --git a/draft/application/cms/src/modules/user/user_register_cms_execution.e b/draft/application/cms/src/modules/user/user_register_cms_execution.e
index 95395022..b1b4d819 100644
--- a/draft/application/cms/src/modules/user/user_register_cms_execution.e
+++ b/draft/application/cms/src/modules/user/user_register_cms_execution.e
@@ -103,7 +103,7 @@ feature -- Execution
end
fd.apply_to_associated_form
end
- b.append (f.to_html (theme))
+ f.append_to_html (theme, b)
end
end
set_main_content (b)