diff options
Diffstat (limited to 'app/dummy')
-rw-r--r-- | app/dummy/bar-controller.lua | 35 | ||||
-rw-r--r-- | app/dummy/bar-html.lsp | 3 | ||||
-rw-r--r-- | app/dummy/bar.menu | 3 |
3 files changed, 41 insertions, 0 deletions
diff --git a/app/dummy/bar-controller.lua b/app/dummy/bar-controller.lua new file mode 100644 index 0000000..e0b9999 --- /dev/null +++ b/app/dummy/bar-controller.lua @@ -0,0 +1,35 @@ +-- A standin controller for testing + +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 = "read" + self.conf.type = "redir" + error (self.conf) +end + + +--init ( init by definition is a public method) +init = function(self, parent) + -- If they specify an invalid action or try to run init, then redirect + -- to the read function. + if ( self.conf.action == nil or self.conf.action == "init" ) then + list_redir(self) + end + -- Make a function by the action name + self.worker[self.conf.action] = function () + return cfe ( {name=self.conf.action, value=self.conf.action} ) + + end + +end + + +read = function (self ) + return ( { } ) +end + + diff --git a/app/dummy/bar-html.lsp b/app/dummy/bar-html.lsp new file mode 100644 index 0000000..708e1ad --- /dev/null +++ b/app/dummy/bar-html.lsp @@ -0,0 +1,3 @@ +<? view = ... ?> +<h1>Action <?= view.name ?></h1> +<p>This is a null controller for menu and authorization testing.</p> diff --git a/app/dummy/bar.menu b/app/dummy/bar.menu new file mode 100644 index 0000000..1fb42b8 --- /dev/null +++ b/app/dummy/bar.menu @@ -0,0 +1,3 @@ +# Prefix and controller are already known at this point +# Cat Group Tab Action +Test Bar_controller bar read |