uploadresponse.class.php - AJAX Code Search ~ Ajax Training, Learn Ajax Video Tutorials Online, Ajax Examples
Ajax Training, Learn Ajax Video Tutorials Online, Ajax Examples: uploadresponse.class.php - AJAX Code Search

uploadresponse.class.php - AJAX Code Search

<?php

class UploadResponse {
var $jsClassName;
var $callBackParams;
var $content;

function UploadResponse() {
$this->jsClassName = null;
$this->callBackParams = array();
$this->content = null;
}

function setJsClassName($jsClassName) {
$this->jsClassName = $jsClassName;
}

function getJsClassName() {
return $this->jsClassName;
}

function setCallBackParams($callBackParams) {
$this->callBackParams = $callBackParams;
}

function getCallBackParams() {
return $this->callBackParams;
}

function addCallBackParam($param, $isString = false) {
if ($isString) {
$param = "'" . $param . "'";
}
$this->callBackParams[] = $param;
}

function setContent($content) {
$this->content = $content;
}

function getContent() {
return $this->content;
}

function doResponse() {

header('Content-Type: text/html; charset=UTF-8');

$params = '';

if ($this->callBackParams) {
$params = ', ' . implode(', ', $this->callBackParams);
}

echo '<html>
<head><title></title></head>
<body>
<pre id="__content_container">' . $this->content . '</pre>
<script language="javascript">
var parentFrame = parent.window;
if (parentFrame) {
var content = document.getElementById("__content_container");
parentFrame.' . $this->jsClassName . '.uploadCallBack(content.innerHTML' . $params . ');
}
</script>
</body>
</html>';

}

}

?>

Related Posts by Categories

0 comments:

Useful Links on Adobe Flex

Your Ad Here

Latest Books on Adobe Flex