From ff0bd781d2b360917d1861166657d0e11446d97c Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Tue, 18 Aug 2009 12:35:42 +0500 Subject: modulemanager: Added module API function to get all items for a given host based on a key --- core/modulemanager.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'core') diff --git a/core/modulemanager.lua b/core/modulemanager.lua index ff31271b..36403b60 100644 --- a/core/modulemanager.lua +++ b/core/modulemanager.lua @@ -443,6 +443,19 @@ function api:remove_item(key, value) end end +function api:get_host_items(key) + local result = {}; + for mod_name, module in pairs(modulemap[self.host]) do + module = module.module; + if module.items then + for _, item in ipairs(module.items[key] or NULL) do + t_insert(result, item); + end + end + end + return result; +end + -------------------------------------------------------------------- local actions = {}; -- cgit v1.2.3