diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/menubuilder.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/menubuilder.lua b/lib/menubuilder.lua index 6def1fe..ecdf9f1 100644 --- a/lib/menubuilder.lua +++ b/lib/menubuilder.lua @@ -37,6 +37,21 @@ local t_compare = function (x,y,f) return false end +-- Returns a table of all submenu items found +-- Displayorder of the tabs comes from the order in the .menu files +get_submenuitems = function (startdir) + local t = {} + local menuitems = get_menuitems(startdir) + + for k,v in pairs(menuitems) do + if (menuitems[k]["tab"] ~= "") then + if not (t[menuitems[k]["controller"]]) then t[menuitems[k]["controller"]] = {} end + table.insert (t[menuitems[k]["controller"]], {tab=menuitems[k]["tab"],action=menuitems[k]["action"]}) + end + end + + return t +end -- returns a table of all the menu items found, sorted by priority -- Table format: prefix controller cat group tab action |