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

system.verbs.builtins.radio.macros.adminMenu

on adminMenu (color = "#FFFFFF") {
	<<Changes
		<<9/1/02; 5:23:44 PM by JES
			<<Localized the menu commands.
		<<4/7/02; 11:32:23 AM by DW
			<<Add Shortcuts command to menu.
		<<1/16/02; 12:00:37 AM by JES
			<<Added css class names to the <font> and <a href> tags in the Radio menu. This makes it easier to adjust the menu's appearance for a Theme, using a cascading style sheet.
			<<Class names are:
				<<radioMenuLink -- the class name for the <a href> tag for linked commands.
				<<radioMenuLinkFont -- the class name for the <font> tag that encloses linked commands.
				<<radioMenuLinkFontCurrent -- the class name for the <font> tag that encloses the command corresponding to the current page.
		<<12/31/01; 2:54:44 AM by JES
			<<Add a link for the Themes page.
		<<12/5/01; 4:14:17 PM by JES
			<<If this is the setupRadio page, return the empty string.
		<<12/1/01; 8:45:56 AM by DW
			<<Added News and Stories links.
		<<11/30/01; 7:10:38 PM by DW
			<<Added Events link
		<<11/24/01; 3:15:35 PM by DW
			<<Added Help link.
		<<11/7/01; 12:34:39 PM by DW
			<<Comment Stories command.
		<<11/1/01; 12:03:32 PM by DW
			<<Created.
	local (pta = html.getpagetableaddress (), size = -1);
	bundle { //find reasons not to render the menu
		if pta^.radioResponder.flStaticRendering { //static site
			return ("")};
		if user.radio.settings.flExpired { //expired trial
			return ("")};
		if string.lower (pta^.path) == string.lower (radio.data.systemUrls.setupRadio) { //setup page
			if not defined (user.radio.prefs.usernum) {
				return ("")}}};
	local (fontopen = "<font class=\"radioMenuLinkFont\" size=\"" + size + "\" color=\"" + color + "\">", fontclose = "</font>");
	local (uriWithSearchArgs = pta^.uri);
	if sizeof (pta^.searchargs) > 0 {
		uriWithSearchArgs =  uriWithSearchArgs + "?" + pta^.searchargs};
	local (htmltext = "");
	on add (s) {
		htmltext = htmltext +  s};
	on addCommand (linetext, url, fllastcommand = false) {
		try {linetext = radio.string.getLocalizedString ("adminMenu." + linetext)};
		local (flhot = true);
		if uriWithSearchArgs == url {
			flhot = false};
		if flhot {
			add ("<a class=\"radioMenuLink\" href=\"" + url + "\">" + fontopen + linetext + fontclose + "</a>")}
		else {
			add ("<b><font class=\"radioMenuLinkFontCurrent\">" + linetext + "</font></b>")};
		if not fllastcommand {
			add (fontopen + " <b>|</b> " + fontclose)}};
	add (fontopen + "<b>Radio " + frontier.version () + "</b>: " + fontclose);
	addCommand ("Home", radio.data.systemUrls.homePage);
	addCommand ("News", radio.data.systemUrls.newsAggregator);
	addCommand ("Stories", radio.data.systemUrls.storiesList);
	addCommand ("Shortcuts", radio.data.systemUrls.shortcuts);
	addCommand ("Folder", radio.data.systemUrls.folderView);
	addCommand ("Events", radio.data.systemUrls.eventsLog);
	addCommand ("Themes", radio.data.systemUrls.themesList);
	addCommand ("Tools", radio.data.systemUrls.toolsList);
	addCommand ("Prefs", radio.data.systemUrls.prefs);
	addCommand ("Help", radio.data.systemUrls.help, fllastcommand:true);
	bundle { //add help link
		add ("  " + radio.userinterface.helplink ("About the Radio menu"))};
	return (htmltext)}
<<bundle //test code
	<<html.setpagetableaddress (@scratchpad.params)
	<<adminmenu ()



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.