diff options
author | Ted Trask <ttrask01@yahoo.com> | 2009-12-23 16:51:17 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2009-12-23 16:51:17 +0000 |
commit | 17ecdf3680593a739bf32186e8ca1a0dcaf9ea10 (patch) | |
tree | bea1fda559cef53cc3a524f656ca6fdf52302b7c /lib/menubuilder.lua | |
parent | da8d6a71739aa6e1eff39a099893b33b1ad51569 (diff) | |
download | acf-core-17ecdf3680593a739bf32186e8ca1a0dcaf9ea10.tar.bz2 acf-core-17ecdf3680593a739bf32186e8ca1a0dcaf9ea10.tar.xz |
Modified menus to allow multiple controllers to use same menu group.
Also, allow for symlinks when searching for menu files. Slight cleanup of roles.
Diffstat (limited to 'lib/menubuilder.lua')
-rw-r--r-- | lib/menubuilder.lua | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/menubuilder.lua b/lib/menubuilder.lua index 975c31a..3922129 100644 --- a/lib/menubuilder.lua +++ b/lib/menubuilder.lua @@ -10,7 +10,7 @@ require("format") -- returns a table of the "*.menu" tables -- startdir should be the app dir. local get_candidates = function (startdir) - return fs.find_files_as_array(".*%.menu", startdir) + return fs.find_files_as_array(".*%.menu", startdir, true) end -- Split string into priority and name, convert '_' to space @@ -87,16 +87,19 @@ get_menuitems = function (startdir) if nil == cat.groups[cat.reversegroups[result.group]] then table.insert ( cat.groups, { name = result.group, - controller = controller, - prefix = prefix, + controllers = {}, tabs = {} } ) cat.reversegroups[result.group] = #cat.groups end + cat.groups[cat.reversegroups[result.group]].controllers[prefix..controller] = true local group = cat.groups[cat.reversegroups[result.group]] group.priority = group.priority or result.group_prio -- Add the tab if nil == result.tab or nil == result.action then break end - local tab = { name = result.tab, action = result.action } + local tab = { name = result.tab, + controller = controller, + prefix = prefix, + action = result.action } table.insert(group.tabs, tab) end end |