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 | 4d7ae8ac014de3bb30da89729218e92451660eea (patch) | |
tree | 7934779ab03b2302f763a6295c77c0d53a2c678c /apk-controller.lua | |
parent | 3f5fc28c34a3baad2a684593ec867db63e710b06 (diff) | |
download | acf-apk-tools-4d7ae8ac014de3bb30da89729218e92451660eea.tar.bz2 acf-apk-tools-4d7ae8ac014de3bb30da89729218e92451660eea.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/apk/trunk@1037 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'apk-controller.lua')
-rw-r--r-- | apk-controller.lua | 18 |
1 files 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 |