From bdc0876fa86e29ee439e69024f6f476c49886b99 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 22 Dec 2008 06:50:20 +0000 Subject: Add messaging system for reporting actions back to the user. Make module install/uninstall work and tie it into the messaging system. --- core/controllers/admin_modules.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'core/controllers/admin_modules.php') diff --git a/core/controllers/admin_modules.php b/core/controllers/admin_modules.php index a9769ba6..ada7dcfd 100644 --- a/core/controllers/admin_modules.php +++ b/core/controllers/admin_modules.php @@ -25,7 +25,21 @@ class Admin_Modules_Controller extends Admin_Controller { } public function save() { - // Nothing yet + foreach (module::available() as $module_name => $info) { + if ($info->locked) { + continue; + } + + $desired = $this->input->post($module_name) == 1; + if ($info->installed && !$desired) { + module::uninstall($module_name); + message::add(sprintf(_("Uninstalled %s module"), $info->name)); + } else if (!$info->installed && $desired) { + module::install($module_name); + message::add(sprintf(_("Installed %s module"), $info->name)); + } + } + url::redirect("admin/modules"); } } -- cgit v1.2.3