当前位置: 首页>>代码示例>>PHP>>正文


PHP eZContentObjectTreeNode::currentLanguage方法代码示例

本文整理汇总了PHP中eZContentObjectTreeNode::currentLanguage方法的典型用法代码示例。如果您正苦于以下问题:PHP eZContentObjectTreeNode::currentLanguage方法的具体用法?PHP eZContentObjectTreeNode::currentLanguage怎么用?PHP eZContentObjectTreeNode::currentLanguage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eZContentObjectTreeNode的用法示例。


在下文中一共展示了eZContentObjectTreeNode::currentLanguage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getSocialInfos

    /**
     * @return array
     */
    public function getSocialInfos()
    {
        if( !($this->node instanceof eZContentObjectTreeNode)
            || $this->node->attribute('class_identifier') != 'article' )
            return array();

        /* @type eZContentObjectAttribute[] $dataMap */
        $dataMap     = $this->node->dataMap();
        $headline    = $dataMap["headline"]->content();
        $urlParams   = array();
        $description = "";
        $imageUrl    = "";
        $urlGet      = "";

        if ( ClusterTool::isTwoLangCluster() )
        {
            $urlParams['ll'] = SystemLocale::fetchByClusterAndSystem( ClusterTool::clusterIdentifier(), 'exact_target' );
        }

        if($dataMap["promo_description"]->hasContent())
        {
            $description = strip_tags($dataMap["promo_description"]->content());
        }

        if ( count($urlParams) > 0 )
        {
            $urlGet = '?' . http_build_query($urlParams);
        }

        if ( NodeOperatorHelper::hasImageArticle($this->node, ImageArticleTool::SLIDE_APPLICATION_CASE ) )
        {
            $imageUrl = SolrSafeOperatorHelper::getImageArticleUrl(
                ImageArticleTool::SLIDE_APPLICATION_CASE,
                $this->node->attribute('contentobject_id'),
                $this->node->currentLanguage(),
                'dt_full'
            );
            $imageUrl .= $urlGet;
        }

        return array(
            "title"       => $headline,
            "description" => $description,
            "url"         => $this->applicationName()."/".$this->node->remoteID().$urlGet,
            "imageUrl"    => $imageUrl
        );
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:50,代码来源:applicationDefault.php

示例2: getPublisherNodeIdFromArticleNode

    /**
     * 
     * @param eZContentObjectTreeNode $childNode
     * @return integer
     */
    public static function getPublisherNodeIdFromArticleNode ( $childNode )
    {
        if ( !( $childNode instanceof eZContentObjectTreeNode ) )
            return false;

        $mainNode = $childNode;

        if ( !$mainNode->isMain() )
            $mainNode = eZContentObjectTreeNode::fetch( $childNode->attribute('main_node_id'), $childNode->currentLanguage() );

        $pathString      = $mainNode->attribute('path_string');
        $match           = array();

        if ( !preg_match('#^/1/2/\d+/(\d+)/.*$#', $pathString, $match) )
            return null;

        return (int)$match[1];
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:23,代码来源:publisherFolderTool.php

示例3: generateNodeViewData

 /**
  * Generate result data for a node view
  *
  * @param eZTemplate $tpl
  * @param eZContentObjectTreeNode $node
  * @param eZContentObject $object
  * @param bool|string $languageCode
  * @param string $viewMode
  * @param int $offset
  * @param array $viewParameters
  * @param bool|array $collectionAttributes
  * @param bool $validation
  * @return array Result array for view
  */
 static function generateNodeViewData(eZTemplate $tpl, eZContentObjectTreeNode $node, eZContentObject $object, $languageCode, $viewMode, $offset, array $viewParameters = array('offset' => 0, 'year' => false, 'month' => false, 'day' => false), $collectionAttributes = false, $validation = false)
 {
     $section = eZSection::fetch($object->attribute('section_id'));
     if ($section) {
         $navigationPartIdentifier = $section->attribute('navigation_part_identifier');
         $sectionIdentifier = $section->attribute('identifier');
     } else {
         $navigationPartIdentifier = null;
         $sectionIdentifier = null;
     }
     $keyArray = array(array('object', $object->attribute('id')), array('node', $node->attribute('node_id')), array('parent_node', $node->attribute('parent_node_id')), array('class', $object->attribute('contentclass_id')), array('class_identifier', $node->attribute('class_identifier')), array('view_offset', $offset), array('viewmode', $viewMode), array('remote_id', $object->attribute('remote_id')), array('node_remote_id', $node->attribute('remote_id')), array('navigation_part_identifier', $navigationPartIdentifier), array('depth', $node->attribute('depth')), array('url_alias', $node->attribute('url_alias')), array('class_group', $object->attribute('match_ingroup_id_list')), array('state', $object->attribute('state_id_array')), array('state_identifier', $object->attribute('state_identifier_array')), array('section', $object->attribute('section_id')), array('section_identifier', $sectionIdentifier));
     $parentClassID = false;
     $parentClassIdentifier = false;
     $parentNodeRemoteID = false;
     $parentObjectRemoteID = false;
     $parentNode = $node->attribute('parent');
     if (is_object($parentNode)) {
         $parentNodeRemoteID = $parentNode->attribute('remote_id');
         $keyArray[] = array('parent_node_remote_id', $parentNodeRemoteID);
         $parentObject = $parentNode->attribute('object');
         if (is_object($parentObject)) {
             $parentObjectRemoteID = $parentObject->attribute('remote_id');
             $keyArray[] = array('parent_object_remote_id', $parentObjectRemoteID);
             $parentClass = $parentObject->contentClass();
             if (is_object($parentClass)) {
                 $parentClassID = $parentClass->attribute('id');
                 $parentClassIdentifier = $parentClass->attribute('identifier');
                 $keyArray[] = array('parent_class', $parentClassID);
                 $keyArray[] = array('parent_class_identifier', $parentClassIdentifier);
             }
         }
     }
     $res = eZTemplateDesignResource::instance();
     $res->setKeys($keyArray);
     if ($languageCode) {
         $oldLanguageCode = $node->currentLanguage();
         $node->setCurrentLanguage($languageCode);
     }
     $tpl->setVariable('node', $node);
     $tpl->setVariable('viewmode', $viewMode);
     $tpl->setVariable('language_code', $languageCode);
     if (isset($viewParameters['_custom'])) {
         foreach ($viewParameters['_custom'] as $customVarName => $customValue) {
             $tpl->setVariable($customVarName, $customValue);
         }
         unset($viewParameters['_custom']);
     }
     $tpl->setVariable('view_parameters', $viewParameters);
     $tpl->setVariable('collection_attributes', $collectionAttributes);
     $tpl->setVariable('validation', $validation);
     $tpl->setVariable('persistent_variable', false);
     $parents = $node->attribute('path');
     $path = array();
     $titlePath = array();
     foreach ($parents as $parent) {
         $path[] = array('text' => $parent->attribute('name'), 'url' => '/content/view/full/' . $parent->attribute('node_id'), 'url_alias' => $parent->attribute('url_alias'), 'node_id' => $parent->attribute('node_id'));
     }
     $titlePath = $path;
     $path[] = array('text' => $object->attribute('name'), 'url' => false, 'url_alias' => false, 'node_id' => $node->attribute('node_id'));
     $titlePath[] = array('text' => $object->attribute('name'), 'url' => false, 'url_alias' => false);
     $tpl->setVariable('node_path', $path);
     $event = ezpEvent::getInstance();
     $event->notify('content/pre_rendering', array($node, $tpl, $viewMode));
     $Result = array();
     $Result['content'] = $tpl->fetch('design:node/view/' . $viewMode . '.tpl');
     $Result['view_parameters'] = $viewParameters;
     $Result['path'] = $path;
     $Result['title_path'] = $titlePath;
     $Result['section_id'] = $object->attribute('section_id');
     $Result['node_id'] = $node->attribute('node_id');
     $Result['navigation_part'] = $navigationPartIdentifier;
     $contentInfoArray = array();
     $contentInfoArray['object_id'] = $object->attribute('id');
     $contentInfoArray['node_id'] = $node->attribute('node_id');
     $contentInfoArray['parent_node_id'] = $node->attribute('parent_node_id');
     $contentInfoArray['class_id'] = $object->attribute('contentclass_id');
     $contentInfoArray['class_identifier'] = $node->attribute('class_identifier');
     $contentInfoArray['remote_id'] = $object->attribute('remote_id');
     $contentInfoArray['node_remote_id'] = $node->attribute('remote_id');
     $contentInfoArray['offset'] = $offset;
     $contentInfoArray['viewmode'] = $viewMode;
     $contentInfoArray['navigation_part_identifier'] = $navigationPartIdentifier;
     $contentInfoArray['node_depth'] = $node->attribute('depth');
     $contentInfoArray['url_alias'] = $node->attribute('url_alias');
     $contentInfoArray['current_language'] = $object->attribute('current_language');
     $contentInfoArray['language_mask'] = $object->attribute('language_mask');
//.........这里部分代码省略.........
开发者ID:CG77,项目名称:ezpublish-legacy,代码行数:101,代码来源:eznodeviewfunctions.php

示例4: getCurrentNodeLanguage

 /**
  * @param eZContentObjectTreeNode $node
  * @return string
  */
 public static function getCurrentNodeLanguage ($node)
 {
     if ( $node instanceof eZContentObjectTreeNode )
         return $node->currentLanguage();
     else
         return false;
 }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:11,代码来源:nodeoperatorhelper.php


注:本文中的eZContentObjectTreeNode::currentLanguage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。