improved menu callbacks, error reporting, starter and makefile
authorTimm S. Mueller <tmueller@neoscientists.org>
Wed, 10 Oct 2007 10:37:29 +0200
changeset 1998b5fc485edf4
parent 198 87a4de7c7457
child 200 6bfb1fa24598
improved menu callbacks, error reporting, starter and makefile
Makefile
cgi-bin/tek/app/loona.lua
cgi-bin/tek/class/loona.lua
     1.1 --- a/Makefile	Fri Oct 05 01:41:59 2007 +0200
     1.2 +++ b/Makefile	Wed Oct 10 10:37:29 2007 +0200
     1.3 @@ -68,7 +68,7 @@
     1.4  	chmod -R 664 *
     1.5  	chown -R :$(GROUP) *
     1.6  	find . -type d | xargs chmod ugo+x
     1.7 -	chmod ugo+x $(CGIDIR)/loona.cgi
     1.8 +	chmod ugo+x $(CGIDIR)/loona.cgi $(CGIDIR)/loona_fastcgi.lua
     1.9  	chown -R $(WWWUSER) $(VARDIR)/sessions $(VARDIR)/htmlcache
    1.10  	chown -R $(WWWUSER) $(CONTENTDIR) $(HTDIR)
    1.11  	find . -name CVS -type d | xargs -r chmod g+rw
     2.1 --- a/cgi-bin/tek/app/loona.lua	Fri Oct 05 01:41:59 2007 +0200
     2.2 +++ b/cgi-bin/tek/app/loona.lua	Wed Oct 10 10:37:29 2007 +0200
     2.3 @@ -25,6 +25,7 @@
     2.4  	buf = buf or Buffer:new()
     2.5  	request = request or Request:new()
     2.6  	document = document or request:getdocument()
     2.7 +	userdata = userdata or { }
     2.8  
     2.9  	if document.Handler then
    2.10  		local loona, detail, trace
     3.1 --- a/cgi-bin/tek/class/loona.lua	Fri Oct 05 01:41:59 2007 +0200
     3.2 +++ b/cgi-bin/tek/class/loona.lua	Wed Oct 10 10:37:29 2007 +0200
     3.3 @@ -483,7 +483,8 @@
     3.4  	local f, msg = open(fname2)
     3.5  	assert(f, self:dbmsg("Cannot open file", msg))
     3.6  	local parsed, msg = self:loadhtml(f, "loona:out", fname2)
     3.7 -	assert(parsed, self:dbmsg("Syntax error", msg and msg.text))
     3.8 +	msg = msg and (type(msg) == "string" and msg or msg.txt)
     3.9 +	assert(parsed, self:dbmsg("Syntax error", msg))
    3.10  	return self:runboxed(parsed, nil, unpack(arg))
    3.11  end
    3.12  
    3.13 @@ -635,12 +636,12 @@
    3.14  				local label = self:encodeform(e.label or e.name)
    3.15  				local newpath = path and path .. "/" .. e.name or e.name
    3.16  				local active = (e.name == sub.name)
    3.17 -				render.itembegin(self, level, idx)
    3.18 +				render.itembegin(self, level, idx, label)
    3.19  				render.link(self, level, newpath, label, active, e.action)
    3.20  				if recurse and active then
    3.21  					self:rmenu(level + 1, render, newpath, addnew, recurse)
    3.22  				end
    3.23 -				render.itemend(self)
    3.24 +				render.itemend(self, level, idx, label)
    3.25  			end
    3.26  			render.listend(self)
    3.27  		end