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

on enclosureField (adrdata, adrpost, adrErrorString=nil) {
		<<12/10/01; 1:51:02 PM by JES
		<<10/19/01; 3:05:45 PM by JES
			<<Don't process enclosures for a post here. Process them in radio.macros.weblogPostForm.
		<<8/29/01; 1:02:13 AM by JES
			<<Render the weblog post enclosure field.
				<<adrdata -- the address of the weblog's top-level table.
				<<adrpost -- the address of the post the enclosure will be attached to.
				<<adrErrorString -- the address of a string variable in which to store an error, if it happens. If no errors happen, then the variable is not modified.
	local (pta = html.getPageTableAddress ());
	local (initialvalue = "http://");
	local (enclosure, flEnclosureError = false);
	<<if pta^.method == "POST"
		<<local (adrargs = @pta^.radioResponder.postArgs)
		<<if defined (adrargs^.enclosureUrl)
			<<if sizeof (adrargs^.enclosureUrl) > sizeof (initialvalue)
				<<new (tabletype, @enclosure)
				<<xml.aggregator.getEnclosureData (adrargs^.enclosureUrl, @enclosure)
				<<if defined (enclosure.error) //make sure they see the error
					<<flEnclosureError = true
					<<if adrErrorString != nil
						<<adrErrorString^ = enclosure.error
			<<if enclosure != nil
				<<adrpost^.enclosure = enclosure
	if adrpost != nil {
		if defined (adrpost^.enclosure) {
			initialvalue = adrpost^.enclosure.url}};
	return (radio.string.getLocalizedString ("weblogPostForm.enclosurePrompt") + " <input type=\"text\" name=\"enclosureUrl\" size=\"65\" maxlength=\"512\" value=\"" + initialvalue + "\">")}

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.