<?php if(!defined('master_script')) die();

/**
 * Default data
 *
 * @category   Module (tag-cloud)
 * @author     Nico Wenig <nico.wenig@yellowgreen.de>
 * @version	   2009-12-07
 */
	
	$modules['tag-cloud']['version'] = '1.2';
	$modules['tag-cloud']['author'] = 'Nico Wenig';
	$modules['tag-cloud']['support'] = 'mailto:nico.wenig@yellowgreen.de';
	$modules['tag-cloud']['pagemap version'] = '0.5';
	$modules['tag-cloud']['for'] = 'all';
	$modules['tag-cloud']['key'] = 'tag-cloud';
	$modules['tag-cloud']['path'] = $system_data['folder']['modules'] . $modules['tag-cloud']['key'] . '/';
	$modules['tag-cloud']['languages'] = $system_data['folder']['modules'] . $modules['tag-cloud']['key'] . '/languages/';
	$modules['tag-cloud']['protected'] = 0;
	$modules['tag-cloud']['preview'] = 1;
	
	include_txt($modules['tag-cloud']['key'], $modules['tag-cloud']['languages']);

/**
 * Save module to page
 *
 * @category   Module (tag-cloud)
 * @author     Nico Wenig <nico.wenig@yellowgreen.de>
 * @version	   2009-06-06
 */

	if(isset($_POST['save_tag_cloud'])) {
		// Parse data
		$_POST['hide_tags'] = isset($_POST['hide_tags']) ? 1 : 0;
		$_POST['sort_ascending'] = isset($_POST['sort_ascending']) ? 1 : 0;

		// Create module section
		$module_content_to_save = '
			<!-- MODULE: tag-cloud -->
			
			<?php
				$module_settings["tag-cloud"] = array(
					"language" => "' . clean_string($_POST['language'], true) . '",
					"margin top" => ' . intval($_POST['margin_top']) . ',
					"margin left" => ' . intval($_POST['margin_left']) . ',
					"css class" => "' . clean_string($_POST['css_class'], true) . '",
					"css id" => "' . clean_string($_POST['css_id'], true) . '",
					
					"target page" => "' . $_POST['target_page'] . '",
					"hide tags" => ' . $_POST['hide_tags'] . ',
					"sort method" => "' . $_POST['sort_method'] . '",
					"sort ascending" => ' . $_POST['sort_ascending'] . ',
					"number of tags" => ' . intval($_POST['number_of_tags']) . '
				);

				' . connector('tag-cloud backend save') . '
				include_module("tag-cloud");
			?>
		';
	}

?>