diff options
author | Mika Havela <mika.havela@gmail.com> | 2008-04-08 09:39:36 +0000 |
---|---|---|
committer | Mika Havela <mika.havela@gmail.com> | 2008-04-08 09:39:36 +0000 |
commit | 5901c2a6bf7c6f17a32bc957772dda9ec456ed55 (patch) | |
tree | b2c44bdd48bd96fd40422e2e7c7faa6179314f55 /quagga-controller.lua | |
parent | bfac3536373cdd298169019d80a0af7078ce37b9 (diff) | |
download | acf-quagga-5901c2a6bf7c6f17a32bc957772dda9ec456ed55.tar.bz2 acf-quagga-5901c2a6bf7c6f17a32bc957772dda9ec456ed55.tar.xz |
Cleaning up code.
git-svn-id: svn://svn.alpinelinux.org/acf/quagga/trunk@952 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'quagga-controller.lua')
-rw-r--r-- | quagga-controller.lua | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/quagga-controller.lua b/quagga-controller.lua index 8550fb5..cb63668 100644 --- a/quagga-controller.lua +++ b/quagga-controller.lua @@ -1,24 +1,20 @@ module(..., package.seeall) --- This is the object/text used when we want to add a new record - +-- Load libraries require("format") +-- Set variables local newrecordtxt = "[New]" -local list_redir = function (self) +-- ################################################################################ +-- LOCAL FUNCTIONS + +local function list_redir(self) self.conf.action = "status" self.conf.type = "redir" error (self.conf) end -mvc = {} -mvc.on_load = function(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 - local function displaycmdmanagement(disablestart,disablestop,disablerestart) -- Add a management buttons local management = {} @@ -48,11 +44,18 @@ 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 + function status(self) return { status=self.model.getstatus() } end -expert = function (self) +function expert(self) local modifications = self.clientdata.filecontent or "" if ( self.clientdata.cmdsave ) then modifications = self.model:update_filecontent(modifications) @@ -107,7 +110,8 @@ expert = function (self) cmdmanagement = cmdmanagement, url = url, } ) end -logfile = function (self) + +function logfile(self) local status=self.model.getstatus() local logfile = self.model:get_logfile() |