diff options
author | Ted Trask <ttrask01@yahoo.com> | 2008-04-24 20:31:58 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2008-04-24 20:31:58 +0000 |
commit | 61f6393e8cc80635c33a7d77eb5b8208b768d4fa (patch) | |
tree | c07987f19ebbb277de5231feac0785c85a00c40a | |
parent | 7462022b3bc23bfd80ff2ef0866df7b0fe2eb54c (diff) | |
download | acf-gnats-61f6393e8cc80635c33a7d77eb5b8208b768d4fa.tar.bz2 acf-gnats-61f6393e8cc80635c33a7d77eb5b8208b768d4fa.tar.xz |
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
-rw-r--r-- | gnats-controller.lua | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/gnats-controller.lua b/gnats-controller.lua index 26cc67a..57a9d04 100644 --- a/gnats-controller.lua +++ b/gnats-controller.lua @@ -98,23 +98,9 @@ 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 |