diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2008-10-10 21:52:22 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2008-10-10 21:52:22 +0000 |
commit | b618361bf1c7ea160f3e0ef18aa8f409f7a21eff (patch) | |
tree | 2765d22f35d710e806be8a23f7f5efdad9100949 /libs/cbi/luasrc/cbi.lua | |
parent | 720295d973b44cdad4cd4a0e0b0b0f7f79ff6c3a (diff) |
* luci/libs/cbi: implement file browse fields
* luci/modules/admin-full: add file browse controller
Diffstat (limited to 'libs/cbi/luasrc/cbi.lua')
-rw-r--r-- | libs/cbi/luasrc/cbi.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/cbi/luasrc/cbi.lua b/libs/cbi/luasrc/cbi.lua index 176fa453a2..eed2b64d3d 100644 --- a/libs/cbi/luasrc/cbi.lua +++ b/libs/cbi/luasrc/cbi.lua @@ -1395,6 +1395,12 @@ function FileUpload.__init__(self, ...) end end +function FileUpload.formcreated(self, section) + return AbstractValue.formcreated(self, section) or + luci.http.formvalue("cbi.rlf."..section.."."..self.option) or + luci.http.formvalue("cbi.rlf."..section.."."..self.option..".x") +end + function FileUpload.cfgvalue(self, section) local val = AbstractValue.cfgvalue(self, section) if val and luci.fs.access(val) then @@ -1422,3 +1428,11 @@ function FileUpload.remove(self, section) if val and luci.fs.access(val) then luci.fs.unlink(val) end return AbstractValue.remove(self, section) end + + +FileBrowser = class(AbstractValue) + +function FileBrowser.__init__(self, ...) + AbstractValue.__init__(self, ...) + self.template = "cbi/browser" +end |