Changeset 6131
- Timestamp:
- 04/27/10 08:25:20 (3 years ago)
- Files:
-
- 1 modified
-
luci/trunk/libs/cbi/luasrc/cbi.lua (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
luci/trunk/libs/cbi/luasrc/cbi.lua
r6130 r6131 765 765 end 766 766 767 -- Check whether the section has tabs 768 function AbstractSection.has_tabs(self) 769 return (self.tabs ~= nil) and (next(self.tabs) ~= nil) 770 end 771 767 772 -- Appends a new option 768 773 function AbstractSection.option(self, class, option, ...) … … 814 819 local field = self.map:formvalue("cbi.opt."..self.config.."."..section) 815 820 for k,v in ipairs(self.children) do 816 if v.optional and not v:cfgvalue(section) and not next(self.tabs) then821 if v.optional and not v:cfgvalue(section) and not self:has_tabs() then 817 822 if field == v.option then 818 823 field = nil … … 1291 1296 -- Render if this value exists or if it is mandatory 1292 1297 function AbstractValue.render(self, s, scope) 1293 if not self.optional or next(self.section.tabs) or self:cfgvalue(s) or self:formcreated(s) then1298 if not self.optional or self.section:has_tabs() or self:cfgvalue(s) or self:formcreated(s) then 1294 1299 scope = scope or {} 1295 1300 scope.section = s
