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


PHP eZContentObjectTreeNode::setContentObject方法代码示例

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


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

示例1: makeObjectsArray

 public static function makeObjectsArray($array, $with_contentobject = true, array $propertiesOverride = null)
 {
     $retNodes = array();
     if (!is_array($array)) {
         return $retNodes;
     }
     foreach ($array as $node) {
         if ($propertiesOverride !== null) {
             $node = $propertiesOverride + $node;
         }
         if ($node['node_id'] == 1 && (!array_key_exists('name', $node) || !$node['name'])) {
             $node['name'] = ezpI18n::tr('kernel/content', 'Top Level Nodes');
         }
         $object = new eZContentObjectTreeNode(array("node_id" => $node["node_id"], "parent_node_id" => $node["parent_node_id"], "main_node_id" => $node["main_node_id"], "contentobject_id" => isset($node["id"]) ? $node["id"] : $node["contentobject_id"], "contentobject_version" => $node["contentobject_version"], "contentobject_is_published" => $node["contentobject_is_published"], "depth" => $node["depth"], "sort_field" => $node["sort_field"], "sort_order" => $node["sort_order"], "priority" => $node["priority"], "modified_subnode" => $node["modified_subnode"], "path_string" => $node["path_string"], "path_identification_string" => $node["path_identification_string"], "remote_id" => $node["remote_id"], "is_hidden" => $node["is_hidden"], "is_invisible" => $node["is_invisible"]));
         // If the name is not set it will be fetched later on when
         // getName()/attribute( 'name' ) is accessed.
         if (isset($node['name'])) {
             $object->setName($node['name']);
         }
         if (isset($node['class_serialized_name_list'])) {
             $node['class_name'] = eZContentClass::nameFromSerializedString($node['class_serialized_name_list']);
             $object->ClassName = $node['class_name'];
         }
         if (isset($node['class_identifier'])) {
             $object->ClassIdentifier = $node['class_identifier'];
         }
         if (isset($node['is_container'])) {
             $object->ClassIsContainer = $node['is_container'];
         }
         if ($with_contentobject) {
             if (isset($node['class_name'])) {
                 $row = array("id" => $node["id"], "section_id" => $node["section_id"], "owner_id" => $node["owner_id"], "contentclass_id" => $node["contentclass_id"], "name" => $node["name"], "published" => $node["published"], "modified" => $node["modified"], "current_version" => $node["current_version"], "status" => $node["status"], "remote_id" => $node["object_remote_id"], "language_mask" => $node["language_mask"], "initial_language_id" => $node["initial_language_id"], "class_name" => $node["class_name"]);
                 if (isset($node['class_identifier'])) {
                     $row['class_identifier'] = $node['class_identifier'];
                 }
                 $contentObject = new eZContentObject($row);
             } else {
                 $contentObject = new eZContentObject(array());
                 if (isset($node['name'])) {
                     $contentObject->setCachedName($node['name']);
                 }
             }
             if (isset($node['real_translation']) && $node['real_translation'] != '') {
                 $object->CurrentLanguage = $node['real_translation'];
                 $contentObject->CurrentLanguage = $node['real_translation'];
             }
             if ($node['node_id'] == 1) {
                 $contentObject->ClassName = 'Folder';
                 $contentObject->ClassIdentifier = 'folder';
                 $contentObject->ClassID = 1;
                 $contentObject->SectionID = 1;
             }
             $object->setContentObject($contentObject);
         }
         $retNodes[] = $object;
     }
     return $retNodes;
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:58,代码来源:ezcontentobjecttreenode.php

示例2: eZContentObjectTreeNode

    $requestedURIString = $node->attribute('url_alias');
}
$node = new eZContentObjectTreeNode();
$node->setAttribute('contentobject_version', $EditVersion);
$node->setAttribute('path_identification_string', $pathIdentificationString);
$node->setAttribute('contentobject_id', $ObjectID);
$node->setAttribute('parent_node_id', $parentNodeID);
$node->setAttribute('main_node_id', $virtualNodeID);
$node->setAttribute('path_string', $pathString);
$node->setAttribute('depth', $depth);
$node->setAttribute('node_id', $virtualNodeID);
$node->setAttribute('sort_field', $class->attribute('sort_field'));
$node->setAttribute('sort_order', $class->attribute('sort_order'));
$node->setAttribute('remote_id', eZRemoteIdUtility::generate('node'));
$node->setName($objectName);
$node->setContentObject($contentObject);
if ($Params['SiteAccess']) {
    $siteAccess = htmlspecialchars($Params['SiteAccess']);
} else {
    include 'kernel/content/versionviewframe.php';
    return;
}
if (!$siteAccess) {
    $contentINI = eZINI::instance('content.ini');
    if ($contentINI->hasVariable('VersionView', 'DefaultPreviewDesign')) {
        $siteAccess = $contentINI->variable('VersionView', 'DefaultPreviewDesign');
    } else {
        $siteAccess = eZTemplateDesignResource::designSetting('site');
    }
}
$access = $GLOBALS['eZCurrentAccess'];
开发者ID:schwabokaner,项目名称:ezpublish-legacy,代码行数:31,代码来源:versionview.php

