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


PHP Node::getNodePartials方法代码示例

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


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

示例1: loadAudioTagsCms

 public function loadAudioTagsCms($nothing, $nothing, Node $node)
 {
     if ($node->getNodePartials()->getOutPartials() != "") {
         $tagDefs = $node->getNodeRef()->getElement()->Schema->getTagDefs();
         foreach ($tagDefs as $k => $tagDef) {
             if ($tagDef->Partial->TagAspect == 'audio') {
                 $node->getNodePartials()->increaseOutPartials('#' . $tagDef->Partial->TagRole . '.#original.#url');
             }
         }
     }
 }
开发者ID:wb-crowdfusion,项目名称:crowdfusion-advanced-media,代码行数:11,代码来源:AudioBindHandler.php

示例2: loadMediaTagsOriginalsCms

 public function loadMediaTagsOriginalsCms($nothing, $nothing, Node $node)
 {
     return;
     if ($node->getNodePartials()->getOutPartials() != "") {
         $tagDefs = $node->getNodeRef()->getElement()->Schema->getTagDefs();
         foreach ($tagDefs as $k => $tagDef) {
             if ($tagDef->Partial->TagAspect == 'media') {
                 $node->getNodePartials()->increaseOutPartials('#' . $tagDef->Partial->TagRole . '.#original.#url,#' . $tagDef->Partial->TagRole . '.#original.#height,#' . $tagDef->Partial->TagRole . '.#original.#width');
             }
         }
     }
 }
开发者ID:wb-crowdfusion,项目名称:crowdfusion-advanced-media,代码行数:12,代码来源:MediaBindHandler.php

示例3: loadImageTagsThumbnailsCms

 public function loadImageTagsThumbnailsCms($nothing, $nothing, Node $node)
 {
     return;
     if ($node->getNodePartials()->getOutPartials() != "") {
         $tagDefs = $node->getNodeRef()->getElement()->Schema->getTagDefs();
         foreach ($tagDefs as $k => $tagDef) {
             if ($tagDef->Partial->TagAspect == 'images') {
                 $node->getNodePartials()->increaseOutPartials('#' . $tagDef->Partial->TagRole . '.#thumbnails.#url,#' . $tagDef->Partial->TagRole . '.#thumbnails.#width,#' . $tagDef->Partial->TagRole . '.#thumbnails.#height');
             }
         }
     }
 }
开发者ID:wb-crowdfusion,项目名称:crowdfusion-advanced-media,代码行数:12,代码来源:ImagesBindHandler.php

示例4: requirePrimaryImage

 public function requirePrimaryImage(Errors &$errors, NodeRef $nodeRef, Node &$node)
 {
     $element = $nodeRef->getElement();
     $schema = $element->getSchema();
     if (!PartialUtils::isTagRoleInOutTagsScope($schema, $node->getNodePartials(), '#primary-image')) {
         // this should only occur during bulk cms actions
         return;
     }
     if ($schema->hasTagDef('#primary-image')) {
         $primaryImageTag = $node->getOutTag('#primary-image');
         $errors->rejectIfEmpty('#primary-image', 'tag', 'Primary Image', $primaryImageTag);
     }
 }
开发者ID:wb-crowdfusion,项目名称:wb-lib,代码行数:13,代码来源:WbValidationHandler.php

示例5: editInternal

 protected function editInternal(Node $node)
 {
     $existingNode = $this->NodeLookupDAO->getByNodeRef($node->getNodeRef());
     $this->Logger->debug('Editing node [' . $node->getNodeRef() . '] with partials [' . $node->getNodePartials() . ']');
     // update the record
     $primaryKey = $this->NodeDBMeta->getPrimaryKey($node->getNodeRef());
     $id = $existingNode->getID();
     $node->{$primaryKey} = $id;
     $node->ID = $id;
     $db = $this->getConnectionForWrite($node->getNodeRef());
     $oldArray = $this->NodeMapper->nodeToPersistentArray($existingNode);
     $newArray = $this->NodeMapper->nodeToPersistentArray($node);
     // save meta
     $changedMeta = $this->NodeMetaDAO->saveMeta($db, $node->getNodeRef(), $id, $node->getNodePartials()->getMetaPartials(), $node->getMetas(), $node->getNodePartials()->getRestrictedMetaPartials());
     // save the tags
     $changedOut = $this->NodeTagsDAO->saveOutTags($db, $node->getNodeRef(), $id, $node->getNodePartials()->getOutPartials(), $node->getOutTags(), $node->getNodePartials()->getRestrictedOutPartials());
     $changedIn = $this->NodeTagsDAO->saveInTags($db, $node->getNodeRef(), $id, $node->getNodePartials()->getInPartials(), $node->getInTags(), $node->getNodePartials()->getRestrictedInPartials());
     if (array_intersect_key($oldArray, $newArray) != $newArray) {
         $newArray['ModifiedDate'] = $this->DateFactory->newStorageDate();
         $node->ModifiedDate = $newArray['ModifiedDate'];
         $db->updateRecord($db->quoteIdentifier($this->NodeDBMeta->getTableName($node->getNodeRef())), $newArray, "{$primaryKey} = {$db->quote($id)}");
     }
 }
