public function getCMSFields() { $fields = parent::getCMSFields(); $fields->removeByName('DrupalNodeID'); $fields->removeByName('CreatedAt'); $fields->removeByName('UserID'); $fields->removeByName('Status'); $fields->removeByName('Language'); $fields->removeByName('Title'); $fields->removeByName('Body'); $fields->addFieldsToTab('Root.Node', array(new ReadonlyField('DrupalNodeID', 'Drupal Node ID', $this->DrupalNodeID), new ReadonlyField('Title', 'Title', $this->Title), new ReadonlyField('Body', 'Body', $this->Body), new ReadonlyField('CreatedAt', 'Created Date', $this->CreatedAt), new ReadonlyField('UserID', 'UserID', $this->UserID), new ReadonlyField('Status', 'Status', $this->Status), new ReadonlyField('Language', 'Language', $this->Language))); return $fields; }
/** * Gets all the node content items that sit under a parent ID. * * @param int $parent * @return DataObjectSet */ public function getItemsByParentId($parentID = null) { $result = new ArrayList(); if (!$this->isValid()) { return $result; } if ($parentID == null) { $items = $this->getMenu(); } else { $menuLink = $this->getMenuLink($this->parseID($parentID)); $items = $menuLink['children']; } if ($items) { foreach ($items as $item) { $result->push(DrupalMenuLinkContentItem::factory($this, $item)); } } // TODO: load children if path is a taxonomy node return $result; }
protected function createContentItem($item) { if (!isset($item['link'])) { return NULL; } $linkData = $item['link']; $menuLinkID = $linkData['mlid']; if (isset($linkData['path']) && strlen($linkData['path']) > 5 && substr($linkData['path'], 0, 5) == 'node/') { $nodeId = substr($linkData['path'], 5); $nodeData = $this->getNode($this->encodeId($nodeId)); return DrupalNodeContentItem::factory($this, array('link' => $linkData, 'node' => $nodeData)); } else { return DrupalMenuLinkContentItem::factory($this, array('link' => $linkData)); } }