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


PHP eZContentObjectTreeNode::subTreeMultiPaths方法代码示例

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


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

示例1: fetchNodeList

 static function fetchNodeList($rssSources, $objectListFilter)
 {
     // compose parameters for several subtrees
     if (is_array($rssSources) && count($rssSources)) {
         foreach ($rssSources as $rssSource) {
             // Do not include subnodes
             if (!intval($rssSource->Subnodes)) {
                 $depth = 1;
             } else {
                 $depth = 0;
             }
             $nodesParams[] = array('ParentNodeID' => $rssSource->SourceNodeID, 'ResultID' => $rssSource->ID, 'Depth' => $depth, 'DepthOperator' => 'eq', 'MainNodeOnly' => $objectListFilter['main_node_only'], 'ClassFilterType' => 'include', 'ClassFilterArray' => array(intval($rssSource->ClassID)));
         }
         $listParams = array('Limit' => $objectListFilter['number_of_objects'], 'SortBy' => array('published', false));
         $nodeList = eZContentObjectTreeNode::subTreeMultiPaths($nodesParams, $listParams);
     } else {
         $nodeList = null;
     }
     return $nodeList;
 }
开发者ID:nfrp,项目名称:ezpublish,代码行数:20,代码来源:ezrssexportitem.php

示例2: modify


//.........这里部分代码省略.........
                 //                    {
                 //                        $tpl->unsetVariable( $key, $rootNamespace );
                 //                    }
             }
             break;
             //@todo add cache!
         //@todo add cache!
         case 'include_cache':
             $tpl = eZTemplate::factory();
             foreach ($namedParameters['variables'] as $key => $value) {
                 $tpl->setVariable($key, $value);
             }
             $operatorValue = $tpl->fetch('design:' . $namedParameters['template']);
             break;
         case 'find_global_layout':
             $result = false;
             $node = $operatorValue;
             if (is_numeric($node)) {
                 $node = eZContentObjectTreeNode::fetch($node);
             }
             if (!$node) {
                 return $operatorValue = $result;
             }
             $pathArray = $node->attribute('path_array');
             $nodesParams = array();
             foreach ($pathArray as $pathNodeID) {
                 if ($pathNodeID < eZINI::instance('content.ini')->variable('NodeSettings', 'RootNode') || $pathNodeID == $node->attribute('node_id')) {
                     continue;
                 } else {
                     $nodesParams[] = array('ParentNodeID' => $pathNodeID, 'ResultID' => 'ezcontentobject_tree.node_id', 'ClassFilterType' => 'include', 'ClassFilterArray' => $ini->variable('GlobalLayout', 'Classes'), 'Depth' => 1, 'DepthOperator' => 'eq', 'AsObject' => false);
                 }
             }
             //eZDebug::writeWarning( var_export($nodesParams,1), __METHOD__);
             $findNodes = eZContentObjectTreeNode::subTreeMultiPaths($nodesParams, array('SortBy' => array('node_id', false)));
             $sortByParentNodeID = array();
             if (!empty($findNodes)) {
                 foreach ($findNodes as $findNode) {
                     $sortByParentNodeID[$findNode['parent_node_id']] = $findNode;
                 }
                 krsort($sortByParentNodeID);
                 $result = array_shift($sortByParentNodeID);
                 $result = eZContentObjectTreeNode::makeObjectsArray(array($result));
                 if (!empty($result)) {
                     $result = $result[0];
                 }
             }
             return $operatorValue = $result;
         case 'redirect':
             $url = $namedParameters['url'];
             header('Location: ' . $url);
             break;
         case 'sort_nodes':
             $sortNodes = array();
             if (!empty($operatorValue) && is_array($operatorValue)) {
                 $nodes = $operatorValue;
                 foreach ($nodes as $node) {
                     if (!$node instanceof eZContentObjectTreeNode) {
                         continue;
                     }
                     $object = $node->object();
                     switch ($namedParameters['by']) {
                         case 'published':
                         default:
                             $sortby = $object->attribute('published');
                             break;
                     }
开发者ID:OpencontentCoop,项目名称:ocoperatorscollection,代码行数:67,代码来源:ocoperatorscollection.php


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