Location: PHPKode > projects > DIY Blog > diy-blog/classes/diy-blog/backend/view/postEdit/EditPostView.class.php
<?php

/**
 * A view for editing a blog Post.
 * @package diy-blog.backend.view.postEdit
 * @author	Martynas Jusevicius <hide@address.com>
 * @link	http://www.xml.lt
 */

class EditPostView extends BackEndView
{
	
	public function __construct(Resource $resource = null)
	{
		parent::__construct($resource);

		$this->template->load(APP_VIEW_DIR."postEdit/EditPost.xsl");
	}

	public function display(Request $request, Response $response)
	{
		$pages = $this->resource->getPagesJoinFrontEndResource();
		$post = $pages[0];

		$this->proc->registerPhpFunctions();

		$this->proc->setParameter("", "current-date-time", date("Y-m-d")."T".date("H:i:s"));

		if ($request->getAttribute("post-result") != null)
		{
			$this->proc->setParameter("", "post-result", $request->getAttribute("post-result"));

			$this->resolver->setArgument("post-errors", XMLSerializer::serialize($request->getAttribute("post-errors")));
			$this->resolver->setArgument("post-form", XMLSerializer::serialize($request->getAttribute("post-form")));
		}
		$this->resolver->setArgument("post", XMLSerializer::serialize($post));

		parent::display($request, $response);
		$response->setStatus(Response::SC_OK);
	}

}

?>
Return current item: DIY Blog