From fffed594467064f07b480b0d651a541612b35a7f Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 16 Nov 2007 08:00:28 +0000 Subject: moving foo and bar to sandbox git-svn-id: svn://svn.alpinelinux.org/acf/sandbox/trunk@315 ab2d0c66-481e-0410-8bed-d214d4d58bed --- Makefile | 12 +++++++++--- bar-controller.lua | 35 +++++++++++++++++++++++++++++++++++ bar-html.lsp | 3 +++ bar.menu | 3 +++ foo-controller.lua | 36 ++++++++++++++++++++++++++++++++++++ foo-html.lsp | 3 +++ foo.menu | 2 ++ 7 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 bar-controller.lua create mode 100644 bar-html.lsp create mode 100644 bar.menu create mode 100644 foo-controller.lua create mode 100644 foo-html.lsp create mode 100644 foo.menu diff --git a/Makefile b/Makefile index da53404..89e8603 100644 --- a/Makefile +++ b/Makefile @@ -3,9 +3,15 @@ PACKAGE=acf-$(APP_NAME) VERSION=0.1 APP_DIST=\ - privdemo-controller.lua \ - privdemo-model.lua \ - privdemo-html.lsp \ + bar-controller.lua \ + bar-html.lsp \ + bar.menu \ + foo-controller.lua \ + foo-html.lsp \ + foo.menu \ + privdemo-controller.lua \ + privdemo-model.lua \ + privdemo-html.lsp \ privdemo.menu EXTRA_DIST=Makefile config.mk diff --git a/bar-controller.lua b/bar-controller.lua new file mode 100644 index 0000000..e0b9999 --- /dev/null +++ b/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/bar-html.lsp b/bar-html.lsp new file mode 100644 index 0000000..708e1ad --- /dev/null +++ b/bar-html.lsp @@ -0,0 +1,3 @@ + +

Action

+

This is a null controller for menu and authorization testing.

diff --git a/bar.menu b/bar.menu new file mode 100644 index 0000000..287641c --- /dev/null +++ b/bar.menu @@ -0,0 +1,3 @@ +# Prefix and controller are already known at this point +# Cat Group Tab Action +Test Bar_controller bar read diff --git a/foo-controller.lua b/foo-controller.lua new file mode 100644 index 0000000..f25cbaf --- /dev/null +++ b/foo-controller.lua @@ -0,0 +1,36 @@ +-- A standin controller for testing + +module (..., package.seeall) + +x = require ("session") + +-- 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 + + +mvc.on_load = 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/foo-html.lsp b/foo-html.lsp new file mode 100644 index 0000000..708e1ad --- /dev/null +++ b/foo-html.lsp @@ -0,0 +1,3 @@ + +

Action

+

This is a null controller for menu and authorization testing.

diff --git a/foo.menu b/foo.menu new file mode 100644 index 0000000..fd64636 --- /dev/null +++ b/foo.menu @@ -0,0 +1,2 @@ +#cat Group tab action +Test foo_controller foo read -- cgit v1.2.3