示例3: makeObjectsArray

 static function makeObjectsArray($array, $with_contentobject = true)
 {
     $retNodes = array();
     if (!is_array($array)) {
         return $retNodes;
     }
     foreach ($array as $node) {
         unset($object);
         if ($node['node_id'] == 1) {
             if (!array_key_exists('name', $node) || !$node['name']) {
                 $node['name'] = ezpI18n::tr('kernel/content', 'Top Level Nodes');
             }
         }
         $object = new eZContentObjectTreeNode($node);
         // If the name is not set it will be fetched later on when
         // getName()/attribute( 'name' ) is accessed.
         if (isset($node['name'])) {
             $object->setName($node['name']);
         }
         if (isset($node['class_serialized_name_list'])) {
             $node['class_name'] = eZContentClass::nameFromSerializedString($node['class_serialized_name_list']);
             $object->ClassName = $node['class_name'];
         }
         if (isset($node['class_identifier'])) {
             $object->ClassIdentifier = $node['class_identifier'];
         }
         if (isset($node['is_container'])) {
             $object->ClassIsContainer = $node['is_container'];
         }
         if ($with_contentobject) {
             if (isset($node['class_name'])) {
                 unset($node['remote_id']);
                 $contentObject = new eZContentObject($node);
                 $permissions = array();
                 $contentObject->setPermissions($permissions);
                 $contentObject->setClassName($node['class_name']);
                 if (isset($node['class_identifier'])) {
                     $contentObject->ClassIdentifier = $node['class_identifier'];
                 }
             } else {
                 $contentObject = new eZContentObject(array());
                 if (isset($node['name'])) {
                     $contentObject->setCachedName($node['name']);
                 }
             }
             if (isset($node['real_translation']) && $node['real_translation'] != '') {
                 $object->CurrentLanguage = $node['real_translation'];
                 $contentObject->CurrentLanguage = $node['real_translation'];
             }
             if ($node['node_id'] == 1) {
                 $contentObject->ClassName = 'Folder';
                 $contentObject->ClassIdentifier = 'folder';
                 $contentObject->ClassID = 1;
                 $contentObject->SectionID = 1;
             }
             $object->setContentObject($contentObject);
         }
         $retNodes[] = $object;
     }
     return $retNodes;
 }
开发者ID:radca,项目名称:ezpublish,代码行数:61,代码来源:ezcontentobjecttreenode.php

