當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。