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