/**
 * import plugin for WebDDM; aids in not having to reproduce menu array code.
 *  
 * @version: 0.1
 * @started: 07/11/2005
 * @copyright: WebDDM code Copyright (c) 2005 JPortal, All Rights Reserved
 * @website: www.jportalhome.com
 * @license: GPL vs2.0
 * @subversion: $Id: import.WebDDM.js 126 2006-01-22 07:09:05Z josh $
 */
 
/**
 * Auto-URL plugin callback function, called when an item is clicked on
 */
function WebDDM_plugin_import (event_obj, WebDDM_obj, item_hash)
{
	// Does item_hash have an 'import' item?
	if (item_hash.has('import'))
	{
		// Get import hash
		var import_hash = item_hash.get('import');

		// Loop through import hash - each looped var will
		// be a hash itself that needs to be imported
		for (var i in import_hash.elementData)
		{
			for (var j in import_hash.get(i).elementData)
			{
				if (!item_hash.has(j))
				{
					item_hash.set(j, import_hash.get(i).get(j));
				}
			}
		}
	}
}

// Register import plugin callback functions
WebDDM_registerPlugin_action('item_init', WebDDM_plugin_import);

