<?php

// Récupération des variables get
$ReturnElemtId = $_GET['return_id'];
//$HTMLvalue = $_GET['value'];

// Chargement des scripts de TinyMCE
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="fr" >
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>TinyMCE Editor PopUp</title>
		<style type="text/css">
				body, form {
					margin:0;
					padding:0;
				}
				input[type=button] {
					border:1px solid #ccc;
					background-color: #F0F0EE;
					font-family:'MS Sans Serif',sans-serif,Verdana,Arial;
					font-size:9pt;
					margin-top:5px;
					font-weight:bold;
					height:20px;
				}
				form div {
					text-align:center;
				}
			</style>
			<!-- TinyMCE -->
			<script type="text/javascript" src="tiny_mce.js"></script>
			<script type="text/javascript" src="plugins/tinybrowser/tb_tinymce.js.php"></script>
			<script type="text/javascript">
			tinyMCE.init({
					// General options
					mode : "textareas",
					theme : "advanced",
					language : "fr",
					width : 800,
					height : 550,
					plugins : "safari,table,advimage,advlink,searchreplace,contextmenu,paste,save, iframe",
					file_browser_callback : "tinyBrowser",
					extended_valid_elements : "iframe[src|width|height|name|align|style|frameborder]",

					// Theme options
					theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect", //image, save
					theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,|,iframe,|,code",
					theme_advanced_buttons3 : "tablecontrols,|,sub,sup",
					theme_advanced_toolbar_location : "top",
					theme_advanced_toolbar_align : "left",
					theme_advanced_statusbar_location : "bottom",

					// Example content CSS (should be your site CSS)
					// content_css : "../../css/adminsite.css",

				});
				function save() {
					window.parent.update_cms_desc_content('<?php echo $ReturnElemtId ?>', tinyMCE.activeEditor.getContent());
					parent.jQuery.fancybox.close();
				}
			</script>
			<!-- /TinyMCE -->
	</head>
	<body>
		<form name=f action="" method="post">
			<div>
				<textarea id='html_page' name='html_page' cols="100" rows="25" wrap="VIRTUAL"><?php //echo $HTMLvalue; ?></textarea>
				<input type="button" value="Appliquer les changements" onClick="save()">
			</div>
		</form>
		<script type="text/javascript">document.getElementById('html_page').value = window.parent.document.getElementById('<?php echo $ReturnElemtId;?>').value</script>
	</body>
</html>