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

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

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

		$this->template->load(APP_VIEW_DIR."pageEdit/EditPage.xsl");
	}

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

		$this->proc->registerPhpFunctions();

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

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

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

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

}

?>
Return current item: DIY Blog