Diff

core/modulemanager.lua @ 709:8bb83563cb21

Automated merge with http://waqas.ath.cx:8000/
author Matthew Wild <mwild1@gmail.com>
date Tue, 13 Jan 2009 15:29:00 +0000
parent 708:b72d408f5f15
parent 698:d8a678e40a0a
child 710:56f6c115bc69
line wrap: on
line diff
--- a/core/modulemanager.lua	Tue Jan 13 20:19:52 2009 +0500
+++ b/core/modulemanager.lua	Tue Jan 13 15:29:00 2009 +0000
@@ -27,7 +27,7 @@
 local eventmanager = require "core.eventmanager";
 local config = require "core.configmanager";
 local multitable_new = require "util.multitable".new;
-
+local register_actions = require "core.actions".register;
 
 local loadfile, pcall = loadfile, pcall;
 local setmetatable, setfenv, getfenv = setmetatable, setfenv, getfenv;
@@ -68,11 +68,11 @@
 	local disabled_set = {};
 	if modules_enabled then
 		if modules_disabled then
-			for _, module in pairs(modules_disabled) do
+			for _, module in ipairs(modules_disabled) do
 				disabled_set[module] = true;
 			end
 		end
-		for _, module in pairs(modules_enabled) do
+		for _, module in ipairs(modules_enabled) do
 			if not disabled_set[module] then
 				load(host, module);
 			end
@@ -256,4 +256,17 @@
 
 --------------------------------------------------------------------
 
+local actions = {};
+
+function actions.load(params)
+	--return true, "Module loaded ("..params.module.." on "..params.host..")";
+	return load(params.host, params.module);
+end
+
+function actions.unload(params)
+	return unload(params.host, params.module);
+end
+
+register_actions("/modules", actions);
+
 return _M;