Example #1
0
 /**
  * Creates the page array representation of a page
  * @param \Cx\Core\ContentManager\Model\Entity\Page $page Page to "arrayify"
  * @return Array Array representing a page
  */
 private function getPageArray($page)
 {
     // Scheduled Publishing
     $n = new \DateTime(null, $this->tz);
     if ($page->getStart() && $page->getEnd()) {
         $scheduled_publishing = true;
         $start = $page->getStart()->format('d.m.Y H:i');
         $end = $page->getEnd()->format('d.m.Y H:i');
     } else {
         $scheduled_publishing = false;
         $start = $n->format('d.m.Y H:i');
         $end = $n->format('d.m.Y H:i');
     }
     // Access Permissions
     $pg = \Env::get('pageguard');
     $accessData = array();
     $accessData['frontend'] = array('groups' => $pg->getGroups(true), 'assignedGroups' => $pg->getAssignedGroupIds($page, true));
     $accessData['backend'] = array('groups' => $pg->getGroups(false), 'assignedGroups' => $pg->getAssignedGroupIds($page, false));
     try {
         $parentPath = substr($page->getParent()->getPath(), 1) . '/';
     } catch (\Cx\Core\ContentManager\Model\Entity\PageException $e) {
         $parentPath = '';
     }
     $pageArray = array('id' => $page->getId(), 'lang' => \FWLanguage::getLanguageCodeById($page->getLang()), 'node' => $page->getNode()->getId(), 'name' => $page->getTitle(), 'title' => $page->getContentTitle(), 'type' => $page->getType(), 'target' => $page->getTarget(), 'target_path' => $this->getPathByTarget(array('get' => array('target' => $page->getTarget()))), 'module' => $page->getModule(), 'area' => $page->getCmd(), 'scheduled_publishing' => $scheduled_publishing, 'start' => $start, 'end' => $end, 'content' => preg_replace('/{([A-Z0-9_-]+)}/', '[[\\1]]', $page->getContent()), 'sourceMode' => $page->getSourceMode(), 'metatitle' => $page->getMetatitle(), 'metadesc' => $page->getMetadesc(), 'metakeys' => $page->getMetakeys(), 'metarobots' => $page->getMetarobots(), 'frontend_protection' => $page->isFrontendProtected(), 'backend_protection' => $page->isBackendProtected(), 'accessData' => $accessData, 'skin' => $page->getSkin(), 'useSkinForAllChannels' => $page->getUseSkinForAllChannels(), 'customContent' => $page->getCustomContent(), 'useCustomContentForAllChannels' => $page->getUseCustomContentForAllChannels(), 'applicationTemplate' => $page->getApplicationTemplate(), 'useCustomApplicationTemplateForAllChannels' => $page->getUseCustomApplicationTemplateForAllChannels(), 'cssName' => $page->getCssName(), 'cssNavName' => $page->getCssNavName(), 'caching' => $page->getCaching(), 'linkTarget' => $page->getLinkTarget(), 'slug' => $page->getSlug(), 'aliases' => $this->getAliasArray($page), 'editingStatus' => $page->getEditingStatus(), 'parentPath' => $parentPath, 'assignedBlocks' => $this->getBlocks($page), 'historyId' => $page->getVersion()->getVersion());
     return $pageArray;
 }
 public function getEnd()
 {
     $this->_load();
     return parent::getEnd();
 }