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

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

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

	if(isset($_POST['save_image'])) {
		// Parse data
		if(!isset($_POST['show_image'])) $_POST['show_image'] = '';
		$_POST['image_width'] = intval($_POST['image_width']) === '' ? 800 : intval($_POST['image_width']);
		$_POST['image_height'] = intval($_POST['image_height']) === '' ? 600 : intval($_POST['image_height']);
		$_POST['show_image_title'] = isset($_POST['show_image_title']) ? 1 : 0;
		$_POST['show_image_description'] = isset($_POST['show_image_description']) ? 1 : 0;
		
		// Create module section
		$module_content_to_save = '
			<!-- MODULE: image -->
			
			<?php
				$module_settings["image"] = 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) . '",

					"show image" => "' . clean_string($_POST['show_image'], true) . '",
					"image width" => ' . $_POST['image_width'] . ',
					"image height" => ' . $_POST['image_height'] . ',
					"show image title" => ' . $_POST['show_image_title'] . ',
					"show image description" => ' . $_POST['show_image_description'] . '
				);
					
				' . connector('image backend save') . '
				include_module("image");
			?>
		';
	}

?>