mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-06-16 15:09:55 -04:00
Add messaging system for reporting actions back to the user. Make
module install/uninstall work and tie it into the messaging system.
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user