Location: PHPKode > projects > JaxBlog > JaxBlog/module/JaxEditor/example.php
<?php

$request = isset($_GET['request']) ? $_GET['request'] : '';

if ($request == 'xml') {
	header('Content-Type: text/html');
	echo 'here\'s the preloaded <b>content</b>';
	exit;
}
if ($request == 'formresponse') {
	echo $_POST['example'];
	exit;
}
if ($request == 'filelist') {
	echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' . "\n";
	echo '<root>' . "\n";
	echo '	<record>' . "\n";
	echo '		<id>1</id>' . "\n";
	echo '		<parent_id>0</parent_id>' . "\n";
	echo '		<is_leaf>0</is_leaf>' . "\n";
	echo '		<title>example</title>' . "\n";
	echo '	</record>' . "\n";
	echo '	<record>' . "\n";
	echo '		<id>2</id>' . "\n";
	echo '		<parent_id>0</parent_id>' . "\n";
	echo '		<is_leaf>0</is_leaf>' . "\n";
	echo '		<title>image</title>' . "\n";
	echo '	</record>' . "\n";
	echo '	<record>' . "\n";
	echo '		<id>3</id>' . "\n";
	echo '		<parent_id>2</parent_id>' . "\n";
	echo '		<is_leaf>1</is_leaf>' . "\n";
	echo '		<title>align_centre.gif</title>' . "\n";
	echo '	</record>' . "\n";
	echo '</root>' . "\n";
	exit;
}

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>

<title>Cross-Browser Rich Text Editor</title>
<link type="text/css" rel="stylesheet" href="jax-editor.css">
<link type="text/css" rel="stylesheet" href="../JaxTree/jax-tree.css">
<script language="JavaScript" type="text/javascript" src="../common/jax-dialog.js"></script>
<script language="JavaScript" type="text/javascript" src="../common/jax-xmlhttprequest.js"></script>
<script language="JavaScript" type="text/javascript" src="../JaxTree/jax-tree.js"></script>
<script language="JavaScript" type="text/javascript" src="../JaxEditor/jax-editor.js"></script>

<script language="JavaScript" type="text/javascript">
	window.onload = function(event) { jaxEditorRegister('./', 'example'); };
</script>
<style type="text/css">
	#example {
	width: 500px;
	border: 1px solid #6BB5FF;
}
</style>

</head>
<body>

<!-- Any element can 'house' the text editor as long as it's id is passed in the jaxEditorRegister() call -->
<form action="example.php?request=formresponse" method="POST">
<div id="example"></div>
<div id="translate"></div>

<input type="submit" name="submit" value="Submit" />
</form>

</body>
</html>
Return current item: JaxBlog