Improved taxonomy by supporting tags, multiple terms allowed, and required kind of vocabulary for specific content type.

Updated node web form, to support taxonomy editing if allowed (specific support for CMS_VOCABULARY.is_tags: BOOLEAN).
Added notion of required or optional module dependencies.
This commit is contained in:
2015-12-03 19:24:58 +01:00
parent f1f3c126dd
commit 20dfce1396
27 changed files with 1339 additions and 84 deletions

View File

@@ -17,7 +17,8 @@ inherit
initialize,
install,
uninstall,
taxonomy_api
taxonomy_api,
permissions
end
CMS_HOOK_MENU_SYSTEM_ALTER
@@ -41,6 +42,16 @@ feature -- Access
name: STRING = "taxonomy"
permissions: LIST [READABLE_STRING_8]
-- List of permission ids, used by this module, and declared.
do
Result := Precursor
Result.force ("admin taxonomy")
Result.force ("update any taxonomy")
Result.force ("update page taxonomy") -- related to node module
Result.force ("update blog taxonomy") -- related to blog module
end
feature {CMS_API} -- Module Initialization
initialize (api: CMS_API)
@@ -53,6 +64,9 @@ feature {CMS_API} -- Module Initialization
feature {CMS_API} -- Module management
install (api: CMS_API)
local
voc: CMS_VOCABULARY
l_taxonomy_api: like taxonomy_api
do
-- Schema
if attached {CMS_STORAGE_SQL_I} api.storage as l_sql_storage then
@@ -61,6 +75,13 @@ feature {CMS_API} -- Module management
api.logger.put_error ("Could not install database for taxonomy module", generating_type)
end
Precursor (api)
create l_taxonomy_api.make (api)
create voc.make ("Tags")
voc.set_description ("Enter comma separated tags.")
l_taxonomy_api.save_vocabulary (voc)
voc.set_is_tags (True)
l_taxonomy_api.associate_vocabulary_with_type (voc, "page")
end
end