diff options
author | Mika Havela <mika.havela@gmail.com> | 2008-02-06 19:45:08 +0000 |
---|---|---|
committer | Mika Havela <mika.havela@gmail.com> | 2008-02-06 19:45:08 +0000 |
commit | 488d84633e944dda8381ce9e8fd99674702b9e8c (patch) | |
tree | d2f0adc9468980f21ae528c7883b7efa87df9a37 /lib/menubuilder.lua | |
parent | 13c4b25ab45c2ab897140fbafa59eafb9cacf000 (diff) | |
download | acf-core-488d84633e944dda8381ce9e8fd99674702b9e8c.tar.bz2 acf-core-488d84633e944dda8381ce9e8fd99674702b9e8c.tar.xz |
Changed the way the submenu-tabs is displayed. Now tabs are defined in the .menu files.
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@705 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'lib/menubuilder.lua')
-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 |