postUrl = 'http://localhost/dewd.php'; $dewd->fileId = '1'; $dewd->fileName = 'dewd-test.htm'; $dewd->fileExtension = 'htm'; $dewd->authCode = md5('none'); $fileContent = << DEWD FILE

DEWD Page

Content

END; $dewd->sendToDewdClient($fileContent); /** * DEWD Handler for PHP * * @author Tony Landis * @copyright 2007 Tony Landis * @link http://www.tonylandis.com * @license BSD License (http://www.opensource.org/licenses/bsd-license.php) * */ class DEWDHandler{ /** * URL to POST the edited file content to * * @var string */ var $postUrl; /** * File ID for identification in the response POST * * @var string */ var $fileId; /** * Name of file to be saved by the DEWD Client * * @var string */ var $fileName; /** * The file extensions (determines the application to be launched by DEWD Client) * * @var unknown_type */ var $fileExtension; /** * Authorization Code for reponse POST (if required by the service the edited file is posted to) * * @var string */ var $authCode; /** * Name of the field containing the Authorization Code in the POST * * @var string */ var $authField='authcode'; /** * Name of the field containing the File ID in the POST * * @var string */ var $fileIdField='fileid'; /** * Name of the field containing the edited file content in the POST * * @var string */ var $contentField='content'; /** * Name of the class to handle this file in the DWED Client * * @var string */ var $classHandler='DefaultHandler'; /** * Sends the file content to the DEWD Client * * @param string $fileContent */ function sendToDewdClient($fileContent) { header("DEWD_CLASS: $this->classHandler"); header("DEWD_URL: $this->postUrl"); header("DEWD_AUTH_CODE: $this->authCode"); header("DEWD_AUTH_FIELD: $this->authField"); header("DEWD_FILE_ID: $this->fileId"); header("DEWD_FILE_ID_FIELD: $this->fileIdField"); header("DEWD_FILE_NAME: $this->fileName"); header("DEWD_CONTENT_FIELD: $this->contentField"); header("DEWD_FILE_EXT: $this->fileExtension"); echo $fileContent; } } ?>