* luci/statistics: fix path to types.db in default config, adept stat-genconfig to...
[project/luci.git] / core / src / menu.lua
1 --[[
2 LuCI - Menu Builder
3
4 Description:
5 Collects menu building information from controllers
6
7 FileId:
8 $Id$
9
10 License:
11 Copyright 2008 Steven Barth <steven@midlink.org>
12
13 Licensed under the Apache License, Version 2.0 (the "License");
14 you may not use this file except in compliance with the License.
15 You may obtain a copy of the License at 
16
17         http://www.apache.org/licenses/LICENSE-2.0 
18
19 Unless required by applicable law or agreed to in writing, software
20 distributed under the License is distributed on an "AS IS" BASIS,
21 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 See the License for the specific language governing permissions and
23 limitations under the License.
24
25 ]]--
26 module("luci.menu", package.seeall)
27
28 require("luci.fs")
29 require("luci.util")
30 require("luci.sys")
31 require("luci.dispatcher")
32
33 -- Default modelpath
34 modelpattern = luci.sys.libpath() .. "/model/menu/*.lua"
35
36 -- Menu definition extra scope
37 scope = {
38         translate = function(...) return require("luci.i18n").translate(...) end,
39         loadtrans = function(...) return require("luci.i18n").loadc(...) end,
40         isfile    = luci.fs.isfile
41 }
42
43 -- Returns the menu information
44 function get()
45         return menu
46 end