+ {unless isset="$user"}
+
+
+
+ {/unless}
+ {if isset=$error}
+
+ {/if}
+
diff --git a/examples/demo/site/modules/taxonomy/files/css/taxonomy.css b/examples/demo/site/modules/taxonomy/files/css/taxonomy.css
index 41c87fa..dd216d0 100644
--- a/examples/demo/site/modules/taxonomy/files/css/taxonomy.css
+++ b/examples/demo/site/modules/taxonomy/files/css/taxonomy.css
@@ -19,3 +19,8 @@ ul.taxonomy li:hover {
border-bottom: solid 1px #66f;
background-color: #ddf;
}
+
+table.taxonomy td {
+ border: solid 1px #ccc;
+ padding: 2px;
+}
diff --git a/examples/demo/site/modules/taxonomy/files/scss/taxonomy.scss b/examples/demo/site/modules/taxonomy/files/scss/taxonomy.scss
index f409395..2ceff02 100644
--- a/examples/demo/site/modules/taxonomy/files/scss/taxonomy.scss
+++ b/examples/demo/site/modules/taxonomy/files/scss/taxonomy.scss
@@ -19,3 +19,9 @@ ul.taxonomy {
}
}
}
+table.taxonomy {
+ td {
+ border: solid 1px #ccc;
+ padding: 2px;
+ }
+}
diff --git a/examples/demo/site/themes/bootstrap/assets/css/style.css b/examples/demo/site/themes/bootstrap/assets/css/style.css
index b16026b..5accf73 100644
--- a/examples/demo/site/themes/bootstrap/assets/css/style.css
+++ b/examples/demo/site/themes/bootstrap/assets/css/style.css
@@ -91,13 +91,10 @@ ul.horizontal li {
padding: 5px 2px 5px 2px;
}
-ul.taxonomy-entities {
- list-style-type: none;
- padding: 0;
+table.with_border thead td {
+ font-weight: bold;
}
-ul.taxonomy-entities li {
- padding: 0;
- margin-top: 5px;
- margin-bottom: 10px;
- border-top: dotted 1px #ccc;
+table.with_border td {
+ border: solid 1px #ccc;
+ padding: 2px 5px 2px 5px;
}
diff --git a/examples/demo/site/themes/bootstrap/assets/scss/style.scss b/examples/demo/site/themes/bootstrap/assets/scss/style.scss
index 1192673..90d2bb9 100644
--- a/examples/demo/site/themes/bootstrap/assets/scss/style.scss
+++ b/examples/demo/site/themes/bootstrap/assets/scss/style.scss
@@ -96,13 +96,12 @@ ul.horizontal {
padding: 5px 2px 5px 2px;
}
-ul.taxonomy-entities {
- list-style-type: none;
- padding: 0;
- li {
- padding: 0;
- margin-top: 5px;
- margin-bottom: 10px;
- border-top: dotted 1px #ccc;
+table.with_border {
+ thead td {
+ font-weight: bold;
+ }
+ td {
+ border: solid 1px #ccc;
+ padding: 2px 5px 2px 5px;
}
}
diff --git a/examples/demo/src/demo_cms_execution.e b/examples/demo/src/demo_cms_execution.e
index a3286d9..c73948f 100644
--- a/examples/demo/src/demo_cms_execution.e
+++ b/examples/demo/src/demo_cms_execution.e
@@ -89,6 +89,9 @@ feature -- CMS modules
create {GOOGLE_CUSTOM_SEARCH_MODULE} m.make
a_setup.register_module (m)
+
+ create {CMS_SESSION_AUTH_MODULE} m.make
+ a_setup.register_module (m)
end
end
diff --git a/library/persistence/implementation/store/cms_storage_store_sql.e b/library/persistence/implementation/store/cms_storage_store_sql.e
index 0684964..aec4408 100644
--- a/library/persistence/implementation/store/cms_storage_store_sql.e
+++ b/library/persistence/implementation/store/cms_storage_store_sql.e
@@ -152,6 +152,7 @@ feature -- Query
-- Retrieved value at `a_index' position in `item'.
local
l_item: like sql_item
+ i64: INTEGER_64
do
l_item := sql_item (a_index)
if attached {INTEGER_32} l_item as i then
@@ -159,7 +160,18 @@ feature -- Query
elseif attached {INTEGER_32_REF} l_item as l_value then
Result := l_value.item
else
- check is_integer_32: False end
+ if attached {INTEGER_64} l_item as i then
+ i64 := i
+ elseif attached {INTEGER_64_REF} l_item as l_value then
+ i64 := l_value.item
+ else
+ check is_integer_32: False end
+ end
+ if i64 <= {INTEGER_32}.max_value then
+ Result := i64.to_integer_32
+ else
+ check is_integer_32: False end
+ end
end
end
diff --git a/modules/admin/handler/cms_admin_cache_handler.e b/modules/admin/handler/cms_admin_cache_handler.e
index 13dd922..5f53515 100644
--- a/modules/admin/handler/cms_admin_cache_handler.e
+++ b/modules/admin/handler/cms_admin_cache_handler.e
@@ -44,7 +44,7 @@ feature -- Execution
create {GENERIC_VIEW_CMS_RESPONSE} l_response.make (req, res, api)
f := clear_cache_web_form (l_response)
create s.make_empty
- f.append_to_html (create {CMS_TO_WSF_THEME}.make (l_response, l_response.theme), s)
+ f.append_to_html (l_response.wsf_theme, s)
l_response.set_main_content (s)
l_response.execute
end
@@ -70,7 +70,7 @@ feature -- Execution
end
end
create s.make_empty
- f.append_to_html (create {CMS_TO_WSF_THEME}.make (l_response, l_response.theme), s)
+ f.append_to_html (l_response.wsf_theme, s)
l_response.set_main_content (s)
l_response.execute
end
diff --git a/modules/admin/handler/cms_admin_export_handler.e b/modules/admin/handler/cms_admin_export_handler.e
index 8f21b30..8fd510e 100644
--- a/modules/admin/handler/cms_admin_export_handler.e
+++ b/modules/admin/handler/cms_admin_export_handler.e
@@ -44,7 +44,7 @@ feature -- Execution
create {GENERIC_VIEW_CMS_RESPONSE} l_response.make (req, res, api)
f := exportation_web_form (l_response)
create s.make_empty
- f.append_to_html (create {CMS_TO_WSF_THEME}.make (l_response, l_response.theme), s)
+ f.append_to_html (l_response.wsf_theme, s)
l_response.set_main_content (s)
l_response.execute
end
@@ -85,7 +85,7 @@ feature -- Execution
end
end
create s.make_empty
- f.append_to_html (create {CMS_TO_WSF_THEME}.make (l_response, l_response.theme), s)
+ f.append_to_html (l_response.wsf_theme, s)
l_response.set_main_content (s)
l_response.execute
end
diff --git a/modules/admin/handler/cms_admin_modules_handler.e b/modules/admin/handler/cms_admin_modules_handler.e
index 53ffb20..07e9d38 100644
--- a/modules/admin/handler/cms_admin_modules_handler.e
+++ b/modules/admin/handler/cms_admin_modules_handler.e
@@ -88,7 +88,7 @@ feature -- Execution
create {GENERIC_VIEW_CMS_RESPONSE} r.make (req, res, api)
f := modules_collection_web_form (r)
create s.make_empty
- f.append_to_html (create {CMS_TO_WSF_THEME}.make (r, r.theme), s)
+ f.append_to_html (r.wsf_theme, s)
r.set_page_title ("Modules")
r.set_main_content (s)
r.execute
@@ -133,7 +133,7 @@ feature -- Execution
then
r.add_error_message ("Error occurred.")
create s.make_empty
- f.append_to_html (create {CMS_TO_WSF_THEME}.make (r, r.theme), s)
+ f.append_to_html (r.wsf_theme, s)
r.set_page_title ("Modules")
r.set_main_content (s)
else
diff --git a/modules/admin/handler/cms_admin_response.e b/modules/admin/handler/cms_admin_response.e
index 3274fb5..fb7dea4 100644
--- a/modules/admin/handler/cms_admin_response.e
+++ b/modules/admin/handler/cms_admin_response.e
@@ -8,30 +8,10 @@ class
inherit
CMS_RESPONSE
- redefine
- make,
- initialize
- end
create
make
-feature {NONE} -- Initialization
-
- make (req: WSF_REQUEST; res: WSF_RESPONSE; a_api: like api)
- do
- create {WSF_NULL_THEME} wsf_theme.make
- Precursor (req, res, a_api)
- end
-
- initialize
- do
- Precursor
- create {CMS_TO_WSF_THEME} wsf_theme.make (Current, theme)
- end
-
- wsf_theme: WSF_THEME
-
feature -- Process
process
diff --git a/modules/admin/handler/role/cms_role_form_response.e b/modules/admin/handler/role/cms_role_form_response.e
index b681549..7cdec58 100644
--- a/modules/admin/handler/role/cms_role_form_response.e
+++ b/modules/admin/handler/role/cms_role_form_response.e
@@ -8,32 +8,12 @@ class
inherit
CMS_RESPONSE
- redefine
- make,
- initialize
- end
CMS_SHARED_SORTING_UTILITIES
create
make
-feature {NONE} -- Initialization
-
- make (req: WSF_REQUEST; res: WSF_RESPONSE; a_api: like api)
- do
- create {WSF_NULL_THEME} wsf_theme.make
- Precursor (req, res, a_api)
- end
-
- initialize
- do
- Precursor
- create {CMS_TO_WSF_THEME} wsf_theme.make (Current, theme)
- end
-
- wsf_theme: WSF_THEME
-
feature -- Query
role_id_path_parameter (req: WSF_REQUEST): INTEGER_64
diff --git a/modules/admin/handler/role/cms_role_view_response.e b/modules/admin/handler/role/cms_role_view_response.e
index 53b9038..a6887ae 100644
--- a/modules/admin/handler/role/cms_role_view_response.e
+++ b/modules/admin/handler/role/cms_role_view_response.e
@@ -8,31 +8,10 @@ class
inherit
CMS_RESPONSE
- redefine
- make,
- initialize
- end
create
make
-
-feature {NONE} -- Initialization
-
- make (req: WSF_REQUEST; res: WSF_RESPONSE; a_api: like api;)
- do
- create {WSF_NULL_THEME} wsf_theme.make
- Precursor (req, res, a_api)
- end
-
- initialize
- do
- Precursor
- create {CMS_TO_WSF_THEME} wsf_theme.make (Current, theme)
- end
-
- wsf_theme: WSF_THEME
-
feature -- Query
role_id_path_parameter (req: WSF_REQUEST): INTEGER_64
diff --git a/modules/admin/handler/user/cms_user_form_response.e b/modules/admin/handler/user/cms_user_form_response.e
index 5209706..40847f0 100644
--- a/modules/admin/handler/user/cms_user_form_response.e
+++ b/modules/admin/handler/user/cms_user_form_response.e
@@ -7,32 +7,11 @@ class
CMS_USER_FORM_RESPONSE
inherit
-
CMS_RESPONSE
- redefine
- make,
- initialize
- end
create
make
-feature {NONE} -- Initialization
-
- make (req: WSF_REQUEST; res: WSF_RESPONSE; a_api: like api)
- do
- create {WSF_NULL_THEME} wsf_theme.make
- Precursor (req, res, a_api)
- end
-
- initialize
- do
- Precursor
- create {CMS_TO_WSF_THEME} wsf_theme.make (Current, theme)
- end
-
- wsf_theme: WSF_THEME
-
feature -- Query
user_id_path_parameter (req: WSF_REQUEST): INTEGER_64
diff --git a/modules/admin/handler/user/cms_user_view_response.e b/modules/admin/handler/user/cms_user_view_response.e
index 0568fcc..4cf3716 100644
--- a/modules/admin/handler/user/cms_user_view_response.e
+++ b/modules/admin/handler/user/cms_user_view_response.e
@@ -8,31 +8,10 @@ class
inherit
CMS_RESPONSE
- redefine
- make,
- initialize
- end
create
make
-
-feature {NONE} -- Initialization
-
- make (req: WSF_REQUEST; res: WSF_RESPONSE; a_api: like api;)
- do
- create {WSF_NULL_THEME} wsf_theme.make
- Precursor (req, res, a_api)
- end
-
- initialize
- do
- Precursor
- create {CMS_TO_WSF_THEME} wsf_theme.make (Current, theme)
- end
-
- wsf_theme: WSF_THEME
-
feature -- Query
user_id_path_parameter (req: WSF_REQUEST): INTEGER_64
diff --git a/modules/auth/cms_authentication_module.e b/modules/auth/cms_authentication_module.e
index e0a7c55..3787b75 100644
--- a/modules/auth/cms_authentication_module.e
+++ b/modules/auth/cms_authentication_module.e
@@ -9,10 +9,10 @@ class
inherit
CMS_MODULE
redefine
- setup_hooks
+ setup_hooks,
+ permissions
end
-
CMS_HOOK_AUTO_REGISTER
CMS_HOOK_VALUE_TABLE_ALTER
@@ -52,6 +52,13 @@ feature -- Access
name: STRING = "auth"
+ permissions: LIST [READABLE_STRING_8]
+ -- List of permission ids, used by this module, and declared.
+ do
+ Result := Precursor
+ Result.force ("account register")
+ end
+
feature -- Access: docs
root_dir: PATH
@@ -228,6 +235,7 @@ feature -- Handler
end
else
create {FORBIDDEN_ERROR_CMS_RESPONSE} r.make (req, res, api)
+ r.set_main_content ("You can also contact the webmaster to ask for an account.")
end
r.execute
diff --git a/modules/node/content/cms_node.e b/modules/node/content/cms_node.e
index f7a755c..0368c0e 100644
--- a/modules/node/content/cms_node.e
+++ b/modules/node/content/cms_node.e
@@ -11,8 +11,10 @@ deferred class
inherit
CMS_CONTENT
+ rename
+ has_identifier as has_id
redefine
- debug_output
+ debug_output, has_id
end
REFACTORING_HELPER
@@ -63,6 +65,12 @@ feature -- Conversion
feature -- Access
+ identifier: detachable IMMUTABLE_STRING_32
+ -- Optional identifier.
+ do
+ create Result.make_from_string_general (id.out)
+ end
+
id: INTEGER_64 assign set_id
-- Unique id.
--| Should we use NATURAL_64 instead?
diff --git a/modules/node/handler/cms_node_type_webform_manager.e b/modules/node/handler/cms_node_type_webform_manager.e
index 453a272..10e866d 100644
--- a/modules/node/handler/cms_node_type_webform_manager.e
+++ b/modules/node/handler/cms_node_type_webform_manager.e
@@ -92,228 +92,15 @@ feature -- Forms ...
f.extend (fset)
- -- Path alias
+ -- Path alias
populate_form_with_taxonomy (response, f, a_node)
populate_form_with_path_alias (response, f, a_node)
end
- populate_form_with_taxonomy (response: NODE_RESPONSE; f: CMS_FORM; a_node: detachable CMS_NODE)
- local
- ti: detachable WSF_FORM_TEXT_INPUT
- w_set: WSF_FORM_FIELD_SET
- w_select: WSF_FORM_SELECT
- w_opt: WSF_FORM_SELECT_OPTION
- w_cb: WSF_FORM_CHECKBOX_INPUT
- w_voc_set: WSF_FORM_FIELD_SET
- s: STRING_32
- voc: CMS_VOCABULARY
- t: detachable CMS_TERM
- l_terms: detachable CMS_TERM_COLLECTION
- l_has_edit_permission: BOOLEAN
+ populate_form_with_taxonomy (response: CMS_RESPONSE; f: CMS_FORM; a_content: detachable CMS_CONTENT)
do
- if
- attached {CMS_TAXONOMY_API} response.api.module_api ({CMS_TAXONOMY_MODULE}) as l_taxonomy_api and then
- attached l_taxonomy_api.vocabularies_for_type (content_type.name) as l_vocs and then not l_vocs.is_empty
- then
-
- l_has_edit_permission := response.has_permissions (<<"update any taxonomy", "update " + content_type.name + " taxonomy">>)
-
- -- Handle Taxonomy fields, if any associated with `content_type'.
- create w_set.make
- w_set.add_css_class ("taxonomy")
- l_vocs.sort
- across
- l_vocs as vocs_ic
- loop
- voc := vocs_ic.item
- l_terms := Void
- if a_node /= Void and then a_node.has_id then
- l_terms := l_taxonomy_api.terms_of_entity (a_node.content_type, a_node.id.out, voc)
- if l_terms /= Void then
- l_terms.sort
- end
- end
- create w_voc_set.make
- w_set.extend (w_voc_set)
-
- if voc.is_tags then
- w_voc_set.set_legend (response.translation (voc.name, Void))
-
- create ti.make ({STRING_32} "taxonomy_terms[" + voc.name + "]")
- w_voc_set.extend (ti)
- if voc.is_term_required then
- ti.enable_required
- end
- if attached voc.description as l_desc then
- ti.set_description (response.html_encoded (response.translation (l_desc, Void)))
- else
- ti.set_description (response.html_encoded (response.translation (voc.name, Void)))
- end
- ti.set_size (70)
- if l_terms /= Void then
- create s.make_empty
- across
- l_terms as ic
- loop
- t := ic.item
- if not s.is_empty then
- s.append_character (',')
- s.append_character (' ')
- end
- if ic.item.text.has (' ') then
- s.append_character ('"')
- s.append (t.text)
- s.append_character ('"')
- else
- s.append (t.text)
- end
- end
- ti.set_text_value (s)
- end
- if not l_has_edit_permission then
- ti.set_is_readonly (True)
- end
- else
- l_taxonomy_api.fill_vocabularies_with_terms (voc)
- if not voc.terms.is_empty then
- if voc.multiple_terms_allowed then
- if attached voc.description as l_desc then
- w_voc_set.set_legend (response.html_encoded (l_desc))
- else
- w_voc_set.set_legend (response.html_encoded (voc.name))
- end
- across
- voc as voc_terms_ic
- loop
- t := voc_terms_ic.item
- create w_cb.make_with_value ({STRING_32} "taxonomy_terms[" + voc.name + "]", t.text)
- w_voc_set.extend (w_cb)
- if l_terms /= Void and then across l_terms as ic some ic.item.text.same_string (t.text) end then
- w_cb.set_checked (True)
- end
- if not l_has_edit_permission then
- w_cb.set_is_readonly (True)
- end
- end
- else
- create w_select.make ({STRING_32} "taxonomy_terms[" + voc.name + "]")
- w_voc_set.extend (w_select)
-
- if attached voc.description as l_desc then
- w_select.set_description (response.html_encoded (l_desc))
- else
- w_select.set_description (response.html_encoded (voc.name))
- end
- w_voc_set.set_legend (response.html_encoded (voc.name))
-
- across
- voc as voc_terms_ic
- loop
- t := voc_terms_ic.item
- create w_opt.make (response.html_encoded (t.text), response.html_encoded (t.text))
- w_select.add_option (w_opt)
-
- if l_terms /= Void and then across l_terms as ic some ic.item.text.same_string (t.text) end then
- w_opt.set_is_selected (True)
- end
- end
- if not l_has_edit_permission then
- w_select.set_is_readonly (True)
- end
- end
- end
- end
- end
-
- f.submit_actions.extend (agent taxonomy_submit_action (response, l_taxonomy_api, l_vocs, a_node, ?))
-
- if
- attached f.fields_by_name ("title") as l_title_fields and then
- attached l_title_fields.first as l_title_field
- then
- f.insert_after (w_set, l_title_field)
- else
- f.extend (w_set)
- end
- end
- end
-
- taxonomy_submit_action (a_response: CMS_RESPONSE; a_taxonomy_api: CMS_TAXONOMY_API; a_vocs: CMS_VOCABULARY_COLLECTION; a_node: detachable CMS_NODE fd: WSF_FORM_DATA)
- require
- vocs_not_empty: not a_vocs.is_empty
- local
- l_voc_name: READABLE_STRING_32
- l_terms_to_remove: ARRAYED_LIST [CMS_TERM]
- l_new_terms: LIST [READABLE_STRING_32]
- l_text: READABLE_STRING_GENERAL
- l_found: BOOLEAN
- t: detachable CMS_TERM
- do
- if
- a_node /= Void and then a_node.has_id and then
- attached fd.table_item ("taxonomy_terms") as fd_terms
- then
- across
- fd_terms.values as ic
- loop
- if attached {WSF_STRING} ic.item as l_string then
- l_voc_name := ic.key
- l_new_terms := a_taxonomy_api.splitted_string (l_string.value, ',')
- if attached a_vocs.item_by_name (l_voc_name) as voc then
- if a_response.has_permissions (<<{STRING_32} "update any taxonomy", {STRING_32} "update " + content_type.name + " taxonomy">>) then
- create l_terms_to_remove.make (0)
- if attached a_taxonomy_api.terms_of_entity (content_type.name, a_node.id.out, voc) as l_existing_terms then
- across
- l_existing_terms as t_ic
- loop
- l_text := t_ic.item.text
- from
- l_found := False
- l_new_terms.start
- until
- l_new_terms.after
- loop
- if l_new_terms.item.same_string_general (l_text) then
- -- Already associated with term `t_ic.text'.
- l_found := True
- l_new_terms.remove
- else
- l_new_terms.forth
- end
- end
- if not l_found then
- -- Remove term
- l_terms_to_remove.force (t_ic.item)
- end
- end
- across
- l_terms_to_remove as t_ic
- loop
- a_taxonomy_api.unassociate_term_from_entity (t_ic.item, content_type.name, a_node.id.out)
- end
- end
- across
- l_new_terms as t_ic
- loop
- t := a_taxonomy_api.term_by_text (t_ic.item, voc)
- if
- t = Void and voc.is_tags
- then
- -- Create new term!
- create t.make (t_ic.item)
- a_taxonomy_api.save_term (t, voc)
- if a_taxonomy_api.has_error then
- t := Void
- end
- end
- if t /= Void then
- a_taxonomy_api.associate_term_with_entity (t, content_type.name, a_node.id.out)
- end
- end
- end
- end
- end
- end
+ if attached {CMS_TAXONOMY_API} response.api.module_api ({CMS_TAXONOMY_MODULE}) as l_taxonomy_api then
+ l_taxonomy_api.populate_edit_form (response, f, content_type.name, a_content)
end
end
@@ -547,30 +334,9 @@ feature -- Output
if
a_response /= Void and then
- attached {CMS_TAXONOMY_API} cms_api.module_api ({CMS_TAXONOMY_MODULE}) as l_taxonomy_api and then
- attached l_taxonomy_api.vocabularies_for_type (content_type.name) as vocs and then not vocs.is_empty
+ attached {CMS_TAXONOMY_API} cms_api.module_api ({CMS_TAXONOMY_MODULE}) as l_taxonomy_api
then
- vocs.sort
- across
- vocs as ic
- loop
- if
- attached l_taxonomy_api.terms_of_entity (content_type.name, a_node.id.out, ic.item) as l_terms and then
- not l_terms.is_empty
- then
- a_output.append ("