summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-04-24 20:31:58 +0000
committerTed Trask <ttrask01@yahoo.com>2008-04-24 20:31:58 +0000
commit4d7ae8ac014de3bb30da89729218e92451660eea (patch)
tree7934779ab03b2302f763a6295c77c0d53a2c678c
parent3f5fc28c34a3baad2a684593ec867db63e710b06 (diff)
downloadacf-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
-rw-r--r--apk-controller.lua18
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