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

system.verbs.builtins.radio.theme.importThemeFile

on importThemeFile (f, adrTheme) {
	<<Changes
		<<12/30/01; 8:30:38 PM by JES
			<<Imports the Theme file at f, into the table specified by adrTheme.
			<<Cribbed from manilaSuite.themes.loadOneTheme.
	local (fname = file.fileFromPath (f));
	local (pageSource = fatPages.readSourceFile (f));
	local (atts);
	if not (fatPages.getPageAtts (@pageSource, @atts)) {
		scriptError ("Can't load theme from " + fname + " because the file does not contain an embedded object.")};
	local (objectType = 'tabl');
	if not (fatPages.getObjectType (@atts) == objectType) {
		scriptError ("Can't load theme from " + fname + " because the embedded object is not a table.")};
	local (data);
	data = fatPages.decode (@atts.pageData);
	delete (@atts.pageData); //we're done with it, free memory now
	setBinaryType (@data, objectType);
	unpack (@data, adrTheme); //unpack the data into a local
	delete (@data); //free memory
	
	return (true)}



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.