Monday, April 04, 2011 at 1:08 AM.

radio2Suite.viewMenu

on viewMenu () {
	<<Changes
		<<3/15/11; 2:04:44 PM by DW
			<<If it's the userWhoCanCreateNewAccounts show the New User command.
		<<3/13/11; 12:16:15 PM by DW
			<<Docs command points to the real howto. (URL might still change, but the menu command will keep working.)
		<<3/8/11; 11:13:56 AM by DW
			<<Feed, Bucket and URLs menu items fold into Prefs. Added link to Docs page.
		<<3/7/11; 9:15:57 AM by DW
			<<Add sign-out command.
		<<3/5/11; 9:52:36 AM by DW
			<<Add River command.
		<<3/3/11; 3:19:52 PM by DW
			<<Add a link to the Feed prefs page.
		<<3/3/11; 7:24:49 AM by DW
			<<Add link to Links page.
		<<2/23/11; 11:49:05 PM by DW
			<<Add link to Counts page.
		<<2/20/11; 11:22:28 AM by DW
			<<Add URLs item to menu.
		<<2/17/11; 10:33:36 AM by DW
			<<Add the Log command to the menu.
		<<1/13/11; 8:14:25 AM by DW
			<<Cribbed from river2suite.viewMenu.
	local (pta = html.getpagetableaddress (), adrdata = radio2suite.init (), flhascookie, username);
	local (pagename = nameof (pta^.adrobject^), htmltext = "", indentlevel = 0, paramstring = "");
	bundle { //set flhascookie
		flhascookie = opmlEditor.member.checkCookie ("", @username, false)};
	on add (s) {
		htmltext = htmltext + string.filledstring ("\t", indentlevel) + s + "\r"};
	on additem (title, thispagename, url=nil, fllast=false) {
		add ("");
		if pagename == thispagename {
			add ("<b>" + string.upper (title) + "</b>")}
		else {
			if url == nil {
				url = thispagename + paramstring};
			add ("<a href=\"" + url + "\">" + title + "</a>")};
		if not fllast {
			add ("|")}};
	if flhascookie {
		additem ("Home", "index");
		<<additem ("History", "history") //3/5/11 by DW
		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 ("Prefs", "prefs");
		additem ("Log", "log"); //2/17/11 by DW
		additem ("Docs", "http://r2.reallysimple.org/howto/radio2/"); //3/8/11 by DW
		bundle { //New User command, 3/15/11 by DW
			if string.lower (username) == string.lower (adrdata^.prefs.userWhoCanCreateNewAccounts) {
				additem ("New User", "newUser")}};
		additem ("River", "river"); //3/6/11 by DW
		additem ("Sign-out", "signout", fllast:true)} //3/7/11 by DW
		<<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 ("<div class=\"navMenu\"><b>" + radio2Info.name + " v" + radio2Info.version + "</b>: " + htmltext + "</div>")};
bundle { //test code
	webbrowser.displaytext (navigationMenu ())}



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.