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


PHP eZContentOperationCollection::updatePriority方法代码示例

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


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

示例1: updatePriority

    /**
     * Updating priority sorting for given node
     *
     * @param mixed $args
     * @return array
     */
    public static function updatePriority( $args )
    {
        $http = eZHTTPTool::instance();

        if ( !$http->hasPostVariable('ContentNodeID')
                || !$http->hasPostVariable('PriorityID')
                    || !$http->hasPostVariable('Priority') )
        {
            return array();
        }

        $contentNodeID = $http->postVariable('ContentNodeID');
        $priorityArray = $http->postVariable('Priority');
        $priorityIDArray = $http->postVariable('PriorityID');

        $contentNode = eZContentObjectTreeNode::fetch( $contentNodeID );
        if ( !$contentNode->attribute( 'can_edit' ) )
        {
            eZDebug::writeError( 'Current user can not update the priorities because he has no permissions to edit the node' );
            return array();
        }

        if ( eZOperationHandler::operationIsAvailable( 'content_updatepriority' ) )
        {
            $operationResult = eZOperationHandler::execute( 'content', 'updatepriority',
                                                             array( 'node_id' => $contentNodeID,
                                                                    'priority' => $priorityArray,
                                                                    'priority_id' => $priorityIDArray ), null, true );
        }
        else
        {
            eZContentOperationCollection::updatePriority( $contentNodeID, $priorityArray, $priorityIDArray );
        }

        if ( $http->hasPostVariable( 'ContentObjectID' ) )
        {
            $objectID = $http->postVariable( 'ContentObjectID' );
            eZContentCacheManager::clearContentCache( $objectID );
        }
    }
开发者ID:ezsystemstraining,项目名称:ez54training,代码行数:46,代码来源:ezwtservercallfunctions.php

示例2: array

         $module->redirectTo($module->functionURI('view') . '/' . $viewMode . '/' . $contentNodeID . '/');
         return;
     }
     if ($http->hasPostVariable('Priority') and $http->hasPostVariable('PriorityID')) {
         $contentNode = eZContentObjectTreeNode::fetch($contentNodeID);
         if (!$contentNode->attribute('can_edit')) {
             eZDebug::writeError('Current user can not update the priorities because he has no permissions to edit the node');
             $module->redirectTo($module->functionURI('view') . '/' . $viewMode . '/' . $contentNodeID . '/');
             return;
         }
         $priorityArray = $http->postVariable('Priority');
         $priorityIDArray = $http->postVariable('PriorityID');
         if (eZOperationHandler::operationIsAvailable('content_updatepriority')) {
             $operationResult = eZOperationHandler::execute('content', 'updatepriority', array('node_id' => $contentNodeID, 'priority' => $priorityArray, 'priority_id' => $priorityIDArray), null, true);
         } else {
             eZContentOperationCollection::updatePriority($contentNodeID, $priorityArray, $priorityIDArray);
         }
     }
     if ($http->hasPostVariable('ContentObjectID')) {
         $objectID = $http->postVariable('ContentObjectID');
         eZContentCacheManager::clearContentCache($objectID);
     }
     if ($http->hasPostVariable('RedirectURIAfterPriority')) {
         return $module->redirectTo($http->postVariable('RedirectURIAfterPriority'));
     }
     $module->redirectTo($module->functionURI('view') . '/' . $viewMode . '/' . $contentNodeID . '/');
     return;
 } else {
     if ($http->hasPostVariable("ActionAddToBookmarks")) {
         $user = eZUser::currentUser();
         $nodeID = false;
开发者ID:heliopsis,项目名称:ezpublish-legacy,代码行数:31,代码来源:action.php

示例3: updatePriority

 /**
  * Updating priority sorting for given node
  *
  * @since 1.2
  * @param mixed $args
  * @return array
  */
 public static function updatePriority($args)
 {
     $http = eZHTTPTool::instance();
     if (!$http->hasPostVariable('ContentNodeID') || !$http->hasPostVariable('PriorityID') || !$http->hasPostVariable('Priority')) {
         return array();
     }
     $contentNodeID = $http->postVariable('ContentNodeID');
     $priorityArray = $http->postVariable('Priority');
     $priorityIDArray = $http->postVariable('PriorityID');
     $contentNode = eZContentObjectTreeNode::fetch($contentNodeID);
     if (!$contentNode instanceof eZContentObjectTreeNode) {
         throw new InvalidArgumentException("Argument ContentNodeID: '{$contentNodeID}' does not exist");
     } else {
         if (!$contentNode->canEdit()) {
             throw new InvalidArgumentException("Argument ContentNodeIDs: '{$contentNodeID}' is not available");
         }
     }
     if (eZOperationHandler::operationIsAvailable('content_updatepriority')) {
         $operationResult = eZOperationHandler::execute('content', 'updatepriority', array('node_id' => $contentNodeID, 'priority' => $priorityArray, 'priority_id' => $priorityIDArray), null, true);
     } else {
         eZContentOperationCollection::updatePriority($contentNodeID, $priorityArray, $priorityIDArray);
     }
     if ($http->hasPostVariable('ContentObjectID')) {
         $objectID = $http->postVariable('ContentObjectID');
         eZContentCacheManager::clearContentCacheIfNeeded($objectID);
     }
 }
开发者ID:patrickallaert,项目名称:ezpublish-legacy-php7,代码行数:34,代码来源:ezjscserverfunctionsnode.php


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