diff options
Diffstat (limited to 'interfaces-create-html.lsp')
-rw-r--r-- | interfaces-create-html.lsp | 49 |
1 files changed, 14 insertions, 35 deletions
diff --git a/interfaces-create-html.lsp b/interfaces-create-html.lsp index 169cc76..5ce1d0f 100644 --- a/interfaces-create-html.lsp +++ b/interfaces-create-html.lsp @@ -1,37 +1,16 @@ <? local form = ... - require ("html") ?> -<h1>Create Interface</h1> +require("viewfunctions") +?> +<? +--[[ DEBUG INFORMATION +io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>") +io.write(html.cfe_unpack(form)) +io.write("</span>") +--]] +?> -<form action="<?= form.option.script .. "/" .. form.option.prefix .. - form.option.controller .. "/" .. form.option.action .. - form.option.extra ?>" method="POST"> -<table> - -<? local myform = form.value - --- We redefine the list of tags from the model (iface_tags) because --- the VIEW can choose the order to display the data. The Controller --- does not care what order the data is presented. - --- In this case, we don do show "name" -local tags = { "name", "comment", "method", "address", "netmask", "gateway", - "hostname", "provider", "pre-up", "up", "down", "post-down", "cmd" } - -for i,v in pairs(tags) do - local val = myform[v] ?> -<dt><? if (val.label) then io.write(val.label) else io.write (v) end ?></dt> - <? if val.name == "" then - val.name = v - end - - if val.type == "longtext" then - val.cols = 60 - val.rows = 3 - end - - ?> - <dd><?= html.form[val.type](val) ?></dd> -</td></tr> -<? end ?> -</table> -</form> +<h1><?= form.label ?></h1> +<? + local order = {"name", "comment", "auto", "family", "method", "pre-up", "up", "down", "post-down"} + displayform(form, order) +?> |