Added module administration from /admin/modules/

This commit is contained in:
2015-11-23 11:08:06 +01:00
parent 2cf2b1da8c
commit b8920ee8b3
4 changed files with 355 additions and 6 deletions

View File

@@ -107,7 +107,7 @@ feature {NONE} -- Initialize
feature {CMS_ACCESS} -- Installation
install
install_all_modules
-- Install CMS or uninstalled module which are enabled.
local
l_module: CMS_MODULE
@@ -121,14 +121,30 @@ feature {CMS_ACCESS} -- Installation
-- and leave the responsability to the module to know
-- if this is installed or not...
if not l_module.is_installed (Current) then
l_module.install (Current)
if l_module.is_enabled then
l_module.initialize (Current)
end
install_module (l_module)
end
end
end
install_module (m: CMS_MODULE)
-- Install module `m'.
require
module_not_installed: not is_module_installed (m)
do
m.install (Current)
if m.is_enabled then
m.initialize (Current)
end
end
uninstall_module (m: CMS_MODULE)
-- Uninstall module `m'.
require
module_installed: is_module_installed (m)
do
m.uninstall (Current)
end
feature -- Access
setup: CMS_SETUP

View File

@@ -45,6 +45,7 @@ feature -- HTTP Methods
lst: ARRAYED_LIST [CMS_MODULE]
l_denied: BOOLEAN
do
--| FIXME: improve the installer.
create {GENERIC_VIEW_CMS_RESPONSE} r.make (req, res, api)
if attached api.setup.string_8_item ("admin.installation_access") as l_access then
if l_access.is_case_insensitive_equal ("none") then
@@ -77,7 +78,7 @@ feature -- HTTP Methods
lst.force (l_module)
end
end
api.install
api.install_all_modules
across
lst as ic
loop