diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-12-22 06:50:20 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-12-22 06:50:20 +0000 |
commit | bdc0876fa86e29ee439e69024f6f476c49886b99 (patch) | |
tree | ee1b629c7b241322f966eaf287549c8c1aefdc1d /core/controllers | |
parent | f6381c534e92e230349f5633eb280a22421d9050 (diff) |
Add messaging system for reporting actions back to the user. Make
module install/uninstall work and tie it into the messaging system.
Diffstat (limited to 'core/controllers')
-rw-r--r-- | core/controllers/admin_modules.php | 16 |
1 files changed, 15 insertions, 1 deletions
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"); } } |