summaryrefslogtreecommitdiffstats
path: root/opennhrp-controller.lua
diff options
context:
space:
mode:
Diffstat (limited to 'opennhrp-controller.lua')
-rw-r--r--opennhrp-controller.lua37
1 files changed, 37 insertions, 0 deletions
diff --git a/opennhrp-controller.lua b/opennhrp-controller.lua
new file mode 100644
index 0000000..e592bbc
--- /dev/null
+++ b/opennhrp-controller.lua
@@ -0,0 +1,37 @@
+module(..., package.seeall)
+
+-- This is the object/text used when we want to add a new record
+
+require("format")
+
+local newrecordtxt = "[New]"
+
+local list_redir = function (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 getstatus(self)
+ local status = self.model.getstatus()
+ if (#status.status.value > 0) then
+ status.status.value = "Enabled"
+ else
+ status.status.value = "Disabled"
+ end
+
+ return status
+end
+-- ################################################################################
+-- PUBLIC FUNCTIONS
+function status(self)
+ return { status=getstatus(self) }
+end
+