本文整理汇总了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 );
}
}
示例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;
示例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);
}
}