* CBI update
[project/luci.git] / src / ffluci / cbi.lua
1 --[[
2 FFLuCI - Configuration Bind Interface
3
4 Description:
5 Offers an interface for binding confiugration values to certain
6 data types. Supports value and range validation and basic dependencies.
7
8 FileId:
9 $Id$
10
11 License:
12 Copyright 2008 Steven Barth <steven@midlink.org>
13
14 Licensed under the Apache License, Version 2.0 (the "License");
15 you may not use this file except in compliance with the License.
16 You may obtain a copy of the License at
17
18 http://www.apache.org/licenses/LICENSE-2.0
19
20 Unless required by applicable law or agreed to in writing, software
21 distributed under the License is distributed on an "AS IS" BASIS,
22 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 See the License for the specific language governing permissions and
24 limitations under the License.
25
26 ]]--
27 module("ffluci.cbi", package.seeall)
28 require("ffluci.util")
29 local class = ffluci.util.class
30
31
32 -- Node pseudo abstract class
33 Node = class()
34
35 function Node.__init__(self, title, description)
36 self.children = {}
37 self.title = title
38 self.description = description
39 end
40
41 function Node.append(self, obj)
42 table.insert(self.children, obj)
43 end
44
45
46 -- CBI Map
47 Map = class(Node)
48
49 function Map.__init__(self, ...)
50 Node.__init__(self, ...)
51 end
52
53 function Map.render(self, template)
54 -- ToDo
55 end