From 4d7ae8ac014de3bb30da89729218e92451660eea 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/apk/trunk@1037 ab2d0c66-481e-0410-8bed-d214d4d58bed --- apk-controller.lua | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/apk-controller.lua b/apk-controller.lua index 1661bba..669184e 100644 --- a/apk-controller.lua +++ b/apk-controller.lua @@ -2,19 +2,7 @@ module (..., package.seeall) --- Cause an http redirect to our "read" action --- We use the self.conf table because it already has prefix,controller,etc --- The redir code is defined in the application error handler (acf-controller) -local list_redir = function (self) - self.conf.action = "loaded" - self.conf.type = "redir" - error (self.conf) -end - -mvc= {} -mvc.on_load = function(self, parent) - self.conf.default_action = "loaded" -end +default_action = "loaded" read = function(self) local loaded, available = self.model.get_packages() @@ -42,7 +30,7 @@ delete = function(self) local cmdresult = self.model.delete_package(package, self.sessiondata) -- Put the result in session data and redirect self.sessiondata.cmdresult = cmdresult - list_redir(self) + redirect(self) end install = function(self) @@ -50,6 +38,6 @@ install = function(self) local cmdresult = self.model.install_package(package, self.sessiondata) -- Put the result in session data and redirect self.sessiondata.cmdresult = cmdresult - list_redir(self) + redirect(self) end -- cgit v1.2.3