Beispiel #1
0
 /**
  * Returns the array representation of a fallback page
  * @param   \Cx\Core\ContentManager\Model\Entity\Node $node Node to get the page of
  * @param   string  $lang  Language code to get the fallback of
  * @return  array   Array  representing a fallback page
  */
 private function getFallbackPageArray($node, $lang)
 {
     $page = null;
     foreach ($node->getPages() as $page) {
         if ($page->getLang() == \FWLanguage::getLanguageIdByCode($this->fallbacks[$lang])) {
             break;
         }
     }
     if (!$page) {
         throw new \Cx\Core\ContentManager\Model\Entity\NodeException('Node (id ' . $node->getId() . ') has no pages.');
     }
     // 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));
     $pageArray = array('id' => 0, 'lang' => $lang, 'node' => $node->getId(), 'type' => $this->fallbacks[$lang] ? 'fallback' : 'content', 'name' => $page->getTitle(), 'title' => $page->getContentTitle(), 'metatitle' => $page->getMetatitle(), 'metadesc' => $page->getMetadesc(), 'metakeys' => $page->getMetakeys(), 'metarobots' => $page->getMetarobots(), 'frontend_protection' => $page->isFrontendProtected(), 'backend_protection' => $page->isBackendProtected(), 'accessData' => $accessData, 'slug' => $page->getSlug(), 'sourceMode' => false, 'sourceMode' => $page->getSourceMode());
     return $pageArray;
 }
 public function getPages($inactive_langs = false, $aliases = false)
 {
     $this->_load();
     return parent::getPages($inactive_langs, $aliases);
 }