diff options
-rw-r--r-- | app/Makefile | 1 | ||||
-rw-r--r-- | app/expert-html.lsp | 2 | ||||
-rw-r--r-- | app/form-html.lsp | 9 | ||||
-rw-r--r-- | lib/controllerfunctions.lua | 2 |
4 files changed, 12 insertions, 2 deletions
diff --git a/app/Makefile b/app/Makefile index 32b1654..b840e75 100644 --- a/app/Makefile +++ b/app/Makefile @@ -32,6 +32,7 @@ APP_DIST= \ filedetails-html.lsp\ expert-html.lsp\ debug-html.lsp\ + form-html.lsp\ EXTRA_DIST=README Makefile DISTFILES=$(APP_DIST) $(EXTRA_DIST) diff --git a/app/expert-html.lsp b/app/expert-html.lsp index 3639f11..49fffd4 100644 --- a/app/expert-html.lsp +++ b/app/expert-html.lsp @@ -11,6 +11,6 @@ local func = haserl.loadfile(page_info.viewfile:gsub(pattern..".*$", "/") .. "fi func(form, viewlibrary, page_info, session) ?> -<? if viewlibrary and viewlibrary.dispatch_component then +<? if viewlibrary and viewlibrary.dispatch_component and session.permissions[page_info.controller].startstop then viewlibrary.dispatch_component("startstop") end ?> diff --git a/app/form-html.lsp b/app/form-html.lsp new file mode 100644 index 0000000..451123a --- /dev/null +++ b/app/form-html.lsp @@ -0,0 +1,9 @@ +<? local form, viewlibrary, page_info = ... +require("viewfunctions") +?> + +<H1><?= form.label ?></H1> +<? + form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action + displayform(form) +?> diff --git a/lib/controllerfunctions.lua b/lib/controllerfunctions.lua index 298eac6..ec62fee 100644 --- a/lib/controllerfunctions.lua +++ b/lib/controllerfunctions.lua @@ -21,7 +21,7 @@ function handle_form(self, getFunction, setFunction, clientdata, option, label, end end form = setFunction(form) - if not form.errtxt then + if not form.errtxt and descr then form.descr = descr end form = self:redirect_to_referrer(form) |