Source: site.view [edit]
Function name: editItemForm
Arguments: num
Description: Edit a single item
Page type: webl
Render function:  
Module: jw

Page source:

var fi = Wub_GetFunctionInfo("jw.publishedContent");

var content = WubEval(fi.exec);
num = ToInt(num);
var item = content[num];

var res = "<form>\n";

var chkHeading = "";
var chkSubHeading = "";
var chkArticle = "";

if (item.type == "heading") then
   chkHeading = "checked"
elsif (item.type == "subheading") then
   chkSubHeading = "checked"
elsif (item.type == "article") then
   chkArticle = "checked"
end;

var chkUpLeft= "";
var chkUpRight= "";
var chkLowLeft = "";
var chkLowRight = "";

if (item.pos== "ul") then
   chkUpLeft= "checked"
elsif (item.pos== "ur") then
   chkUpRight= "checked"
elsif (item.pos== "ll") then
   chkLowLeft = "checked"
elsif (item.pos== "lr") then
   chkLowRight = "checked"
end;

res = res + "<input name='cmdline' value='editItem(num, type, title, url, pos)' type='hidden'/>\n";
res = res + "<input name=num value='" + ToString(num) + "' type='hidden'/>\n";

res = res + "<input type='radio' name='type' value='heading' " + chkHeading + "/> Heading\n";
res = res + "<input type='radio' name='type' value='subheading' " + chkSubHeading + "/> Sub-Heading\n";
res = res + "<input type='radio' name='type' value='article' " + chkArticle + "/> Article\n<p>";

res = res + "Title: &nbsp; <input name=title size=120 value='" + (item.title ? "") + "'/><br>\n";
res = res + "URL: &nbsp; <input name=url size=120 value='" + (item.url ? "") + "'/><p>\n";

res = res + "<input type='radio' name='pos' value='ul' " + chkUpLeft + "/> Upper Left | \n";
res = res + "<input type='radio' name='pos' value='ur' " + chkUpRight + "/> Upper Right<br>\n";
res = res + "<input type='radio' name='pos' value='ll' " + chkLowLeft + "/> Lower Left | \n";
res = res + "<input type='radio' name='pos' value='lr' " + chkLowRight + "/> Lower Right<p>\n";

res = res + "<input type=submit value='Save'/><p>\n";
res = res + "</form>\n";

NewPiece(res, "text/html");