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

/**
 * Default data
 *
 * @category   Module (image-set)
 * @author     Nico Wenig <nico.wenig@yellowgreen.de>
 * @version	   2010-06-15
 */
	
	$modules['image-set']['version'] = '1.0';
	$modules['image-set']['author'] = 'Nico Wenig';
	$modules['image-set']['support'] = 'mailto:nico.wenig@yellowgreen.de';
	$modules['image-set']['pagemap version'] = '0.5';
	$modules['image-set']['for'] = 'all';
	$modules['image-set']['key'] = 'image-set';
	$modules['image-set']['path'] = $system_data['folder']['modules'] . $modules['image-set']['key'] . '/';
	$modules['image-set']['languages'] = $system_data['folder']['modules'] . $modules['image-set']['key'] . '/languages/';
	$modules['image-set']['protected'] = 0;
	$modules['image-set']['preview'] = 0;
	
	include_txt($modules['image-set']['key'], $modules['image-set']['languages']);

/**
 * Save module to page
 *
 * @category   Module (image-set)
 * @author     Nico Wenig <nico.wenig@yellowgreen.de>
 * @version	   2010-06-15
 */

	if(isset($_POST['save_image_set'])) {
		// Parse data
		$_POST['image_fullscreen'] = isset($_POST['image_fullscreen']) ? 1 : 0;
		$_POST['image_properties'] = isset($_POST['image_properties']) ? 1 : 0;

		// Create module section
		$module_content_to_save = '
			<!-- MODULE: image-set -->
			
			<?php
				$module_settings["image-set"] = 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) . '",
					
					"images dir" => "' . $_POST['images_dir'] . '",
					"images sort order" => "' . $_POST['images_sort_order'] . '",
					"image width" => ' . intval($_POST['image_width']) . ',
					"image height" => ' . intval($_POST['image_height']) . ',
					"open image" => "' . $_POST['open_image'] . '",
					"image properties" => ' . $_POST['image_properties'] . ',
					"link attributes" => "' . clean_string($_POST['link_attributes'], true) . '"
				);

				' . connector('image-set backend save') . '
				include_module("image-set", false);
			?>
		';
	}

?>