cgi-bin/tek/class/loona.lua
changeset 253 c845ac1bb22c
parent 252 8b4bf1c5d718
child 254 21aabb5e37a6
     1.1 --- a/cgi-bin/tek/class/loona.lua	Wed Nov 05 11:58:20 2008 +0100
     1.2 +++ b/cgi-bin/tek/class/loona.lua	Tue Jan 20 22:46:39 2009 +0100
     1.3 @@ -41,7 +41,7 @@
     1.4  -------------------------------------------------------------------------------
     1.5  
     1.6  module("tek.class.loona", tek.class)
     1.7 -_VERSION = "LOona Class 5.8"
     1.8 +_VERSION = "LOona Class 5.9"
     1.9  
    1.10  -------------------------------------------------------------------------------
    1.11  --	Markup:
    1.12 @@ -1095,8 +1095,10 @@
    1.13  			end
    1.14  			self.section.dynamic[editkey] = dynamic
    1.15  			local n = 0
    1.16 -			for _ in pairs(self.section.dynamic) do
    1.17 -				n = n + 1
    1.18 +			for _, v in pairs(self.section.dynamic) do
    1.19 +				if v then
    1.20 +					n = n + 1
    1.21 +				end
    1.22  			end
    1.23  			if n == 0 then
    1.24  				self.section.dynamic = nil
    1.25 @@ -1559,8 +1561,10 @@
    1.26  				if self.section.dynamic then
    1.27  					self.section.dynamic[key] = nil
    1.28  					local n = 0
    1.29 -					for _ in pairs(self.section.dynamic) do
    1.30 -						n = n + 1
    1.31 +					for _, v in pairs(self.section.dynamic) do
    1.32 +						if v then
    1.33 +							n = n + 1
    1.34 +						end
    1.35  					end
    1.36  					if n == 0 then
    1.37  						self.section.dynamic = nil
    1.38 @@ -1843,8 +1847,8 @@
    1.39  	self:recursesections(self.sections, function(self, s, e, path, dynamic)
    1.40  		path = path and path .. "_" .. e.name or e.name
    1.41  		dynamic = dynamic or { }
    1.42 -		for k in pairs(e.dynamic or { }) do
    1.43 -			dynamic[k] = true
    1.44 +		for k, v in pairs(e.dynamic or { }) do
    1.45 +			dynamic[k] = v
    1.46  		end
    1.47  		for k in pairs(dynamic) do
    1.48  			local ext = (k == "main" and "") or "." .. k
    1.49 @@ -1854,13 +1858,17 @@
    1.50  			end
    1.51  		end
    1.52  		local n = 0
    1.53 -		for k in pairs(dynamic) do
    1.54 -			n = n + 1
    1.55 +		for k, v in pairs(dynamic) do
    1.56 +			if v then
    1.57 +				n = n + 1
    1.58 +			end
    1.59  		end
    1.60  		if n > 0 then
    1.61  			e.dynamic = { }
    1.62 -			for k in pairs(dynamic) do
    1.63 -				e.dynamic[k] = true
    1.64 +			for k, v in pairs(dynamic) do
    1.65 +				if v then
    1.66 +					e.dynamic[k] = v
    1.67 +				end
    1.68  			end
    1.69  		else
    1.70  			e.dynamic = nil