From 61f6393e8cc80635c33a7d77eb5b8208b768d4fa Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Thu, 24 Apr 2008 20:31:58 +0000 Subject: Replaced all list_redir functions with redirect in mvc.lua, implemented a default_action string in each controller, removing the on_load functions git-svn-id: svn://svn.alpinelinux.org/acf/gnats/trunk@1037 ab2d0c66-481e-0410-8bed-d214d4d58bed --- gnats-controller.lua | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'gnats-controller.lua') diff --git a/gnats-controller.lua b/gnats-controller.lua index 26cc67a..57a9d04 100644 --- a/gnats-controller.lua +++ b/gnats-controller.lua @@ -97,24 +97,10 @@ local descr = { } --- ################################################################################ --- LOCAL FUNCTIONS - -local function list_redir(self) - self.conf.action = "status" - self.conf.type = "redir" - error (self.conf) -end - - -- ################################################################################ -- PUBLIC FUNCTIONS -mvc = {} -function mvc.on_load(self, parent) - if (self.worker[self.conf.action] == nil ) or ( self.conf.action == "init" ) then - self.worker[self.conf.action] = list_redir(self) - end -end + +default_action = "status" function status(self) return { status=self.model.getstatus() } @@ -271,7 +257,7 @@ function queryresult(self) if (tonumber(pr_id)) then query.header, query.sfields, query.mfields = self.model:read_pr(pr_id) else - list_redir(self) + redirect(self) end local myform = query.header -- cgit v1.2.3