/** * @param string $applicationName Compatibility with other getNodeUrl operators * @param eZContentObjectTreeNode $node * @param boolean $languageCode * @return string */ public static function getMerckManualNodeUrl($applicationName, $node, $languageCode = false) { if( $languageCode ) $node->setCurrentLanguage($languageCode); /* @type $dataMap eZContentObjectAttribute[] */ $chapterNode = ( $node->attribute( 'depth' ) > 4 ) ? $node->fetchParent() : $node; $topicNode = ( $node->attribute( 'depth' ) > 4 ) ? $node : null; $linkType = is_null( $topicNode ) ? 'chapter' : 'topic'; $dataMap = $chapterNode->dataMap(); if ( !$dataMap || !isset($dataMap['serialized_taxonomies']) || !$dataMap['serialized_taxonomies']->hasContent() ) return ""; $serial = $dataMap['serialized_taxonomies']->content(); $sectionRemote = null; if( isset($serial['section']) && is_array($serial['section']) ) $sectionRemote = $serial['section'][0]; $fetchResult = MerckManualFunctionCollection::fetchUnifiedUrl($sectionRemote, $chapterNode, $topicNode, $linkType); return $fetchResult['result']; }
private function getArticleParent(eZContentObjectTreeNode $node) { $parent = $node->fetchParent(); if($parent->className() == "Article") { return $this->getArticleParent($parent); } return $node; }