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

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

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

	if(isset($_POST['save_include_page'])) {
		// Parse data
		if(!isset($_POST['page_to_include'])) $_POST['page_to_include'] = '';
		
		// Create module section
		$module_content_to_save = '
			<!-- MODULE: include-page -->
			
			<?php
				$module_settings["include-page"] = 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) . '",
					
					"page name" => "' . $_POST['page_to_include'] . '"
				);

				' . connector('include-page backend save') . '
				include_module("include-page");
			?>
		';
	}

?>