/**
  * Render Page Version
  * 
  * @param void
  * @return null
  */
 function version()
 {
     if (!instance_of($this->active_page, 'Page')) {
         $this->httpError(HTTP_ERR_NOT_FOUND, null, true, $this->request->isApiCall());
     }
     // if
     if (!$this->active_page->canView($this->logged_user)) {
         $this->httpError(HTTP_ERR_FORBIDDEN, null, true, $this->request->isApiCall());
     }
     // if
     $version = PageVersions::findByPage($this->active_page, $this->request->get('version'));
     if (!instance_of($version, 'PageVersion')) {
         $this->httpError(HTTP_ERR_NOT_FOUND, null, true, $this->request->isApiCall());
     }
     // if
     $this->addBreadcrumb($this->active_page->getName(), mobile_access_module_get_view_url($this->active_page));
     $this->addBreadcrumb(lang('Version #:version', array('version' => $version->getVersion())));
     $this->smarty->assign(array('page_back_url' => mobile_access_module_get_view_url($this->active_page), 'version' => $version));
 }
Пример #2
0
 /**
  * Return all page version objects
  *
  * @param void
  * @return array
  */
 function getVersions()
 {
     if ($this->versions === false) {
         $this->versions = PageVersions::findByPage($this);
         $this->versions_count = is_array($this->versions) ? count($this->versions) : 0;
     }
     // if
     return $this->versions;
 }