示例4: customObjectAttributeHTTPAction

 function customObjectAttributeHTTPAction($http, $action, $contentObjectAttribute, $parameters)
 {
     switch ($action) {
         case "send_preview":
             $module = $parameters['module'];
             var_dump($module->obj);
             //viewData() );
             var_dump($obj);
             /*
                       $classAttribute = $contentObjectAttribute->contentClassAttribute();
                       var_dump($http);
                       var_dump($action);
                       var_dump($contentObjectAttribute);
                       var_dump
                       //$classAttribute = $contentObjectAttribute->contentClassAttribute();
                       //$module = $classAttribute->currentModule();
                       $module = $parameters['module'];
                       //var_dump($module);
                       
                       //var_dump($parameters);
                       $ObjectVersion = 26;
                       $ObjectID = 99;
                       $contentObject = ezContentObjectVersion::fetchVersion(  $ObjectVersion ,$ObjectID);
                       
                       $tpl =& templateInit();
                       $tpl->setVariable('object', $contentObject);
                       //$tpl->setVariable('newsletter', $newsletter);
                       $tpl->fetch( 'design:eznewsletter/newsletter_preview.tpl' );
             */
             /*
                     $cacheFileArray = array( 'cache_dir' => false, 'cache_path' => false );
                     $NodeID = 101;
                     
             //$Module = $Params['Module'];
             $tpl = templateInit();
             $LanguageCode = $Params['Language'];
             $ViewMode = "full";
             $Offset = $Params['Offset'];
             //$ini = eZINI::instance();
             $Year = $Params['Year'];
             $Month = $Params['Month'];
             $Day = $Params['Day'];
             $viewParameters = array( 'offset' => $Offset,
                                            'year' => $Year,
                                            'month' => $Month,
                                            'day' => $Day,
                                            'namefilter' => false );
             $viewParameters = array_merge( $viewParameters, $UserParameters );
             $collectionAttributes = false;
                   if ( isset( $Params['CollectionAttributes'] ) )
                     $collectionAttributes = $Params['CollectionAttributes'];
                   
                   $validation = array( 'processed' => false, 'attributes' => array() );
             
                   if ( isset( $Params['AttributeValidation'] ) )
                     $validation = $Params['AttributeValidation'];
                     
                   $localVars = array( "cacheFileArray", "NodeID",  "Module", "tpl",
                                           "LanguageCode",  "ViewMode", "Offset", "ini",
                                           "cacheFileArray", "viewParameters", "collectionAttributes",
                                           "validation" );
             
             
              
             
                     $args = compact( $localVars );
             
                     // the false parameter will disable generation of the 'binarydata' entry
                     $data = eZNodeviewfunctions::contentViewGenerate( false, $args ); 
             */
             $tpl = templateInit();
             $EditVersion = 26;
             $pathIdentificationString = "";
             $ObjectID = 99;
             $parentNodeID = 2;
             $virtualNodeID = null;
             $pathString = "";
             $depth = 2;
             $objectName = "OMG";
             $node = new eZContentObjectTreeNode();
             $node->setAttribute('contentobject_version', $EditVersion);
             $node->setAttribute('path_identification_string', $pathIdentificationString);
             $node->setAttribute('contentobject_id', $ObjectID);
             $node->setAttribute('parent_node_id', $parentNodeID);
             $node->setAttribute('main_node_id', $virtualNodeID);
             $node->setAttribute('path_string', $pathString);
             $node->setAttribute('depth', $depth);
             $node->setAttribute('node_id', $virtualNodeID);
             //$node->setAttribute( 'sort_field', $class->attribute( 'sort_field' ) );
             //$node->setAttribute( 'sort_order', $class->attribute( 'sort_order' ) );
             $node->setName($objectName);
             $node->setContentObject($contentObject);
             $contentObject = null;
             $LanguageCode = null;
             $viewParameters = array();
             $contentObject = eZContentObject::fetch($ObjectID);
             $Result = eZNodeviewfunctions::generateNodeViewData($tpl, $node, $contentObject, $LanguageCode, 'full', 0);
             var_dump($Result);
             //var_dump( $module->run("versionview") );
             $contentObjectAttribute->setValidationError(ezi18n('kernel/classes/datatypes', 'The email address is not valid.'));
//.........这里部分代码省略.........
开发者ID:jjohnsen,项目名称:jajnewsletter,代码行数:101,代码来源:jajpreviewnewslettertype.php


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