/** * Construct page versions controller * * @param Request $request * @return PageVersionsController */ function __construct($request) { parent::__construct($request); if ($this->active_page->isNew()) { $this->httpError(HTTP_ERR_NOT_FOUND); } // if $version = $this->request->getId('version'); if ($version) { $this->active_page_version = PageVersions::findById(array('page_id' => $this->active_page->getId(), 'version' => $version)); } // if if (!instance_of($this->active_page_version, 'PageVersion')) { $this->httpError(HTTP_ERR_NOT_FOUND); } // if $this->smarty->assign(array('active_page_version' => $this->active_page_version)); }