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


PHP eZSearch::updateNodeVisibility方法代码示例

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


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

示例1: changeHideStatus

 /**
  * Changes an contentobject's status
  *
  * @param int $nodeID
  *
  * @return array An array with operation status, always true
  */
 public static function changeHideStatus($nodeID)
 {
     $action = 'hide';
     $curNode = eZContentObjectTreeNode::fetch($nodeID);
     if (is_object($curNode)) {
         if ($curNode->attribute('is_hidden')) {
             eZContentObjectTreeNode::unhideSubTree($curNode);
             $action = 'show';
         } else {
             eZContentObjectTreeNode::hideSubTree($curNode);
         }
     }
     //call appropriate method from search engine
     eZSearch::updateNodeVisibility($nodeID, $action);
     return array('status' => true);
 }
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:23,代码来源:ezcontentoperationcollection.php

示例2: updateGlobalLimitation

    /**
     * @param eZContentObject $contentObject
     * @param bool|null $parentIsInvisible Only defined as boolean true|false if we are recursively going in a child
     */
    public static function updateGlobalLimitation ( $contentObject, $parentIsInvisible = null )
    {
        /* @type $contentMainNode eZContentObjectTreeNode */
        $db              = eZDB::instance();
        $contentObjectID = $contentObject->attribute('id');
        $contentMainNode = $contentObject->mainNode();

        if ( !($contentMainNode instanceof eZContentObjectTreeNode) )
            return;

        /* @type $dm eZContentObjectAttribute[] */
        $contentDepth         = $contentMainNode->attribute('depth');
        $merckINI             = eZINI::instance('merck.ini');
        $onlineDateAttribute  = $merckINI->variable("ArticleVisibility","OnlineDate");
        $offlineDateAttribute = $merckINI->variable("ArticleVisibility","OfflineDate");
        $dm                   = $contentObject->attribute("data_map");

        if ( !is_array($dm) )
            return;

        /* @type $onlineDateContent eZDateTime */
        /* @type $offlineDateContent eZDateTime */
        $onlineDateContent    = $dm[$onlineDateAttribute]->content();
        $onlineDate           = $onlineDateContent->timeStamp();
        $offlineDateContent   = $dm[$offlineDateAttribute]->content();
        $offlineDate          = $offlineDateContent->timeStamp();
        $visibility           = MMEventManager::visibilityDates($contentObject);
        $isInvisible          = !$visibility;

        // We have a parent article, we check its visibility
        if ( !$isInvisible && $parentIsInvisible === null && $contentDepth > 4 )
        {
            $parentNode  = $contentMainNode->fetchParent();
            $isInvisible = self::isGloballyLimited( $parentNode->attribute('contentobject_id') );
        }
        elseif ( !$isInvisible )
        {
            if ( $parentIsInvisible !== null && $parentIsInvisible === true )
                $isInvisible = true;
        }

        $db->beginQuery();

        $visibilityChange = self::updateGlobalLimitationEntry( $contentObjectID, $offlineDate, $onlineDate, $visibility, $isInvisible);

        if ( $visibilityChange && $visibility && !$isInvisible )
        {
            eZSearch::updateNodeVisibility($contentObject->mainNodeID(), 'show');
        }
        elseif ( $visibilityChange && ( !$visibility || $isInvisible ) )
        {
            eZSearch::updateNodeVisibility($contentObject->mainNodeID(), 'hide');
        }

        if ( $visibilityChange )
            self::spreadGlobalLimitationChange( $contentMainNode, $isInvisible );

        $db->commitQuery();
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:63,代码来源:objectVisibilityManager.php

示例3: QuestionInteractiveCli

    }

    $pathIdentificationString = $node->attribute('path_identification_string');

    if ( $node->IsHidden )
    {
        $cli->warning ( " Already hidden : [" . $nodeId . "] " . $pathIdentificationString . " : " . $node->getName() );
        continue;
    }

    $validCalculatorsNodeId[] = $nodeId;
    $possibleReplies[] = $nodeId . " " . $pathIdentificationString . " : " . $node->getName();
}

$questionHandler = new QuestionInteractiveCli();
$question = "Hide which nodes";

$response = $questionHandler->askQuestionMultipleChoices($question, $possibleReplies, 'validateReplyMultiple', true);

foreach ( $response as $indexToHide )
{
    $nodeId = $validCalculatorsNodeId[$indexToHide];
    $node   = eZContentObjectTreeNode::fetch($nodeId);

    eZContentObjectTreeNode::hideSubTree( $node );
    eZSearch::updateNodeVisibility( $node->NodeID, 'hide' );

    $pathIdentificationString = $node->attribute('path_identification_string');
    $cli->warning ( " Hiding : [" . $nodeId . "] " . $pathIdentificationString . " : " . $node->getName() );
}
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:30,代码来源:hide_calculators.php

示例4: updateVisibility

 /**
  * Change node`s visibility
  *
  * @private
  * @param eZContentObject $object
  * @param bool $visibility
  * @return void
  */
 private function updateVisibility($object, $visibility = true)
 {
     $action = $visibility ? 'show' : 'hide';
     $nodeAssigments = eZPersistentObject::fetchObjectList(eZNodeAssignment::definition(), null, array('contentobject_id' => $object->attribute('id'), 'contentobject_version' => $object->attribute('current_version')), null, null, true);
     foreach ($nodeAssigments as $nodeAssigment) {
         $node = $nodeAssigment->attribute('node');
         if ($node instanceof eZContentObjectTreeNode === false) {
             continue;
         }
         if ((bool) (!$node->attribute('is_hidden')) === (bool) $visibility) {
             continue;
         }
         if ($action == 'show') {
             eZContentObjectTreeNode::unhideSubTree($node);
         } else {
             eZContentObjectTreeNode::hideSubTree($node);
         }
         eZSearch::updateNodeVisibility($node->attribute('node_id'), $action);
     }
 }
开发者ID:nxc,项目名称:nxc_powercontent,代码行数:28,代码来源:powercontent.php


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