Sunday, April 10, 2011 at 1:05 AM.

beautSuite.viewMenu

on viewMenu () {
	<<Changes
		<<4/9/11; 4:58:46 PM by DW
			<<The product name at the beginning of the menu is Blork, not "beaut."
		<<4/5/11; 3:14:41 PM by DW
			<<Update the Docs command link to http://docs.blorker.com/. 
		<<3/20/11; 2:05:12 PM by DW
			<<Created. 
	local (pta = html.getpagetableaddress (), adrradiodata = radio2suite.init (), productName = beautSuite.data.strings.menuProductName);
	local (pagename = nameof (pta^.adrobject^), htmltext = "", indentlevel = 0, paramstring = "", editorIcon);
	scratchpad.viewmenuparams = pta^;
	bundle { //set flhascookie
		flhascookie = opmlEditor.member.checkCookie ("", @username, false)};
	on add (s) {
		htmltext = htmltext + string.filledstring ("\t", indentlevel) + s};
	on additem (title, thispagename, url=nil, fllast=false) {
		add ("");
		if pagename == thispagename {
			add ("<span  class=\"navMenuCurrentPage\">" + string.upper (title) + "</span>")}
		else {
			if url == nil {
				url = thispagename + paramstring};
			add ("<a href=\"" + url + "\"><span  class=\"navMenuLink\">" + title + "</span></a>")};
		if not fllast {
			add (" <span  class=\"navMenuSeparator\">|</span> ")}};
	if flhascookie {
		additem ("Home", "index");
		<<if pta^.beaut.flEditorInPage
			<<additem ("Edit", "javascript:toggle('tweetBox')") 
		additem ("Feeds", "feeds");
		additem ("Podcasts", "podcasts");
		additem ("Photos", "photos");
		additem ("Prefs", "prefs");
		<<additem ("Counts", "counts") //2/23/11 by DW
		additem ("Links", "links"); //3/3/11 by DW
		<<additem ("Bookmarklet", "bookmarklet")
		<<additem ("Feed", "prefs?page=1.3")
		<<additem ("Bucket", "prefs?page=1.1")
		<<additem ("URLs", "prefs?page=1.2")
		additem ("Log", "log"); //2/17/11 by DW
		additem ("Docs", "http://docs.blorker.com/"); //4/5/11 by DW
		<<additem ("River", "river") //3/6/11 by DW
		bundle { //New User command, 3/15/11 by DW
			if string.lower (username) == string.lower (adrradiodata^.prefs.userWhoCanCreateNewAccounts) {
				additem ("New User", "newUser")}};
		additem ("Sign-out", "signout", fllast:true); //3/7/11 by DW
		bundle { //set editorIcon
			if pta^.beaut.flEditorInPage {
				editorIcon = "<a href=\"javascript:toggle('tweetBox')\">" + string (beautSuite.data.html.blackDownArrow) + "</a>"}
			else {
				editorIcon = ""}}}
		<<add (" -- " + username) //experiment
	else {
		additem ("Sign-in", "signin", fllast:true)}; //3/7/11 by DW
	if htmltext endswith "|\r" { //3/16/10 by DW
		htmltext = string.delete (htmltext, sizeof (htmltext)-1, 2)};
	return ("<table cellspacing=\"0\" cellpadding=\"0\"><tr><td><a href=\"index\"><span  class=\"navMenuLabel\">" + productName + " v" + beautInfo.version + "</span></a>: " + htmltext + "</td><td>    " + editorIcon + "</td></tr></table>")};
	<<return ("<font size=\"-1\"><b><a href=\"index\">" + beautInfo.name + " v" + beautInfo.version + "</a></b>: " + htmltext + "</font><br>")
	<<return ("<div class=\"navMenu\"><b>" + beautInfo.name + " v" + beautInfo.version + "</b>: " + htmltext + "</div>")
bundle { //test code
	html.setpagetableaddress (@scratchpad.viewmenuparams);
	webbrowser.displaytext (viewMenu ())}



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.