Monday, November 08, 2010 at 12:05 AM.

system.verbs.builtins.radio.userInterface.publishButton

on publishButton (f=nil, buttonlabel="Publish This Page", systemImagePath=nil) {
	<<Changes:
		<<11/16/01; 7:16:09 PM by JES
			<<Return the empty string.
		<<10/15/01; 1:38:11 AM by JES
			<<Return the empty string for static pages.
		<<10/12/01; 2:35:35 AM by JES
			<<Created.
	return ("");
	local (pta = html.getPageTableAddress ());
	if pta^.radioResponder.flStaticRendering { //return the empty string for static pages
		return ("")};
	if defined (pta^.radioResponder.getArgs) { //return the empty string for folder viewer pages
		if defined (pta^.radioResponder.getArgs.folderView) {
			if pta^.radioResponder.getArgs.folderView {
				return ("")}}};
	if f == nil { //get f from the page table
		if defined (pta^.radioResponder.fileBeingRendered) {
			f = pta^.radioResponder.fileBeingRendered}};
	local (pc = file.getPathChar ());
	local (systemFolderPath = user.radio.prefs.wwwFolder + radio.data.folderNames.wwwSystemSubfolderName + pc);
	if f beginsWith systemFolderPath { //return the empty string for pages in the system sub-folder
		return ("")};
	local (htmltext = "\r", indentlevel = 0);
	on add (s) {
		htmltext = htmltext + string.filledstring ("\t", indentlevel) + s + "\r\n"};
	local (action = "");
	bundle { //build action, adding searchArgs so that the reloaded page is still the same
		if defined (pta^.searchArgs) {
			action = "?" + pta^.searchArgs}};
	add ("<form method=\"POST\" action=\"" + action + "\">"); indentlevel++;
	add ("<input name=\"command\" type=\"hidden\" value=\"publish\">");
	if f != nil {
		add ("<input name=\"f\" type=\"hidden\" value=\"" + string.urlencode (f) + "\">")};
	if systemImagePath == nil { //use a standard button
		add ("<input type=\"submit\" value=\"" + buttonlabel + "\">")}
	else { //use an image for the button
		local (flSameMachine = pta^.radioResponder.flSameMachine);
		local (imgUrl = string.nthField (radio.images.systemImageRef (systemImagePath, flFileUrl:flSameMachine), "\"", 2));
		add ("<input type=\"image\" value=\"submit\" src=\"" + imgUrl + "\">")};
	add ("</form>"); indentlevel--;
	return (htmltext)}



This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.