开发者ID:wb-crowdfusion,项目名称:crowdfusion,代码行数:23,代码来源:NodeDAO.php

示例6: validateMetas

 protected function validateMetas(Node $node, Node $obj, NodeSchema $schema, $mode)
 {
     $processed_metas = array();
     $metas = $obj->getMetas();
     // Check all metas passed against the meta defs.
     foreach ($metas as $meta) {
         // Ensure the meta has a meta_def
         $meta_def = $schema->getMetaDef($meta->getMetaName());
         $this->getErrors()->rejectIfInvalid($this->resolveField($node->getNodeRef(), $meta->getMetaName(), $obj instanceof Section ? $obj : null), 'meta', $meta_def->Title, $meta->getValue(), $meta_def->Validation);
         $processed_metas[] = $meta->getMetaName();
     }
     $meta_defs = $schema->getMetaDefs();
     // Check all meta defs that haven't been processed
     // These meta defs must only match partials that we have.
     $meta_partials = PartialUtils::unserializeMetaPartials($node->getNodePartials()->getMetaPartials());
     $re_meta_partials = PartialUtils::unserializeMetaPartials($node->getNodePartials()->getRestrictedMetaPartials());
     foreach ($meta_defs as $meta_def) {
         if (in_array($meta_def->Id, $processed_metas)) {
             continue;
         }
         if ($mode == 'edit' && !$this->metaInScope($schema, new Meta($meta_def->Id, ''), $meta_partials, $re_meta_partials)) {
             continue;
         }
         // Validate the meta def with a null value
         $this->getErrors()->rejectIfInvalid($this->resolveField($node->getNodeRef(), $meta_def->Id, $obj instanceof Section ? $obj : null), 'meta', $meta_def->Title, null, $meta_def->Validation);
         $processed_metas[] = $meta_def->Id;
     }
 }
开发者ID:wb-crowdfusion,项目名称:crowdfusion,代码行数:28,代码来源:NodeValidator.php

示例7: fireBindEvents

 protected function fireBindEvents($action, Node &$node, Errors &$errors, array $fields, array $rawFields)
 {
     if (isset($fields['OutTags_partials'])) {
         foreach (StringUtils::smartSplit($fields['OutTags_partials'], ',', '"', '\\"') as $partial) {
             $node->getNodePartials()->increaseOutPartials($partial);
         }
     }
     if (isset($fields['InTags_partials'])) {
         foreach (StringUtils::smartSplit($fields['InTags_partials'], ',', '"', '\\"') as $partial) {
             $node->getNodePartials()->increaseInPartials($partial);
         }
     }
     foreach ((array) $node->getNodeRef()->getElement()->getAspects() as $aspect) {
         $this->Events->trigger('Node.@' . $aspect->Slug . '.bind', $action, $node, $errors, $fields, $rawFields);
         $schema = $aspect->getSchema();
         foreach ($schema->getMetaDefs() as $metaDef) {
             $bound = $this->Events->trigger('Node.@' . $aspect->Slug . '.meta.#' . $metaDef->Id . '.bind', $action, $node, $errors, $fields, $rawFields);
             if (!$bound) {
                 $this->bindMeta($node, $errors, $fields, $rawFields, $metaDef->Id);
             }
         }
         foreach ($schema->getTagDefs() as $tagDef) {
             if ($tagDef->Direction == 'in') {
                 $bound = $this->Events->trigger('Node.@' . $aspect->Slug . '.intags.#' . $tagDef->Id . '.bind', $action, $node, $errors, $fields, $rawFields);
                 if (!$bound && $tagDef->isFieldlike()) {
                     $this->bindInTags($node, $errors, $fields, $rawFields, $tagDef->Id);
                 }
             } else {
                 $bound = $this->Events->trigger('Node.@' . $aspect->Slug . '.outtags.#' . $tagDef->Id . '.bind', $action, $node, $errors, $fields, $rawFields);
                 if (!$bound && $tagDef->isFieldlike()) {
                     $this->bindOutTags($node, $errors, $fields, $rawFields, $tagDef->Id);
                 }
             }
         }
     }
     $errors->throwOnError();
 }
开发者ID:wb-crowdfusion,项目名称:crowdfusion,代码行数:37,代码来源:NodeBinder.php


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