PageRenderTime 68ms CodeModel.GetById 27ms RepoModel.GetById 0ms app.codeStats 1ms

/kernel/content/action.php

http://github.com/ezsystems/ezpublish
PHP | 1525 lines | 1317 code | 149 blank | 59 comment | 285 complexity | 88b8e043f88c7ee41843674106ec8392 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. /**
  3. * @copyright Copyright (C) eZ Systems AS. All rights reserved.
  4. * @license For full copyright and license information view LICENSE file distributed with this source code.
  5. * @version //autogentag//
  6. * @package kernel
  7. */
  8. $http = eZHTTPTool::instance();
  9. $module = $Params['Module'];
  10. if ( $module->hasActionParameter( 'LanguageCode' ) )
  11. $languageCode = $module->actionParameter( 'LanguageCode' );
  12. else
  13. {
  14. $languageCode = false;
  15. }
  16. $viewMode = 'full';
  17. if ( $module->hasActionParameter( 'ViewMode' ) )
  18. $viewMode = $module->actionParameter( 'ViewMode' );
  19. if ( $http->hasPostVariable( 'BrowseCancelButton' ) || $http->hasPostVariable( 'CancelButton' ) )
  20. {
  21. if ( $http->hasPostVariable( 'BrowseCancelURI' ) )
  22. {
  23. return $module->redirectTo( $http->postVariable( 'BrowseCancelURI' ) );
  24. }
  25. else if ( $http->hasPostVariable( 'CancelURI' ) )
  26. {
  27. return $module->redirectTo( $http->postVariable( 'CancelURI' ) );
  28. }
  29. }
  30. // Merge post variables and variables that were used before login
  31. if ( $http->hasSessionVariable( 'LastPostVars' ) )
  32. {
  33. $post = $http->attribute( 'post' );
  34. $currentPostVarNames = array_keys( $post );
  35. foreach ( $http->sessionVariable( 'LastPostVars' ) as $var => $value )
  36. {
  37. if ( !in_array( $var, $currentPostVarNames ) )
  38. {
  39. $http->setPostVariable( $var, $value );
  40. }
  41. }
  42. $http->removeSessionVariable( 'LastPostVars' );
  43. }
  44. if ( $http->hasPostVariable( 'NewButton' ) || $module->isCurrentAction( 'NewObjectAddNodeAssignment' ) )
  45. {
  46. $hasClassInformation = false;
  47. $contentClassID = false;
  48. $contentClassIdentifier = false;
  49. $languageCode = false;
  50. $class = false;
  51. if ( $http->hasPostVariable( 'ClassID' ) )
  52. {
  53. $contentClassID = $http->postVariable( 'ClassID' );
  54. if ( $contentClassID )
  55. $hasClassInformation = true;
  56. }
  57. else if ( $http->hasPostVariable( 'ClassIdentifier' ) )
  58. {
  59. $contentClassIdentifier = $http->postVariable( 'ClassIdentifier' );
  60. $class = eZContentClass::fetchByIdentifier( $contentClassIdentifier );
  61. if ( is_object( $class ) )
  62. {
  63. $contentClassID = $class->attribute( 'id' );
  64. if ( $contentClassID )
  65. $hasClassInformation = true;
  66. }
  67. }
  68. if ( $http->hasPostVariable( 'ContentLanguageCode' ) )
  69. {
  70. $languageCode = $http->postVariable( 'ContentLanguageCode' );
  71. $languageID = eZContentLanguage::idByLocale( $languageCode );
  72. if ( $languageID === false )
  73. {
  74. eZDebug::writeError( "The language code [$languageCode] specified in ContentLanguageCode does not exist in the system." );
  75. return $module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel' );
  76. }
  77. }
  78. else
  79. {
  80. $allLanguages = eZContentLanguage::prioritizedLanguages();
  81. // Only show language selection if there are more than 1 languages.
  82. if ( count( $allLanguages ) > 1 &&
  83. $hasClassInformation )
  84. {
  85. $tpl = eZTemplate::factory();
  86. $tpl->setVariable( 'node_id', $http->postVariable( 'NodeID' ) );
  87. $tpl->setVariable( 'class_id', $contentClassID );
  88. $tpl->setVariable( 'assignment_remote_id', $http->postVariable( 'AssignmentRemoteID', false ) );
  89. $tpl->setVariable( 'redirect_uri_after_publish', $http->postVariable( 'RedirectURIAfterPublish', false ) );
  90. $tpl->setVariable( 'redirect_uri_after_discard', $http->postVariable( 'RedirectIfDiscarded', false ) );
  91. $Result = array();
  92. $Result['content'] = $tpl->fetch( 'design:content/create_languages.tpl' );
  93. return $Result;
  94. }
  95. }
  96. if ( ( $hasClassInformation && $http->hasPostVariable( 'NodeID' ) ) || $module->isCurrentAction( 'NewObjectAddNodeAssignment' ) )
  97. {
  98. if ( $module->isCurrentAction( 'NewObjectAddNodeAssignment' ) )
  99. {
  100. $selectedNodeIDArray = eZContentBrowse::result( 'NewObjectAddNodeAssignment' );
  101. if ( count( $selectedNodeIDArray ) == 0 )
  102. return $module->redirectToView( 'view', array( 'full', 2 ) );
  103. $node = eZContentObjectTreeNode::fetch( $selectedNodeIDArray[0] );
  104. }
  105. else
  106. {
  107. $node = eZContentObjectTreeNode::fetch( $http->postVariable( 'NodeID' ) );
  108. }
  109. if ( is_object( $node ) )
  110. {
  111. $contentObject = eZContentObject::createWithNodeAssignment( $node,
  112. $contentClassID,
  113. $languageCode,
  114. $http->postVariable( 'AssignmentRemoteID', false ) );
  115. if ( $contentObject )
  116. {
  117. if ( $http->hasPostVariable( 'RedirectURIAfterPublish' ) )
  118. {
  119. $http->setSessionVariable( 'RedirectURIAfterPublish', $http->postVariable( 'RedirectURIAfterPublish' ) );
  120. }
  121. if ( $http->hasPostVariable( 'RedirectIfDiscarded' ) )
  122. {
  123. $http->setSessionVariable( 'RedirectIfDiscarded', $http->postVariable( 'RedirectIfDiscarded' ) );
  124. }
  125. $module->redirectTo( $module->functionURI( 'edit' ) . '/' . $contentObject->attribute( 'id' ) . '/' . $contentObject->attribute( 'current_version' ) );
  126. return;
  127. }
  128. else
  129. {
  130. // If ACCESS DENIED save current post variables for using after login
  131. $http->setSessionVariable( '$_POST_BeforeLogin', $http->attribute( 'post' ) );
  132. return $module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel' );
  133. }
  134. }
  135. else
  136. {
  137. return $module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel' );
  138. }
  139. }
  140. else if ( $hasClassInformation )
  141. {
  142. if ( !is_object( $class ) )
  143. $class = eZContentClass::fetch( $contentClassID );
  144. eZContentBrowse::browse( array( 'action_name' => 'NewObjectAddNodeAssignment',
  145. 'description_template' => 'design:content/browse_first_placement.tpl',
  146. 'keys' => array( 'class' => $class->attribute( 'id' ),
  147. 'classgroup' => $class->attribute( 'ingroup_id_list' ) ),
  148. 'persistent_data' => array( 'ClassID' => $class->attribute( 'id' ), 'ContentLanguageCode' => $languageCode ),
  149. 'content' => array( 'class_id' => $class->attribute( 'id' ) ),
  150. 'cancel_page' => $module->redirectionURIForModule( $module, 'view', array( 'full', 2 ) ),
  151. 'from_page' => "/content/action" ),
  152. $module );
  153. }
  154. }
  155. else if ( $http->hasPostVariable( 'SetSorting' ) &&
  156. $http->hasPostVariable( 'ContentObjectID' ) && $http->hasPostVariable( 'ContentNodeID' ) &&
  157. $http->hasPostVariable( 'SortingField' ) && $http->hasPostVariable( 'SortingOrder' ) )
  158. {
  159. $nodeID = $http->postVariable( 'ContentNodeID' );
  160. $contentObjectID = $http->postVariable( 'ContentObjectID' );
  161. $sortingField = $http->postVariable( 'SortingField' );
  162. $sortingOrder = $http->postVariable( 'SortingOrder' );
  163. $node = eZContentObjectTreeNode::fetch( $nodeID );
  164. $contentObject = eZContentObject::fetch( $contentObjectID );
  165. if ( eZOperationHandler::operationIsAvailable( 'content_sort' ) )
  166. {
  167. $operationResult = eZOperationHandler::execute( 'content', 'sort',
  168. array( 'node_id' => $nodeID,
  169. 'sorting_field' => $sortingField,
  170. 'sorting_order' => $sortingOrder ), null, true );
  171. }
  172. else
  173. {
  174. eZContentOperationCollection::changeSortOrder( $nodeID, $sortingField, $sortingOrder );
  175. }
  176. if ( $http->hasPostVariable( 'RedirectURIAfterSorting' ) )
  177. {
  178. return $module->redirectTo( $http->postVariable( 'RedirectURIAfterSorting' ) );
  179. }
  180. return $module->redirectToView( 'view', array( 'full', $nodeID, $languageCode ) );
  181. }
  182. else if ( $module->isCurrentAction( 'MoveNode' ) )
  183. {
  184. /* This action is used through the admin interface with the "Move" button,
  185. * or in the pop-up menu and will move a node to a different location. */
  186. if ( !$module->hasActionParameter( 'NodeID' ) )
  187. {
  188. eZDebug::writeError( "Missing NodeID parameter for action " . $module->currentAction(),
  189. 'content/action' );
  190. return $module->redirectToView( 'view', array( 'full', 2 ) );
  191. }
  192. if ( $module->hasActionParameter( 'NewParentNode' ) )
  193. {
  194. $selectedNodeID = $module->actionParameter( 'NewParentNode' );
  195. }
  196. else
  197. {
  198. $selectedNodeIDArray = eZContentBrowse::result( 'MoveNode' );
  199. $selectedNodeID = $selectedNodeIDArray[0];
  200. }
  201. $selectedNode = eZContentObjectTreeNode::fetch( $selectedNodeID );
  202. if ( !$selectedNode )
  203. {
  204. eZDebug::writeWarning( "Content node with ID $selectedNodeID does not exist, cannot use that as parent node for node $nodeID",
  205. 'content/action' );
  206. return $module->redirectToView( 'view', array( 'full', 2 ) );
  207. }
  208. $nodeIDlist = $module->actionParameter( 'NodeID' );
  209. if ( strpos( $nodeIDlist, ',' ) !== false )
  210. {
  211. $nodeIDlist = explode( ',', $nodeIDlist );
  212. }
  213. else
  214. {
  215. $nodeIDlist = array( $nodeIDlist );
  216. }
  217. // Check that all user has access to move all selected nodes
  218. $nodeToMoveList = array();
  219. foreach( $nodeIDlist as $key => $nodeID )
  220. {
  221. $node = eZContentObjectTreeNode::fetch( $nodeID );
  222. if ( !$node )
  223. return $module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel', array() );
  224. if ( !$node->canMoveFrom() )
  225. return $module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel', array() );
  226. $object = $node->object();
  227. if ( !$object )
  228. return $module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel', array() );
  229. $nodeToMoveList[] = array( 'node_id' => $nodeID,
  230. 'object_id' => $object->attribute( 'id' ) );
  231. $class = $object->contentClass();
  232. $classID = $class->attribute( 'id' );
  233. // check if the object can be moved to (under) the selected node
  234. if ( !$selectedNode->canMoveTo( $classID ) )
  235. {
  236. eZDebug::writeError( "Cannot move node $nodeID as child of parent node $selectedNodeID, the current user does not have create permission for class ID $classID",
  237. 'content/action' );
  238. return $module->redirectToView( 'view', array( 'full', 2 ) );
  239. }
  240. // Check if we try to move the node as child of itself or one of its children
  241. if ( in_array( $node->attribute( 'node_id' ), $selectedNode->pathArray() ) )
  242. {
  243. eZDebug::writeError( "Cannot move node $nodeID as child of itself or one of its own children (node $selectedNodeID).",
  244. 'content/action' );
  245. return $module->redirectToView( 'view', array( 'full', $node->attribute( 'node_id' ) ) );
  246. }
  247. }
  248. // move selected nodes, this should probably be inside a transaction
  249. foreach( $nodeToMoveList as $nodeToMove )
  250. {
  251. if ( eZOperationHandler::operationIsAvailable( 'content_move' ) )
  252. {
  253. $operationResult = eZOperationHandler::execute( 'content',
  254. 'move', array( 'node_id' => $nodeToMove['node_id'],
  255. 'object_id' => $nodeToMove['object_id'],
  256. 'new_parent_node_id' => $selectedNodeID ),
  257. null,
  258. true );
  259. }
  260. else
  261. {
  262. eZContentOperationCollection::moveNode( $nodeToMove['node_id'], $nodeToMove['object_id'], $selectedNodeID );
  263. }
  264. }
  265. return $module->redirectToView( 'view', array( $viewMode, $selectedNodeID, $languageCode ) );
  266. }
  267. else if ( $module->isCurrentAction( 'MoveNodeRequest' ) )
  268. {
  269. /* This action is started through the pop-up menu when a "Move" is
  270. * requested and through the use of the "Move" button. It will start the
  271. * browser to select where the node should be moved to. */
  272. if ( !$module->hasActionParameter( 'NodeID' ) )
  273. {
  274. eZDebug::writeError( "Missing NodeID parameter for action " . $module->currentAction(),
  275. 'content/action' );
  276. return $module->redirectToView( 'view', array( 'full', 2 ) );
  277. }
  278. $nodeID = $module->actionParameter( 'NodeID' );
  279. $node = eZContentObjectTreeNode::fetch( $nodeID );
  280. if ( !$node )
  281. return $module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel', array() );
  282. if ( !$node->canMoveFrom() )
  283. return $module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel', array() );
  284. $object = $node->object();
  285. if ( !$object )
  286. return $module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel', array() );
  287. $objectID = $object->attribute( 'id' );
  288. $class = $object->contentClass();
  289. $ignoreNodesSelect = array();
  290. $ignoreNodesSelectSubtree = array();
  291. $ignoreNodesClick = array();
  292. $publishedAssigned = $object->assignedNodes( false );
  293. foreach ( $publishedAssigned as $element )
  294. {
  295. $ignoreNodesSelect[] = $element['node_id'];
  296. $ignoreNodesSelectSubtree[] = $element['node_id'];
  297. $ignoreNodesClick[] = $element['node_id'];
  298. $ignoreNodesSelect[] = $element['parent_node_id'];
  299. }
  300. $ignoreNodesSelect = array_unique( $ignoreNodesSelect );
  301. $ignoreNodesSelectSubtree = array_unique( $ignoreNodesSelectSubtree );
  302. $ignoreNodesClick = array_unique( $ignoreNodesClick );
  303. eZContentBrowse::browse( array( 'action_name' => 'MoveNode',
  304. 'description_template' => 'design:content/browse_move_node.tpl',
  305. 'keys' => array( 'class' => $class->attribute( 'id' ),
  306. 'class_id' => $class->attribute( 'identifier' ),
  307. 'classgroup' => $class->attribute( 'ingroup_id_list' ),
  308. 'section' => $object->attribute( 'section_id' ) ),
  309. 'ignore_nodes_select' => $ignoreNodesSelect,
  310. 'ignore_nodes_select_subtree' => $ignoreNodesSelectSubtree,
  311. 'ignore_nodes_click' => $ignoreNodesClick,
  312. 'persistent_data' => array( 'ContentNodeID' => $nodeID,
  313. 'ViewMode' => $viewMode,
  314. 'ContentObjectLanguageCode' => $languageCode,
  315. 'MoveNodeAction' => '1' ),
  316. 'permission' => array( 'access' => 'create',
  317. 'contentclass_id' => $class->attribute( 'id' ) ),
  318. 'content' => array( 'object_id' => $objectID,
  319. 'object_version' => $object->attribute( 'current_version' ),
  320. 'object_language' => $languageCode ),
  321. 'start_node' => $node->attribute( 'parent_node_id' ),
  322. 'cancel_page' => $module->redirectionURIForModule( $module, 'view', array( $viewMode, $nodeID, $languageCode ) ),
  323. 'from_page' => "/content/action" ),
  324. $module );
  325. return;
  326. }
  327. else if ( $module->isCurrentAction( 'SwapNode' ) )
  328. {
  329. if ( !$module->hasActionParameter( 'NodeID' ) )
  330. {
  331. eZDebug::writeError( "Missing NodeID parameter for action " . $module->currentAction(),
  332. 'content/action' );
  333. return $module->redirectToView( 'view', array( 'full', 2 ) );
  334. }
  335. $nodeID = $module->actionParameter( 'NodeID' );
  336. $node = eZContentObjectTreeNode::fetch( $nodeID );
  337. if ( !$node )
  338. return $module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel', array() );
  339. if ( !$node->canSwap() )
  340. {
  341. eZDebug::writeError( "Cannot swap node $nodeID (no edit permission)" );
  342. return $module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel', array() );
  343. }
  344. $nodeParentNodeID = $node->attribute( 'parent_node_id' );
  345. $object = $node->object();
  346. if ( !$object )
  347. return $module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel', array() );
  348. $objectID = $object->attribute( 'id' );
  349. if ( $module->hasActionParameter( 'NewNode' ) )
  350. {
  351. $selectedNodeID = $module->actionParameter( 'NewNode' );
  352. }
  353. else
  354. {
  355. $selectedNodeIDArray = eZContentBrowse::result( 'SwapNode' );
  356. $selectedNodeID = $selectedNodeIDArray[0];
  357. }
  358. $selectedNode = eZContentObjectTreeNode::fetch( $selectedNodeID );
  359. if ( !$selectedNode )
  360. {
  361. eZDebug::writeWarning( "Content node with ID $selectedNodeID does not exist, cannot use that as exchanging node for node $nodeID",
  362. 'content/action' );
  363. return $module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel', array() );
  364. }
  365. if ( !$selectedNode->canSwap() )
  366. {
  367. eZDebug::writeError( "Cannot use node $selectedNodeID as the exchanging node for $nodeID, the current user does not have edit permission for it",
  368. 'content/action' );
  369. return $module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel', array() );
  370. }
  371. // verify one of the nodes contains children and the other is not a container.
  372. if ( !$node->classIsContainer() && $selectedNode->childrenCount() > 0 )
  373. {
  374. eZDebug::writeError( "Cannot use node $selectedNodeID as the exchanging node for $nodeID, as it contains sub items (node is not container)",
  375. 'content/action' );
  376. return $module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel', array() );
  377. }
  378. if ( !$selectedNode->classIsContainer() && $node->childrenCount() > 0 )
  379. {
  380. eZDebug::writeError( "Cannot use node $selectedNodeID as the exchanging node for $nodeID, as it is not container (node contains sub items)",
  381. 'content/action' );
  382. return $module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel', array() );
  383. }
  384. // clear cache.
  385. eZContentCacheManager::clearContentCacheIfNeeded( $objectID );
  386. $selectedObject = $selectedNode->object();
  387. $selectedNodeParentNodeID = $selectedNode->attribute( 'parent_node_id' );
  388. /* In order to swap node1 and node2 a user should have the following permissions:
  389. * 1. move_from: move node1
  390. * 2. move_from: move node2
  391. * 3. move_to: move an object of the same class as node2 under parent of node1
  392. * 4. move_to: move an object of the same class as node1 under parent of node2
  393. *
  394. * The First two has already been checked. Let's check the rest.
  395. */
  396. $nodeParent = $node->attribute( 'parent' );
  397. $selectedNodeParent = $selectedNode->attribute( 'parent' );
  398. $objectClassID = $object->attribute( 'contentclass_id' );
  399. $selectedObjectClassID = $selectedObject->attribute( 'contentclass_id' );
  400. if ( !$nodeParent || !$selectedNodeParent )
  401. return $module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel', array() );
  402. if ( !$nodeParent->canMoveTo( $selectedObjectClassID ) )
  403. {
  404. eZDebug::writeError( "Cannot move an object of class $selectedObjectClassID to node $nodeParentNodeID (no create permission)" );
  405. return $module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel', array() );
  406. }
  407. if ( !$selectedNodeParent->canMoveTo( $objectClassID ) )
  408. {
  409. eZDebug::writeError( "Cannot move an object of class $objectClassID to node $selectedNodeParentNodeID (no create permission)" );
  410. return $module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel', array() );
  411. }
  412. // exchange contentobject ids and versions.
  413. if ( eZOperationHandler::operationIsAvailable( 'content_swap' ) )
  414. {
  415. $operationResult = eZOperationHandler::execute( 'content',
  416. 'swap',
  417. array( 'node_id' => $nodeID,
  418. 'selected_node_id' => $selectedNodeID,
  419. 'node_id_list' => array( $nodeID, $selectedNodeID ) ),
  420. null,
  421. true );
  422. }
  423. else
  424. {
  425. eZContentOperationCollection::swapNode( $nodeID, $selectedNodeID, array( $nodeID, $selectedNodeID ) );
  426. }
  427. return $module->redirectToView( 'view', array( $viewMode, $nodeID, $languageCode ) );
  428. }
  429. else if ( $module->isCurrentAction( 'SwapNodeRequest' ) )
  430. {
  431. /* This action brings a browse screen up to select with which the selected
  432. * node should be swapped. It will not actually move the nodes. */
  433. if ( !$module->hasActionParameter( 'NodeID' ) )
  434. {
  435. eZDebug::writeError( "Missing NodeID parameter for action " . $module->currentAction(),
  436. 'content/action' );
  437. return $module->redirectToView( 'view', array( 'full', 2 ) );
  438. }
  439. $nodeID = $module->actionParameter( 'NodeID' );
  440. $node = eZContentObjectTreeNode::fetch( $nodeID );
  441. if ( !$node )
  442. return $module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel', array() );
  443. if ( !$node->canSwap() )
  444. {
  445. eZDebug::writeError( "Cannot swap node $nodeID (no edit permission)" );
  446. return $module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel', array() );
  447. }
  448. $object = $node->object();
  449. if ( !$object )
  450. return $module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel', array() );
  451. $objectID = $object->attribute( 'id' );
  452. $class = $object->contentClass();
  453. $ignoreNodesSelect = array( $nodeID );
  454. $ignoreNodesClick = array();
  455. eZContentBrowse::browse( array( 'action_name' => 'SwapNode',
  456. 'description_template' => 'design:content/browse_swap_node.tpl',
  457. 'keys' => array( 'class' => $class->attribute( 'id' ),
  458. 'class_id' => $class->attribute( 'identifier' ),
  459. 'classgroup' => $class->attribute( 'ingroup_id_list' ),
  460. 'section' => $object->attribute( 'section_id' ) ),
  461. 'ignore_nodes_select' => $ignoreNodesSelect,
  462. 'ignore_nodes_click' => $ignoreNodesClick,
  463. 'persistent_data' => array( 'ContentNodeID' => $nodeID,
  464. 'ViewMode' => $viewMode,
  465. 'ContentObjectLanguageCode' => $languageCode,
  466. 'SwapNodeAction' => '1' ),
  467. 'permission' => array( 'access' => 'edit',
  468. 'contentclass_id' => $class->attribute( 'id' ) ),
  469. 'content' => array( 'object_id' => $objectID,
  470. 'object_version' => $object->attribute( 'current_version' ),
  471. 'object_language' => $languageCode ),
  472. 'start_node' => $node->attribute( 'parent_node_id' ),
  473. 'cancel_page' => $module->redirectionURIForModule( $module, 'view', array( $viewMode, $nodeID, $languageCode ) ),
  474. 'from_page' => "/content/action" ),
  475. $module );
  476. return;
  477. }
  478. else if ( $module->isCurrentAction( 'UpdateMainAssignment' ) )
  479. {
  480. /* This action selects a different main assignment node for the object. */
  481. if ( !$module->hasActionParameter( 'ObjectID' ) )
  482. {
  483. eZDebug::writeError( "Missing ObjectID parameter for action " . $module->currentAction(),
  484. 'content/action' );
  485. return $module->redirectToView( 'view', array( 'full', 2 ) );
  486. }
  487. if ( !$module->hasActionParameter( 'NodeID' ) )
  488. {
  489. eZDebug::writeError( "Missing NodeID parameter for action " . $module->currentAction(),
  490. 'content/action' );
  491. return $module->redirectToView( 'view', array( 'full', 2 ) );
  492. }
  493. $objectID = $module->actionParameter( 'ObjectID' );
  494. $nodeID = $module->actionParameter( 'NodeID' );
  495. if ( $module->hasActionParameter( 'MainAssignmentID' ) )
  496. {
  497. $mainAssignmentID = $module->actionParameter( 'MainAssignmentID' );
  498. $object = eZContentObject::fetch( $objectID );
  499. if ( !$object )
  500. {
  501. return $module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel' );
  502. }
  503. $existingMainNodeID = false;
  504. $existingMainNode = $object->attribute( 'main_node' );
  505. if ( $existingMainNode )
  506. $existingMainNodeID = $existingMainNode->attribute( 'node_id' );
  507. if ( $existingMainNodeID === false or
  508. $existingMainNodeID != $mainAssignmentID )
  509. {
  510. if ( $existingMainNode and
  511. !$existingMainNode->checkAccess( 'edit' ) )
  512. {
  513. return $module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel', array() );
  514. }
  515. $newMainNode = eZContentObjectTreeNode::fetch( $mainAssignmentID );
  516. if ( !$newMainNode )
  517. {
  518. return $module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel' );
  519. }
  520. if ( !$newMainNode->checkAccess( 'edit' ) )
  521. {
  522. return $module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel' );
  523. }
  524. $mainAssignmentParentID = $newMainNode->attribute( 'parent_node_id' );
  525. if ( eZOperationHandler::operationIsAvailable( 'content_updatemainassignment' ) )
  526. {
  527. $operationResult = eZOperationHandler::execute( 'content',
  528. 'updatemainassignment', array( 'main_assignment_id' => $mainAssignmentID,
  529. 'object_id' => $objectID,
  530. 'main_assignment_parent_id' => $mainAssignmentParentID ),null, true );
  531. }
  532. else
  533. {
  534. eZContentOperationCollection::UpdateMainAssignment( $mainAssignmentID, $objectID, $newMainNode->attribute( 'parent_node_id' ) );
  535. }
  536. }
  537. }
  538. else
  539. {
  540. eZDebug::writeError( "No MainAssignmentID found for action " . $module->currentAction(),
  541. 'content/action' );
  542. }
  543. return $module->redirectToView( 'view', array( $viewMode, $nodeID, $languageCode ) );
  544. }
  545. else if ( $module->isCurrentAction( 'AddAssignment' ) or
  546. $module->isCurrentAction( 'SelectAssignmentLocation' ) )
  547. {
  548. if ( !$module->hasActionParameter( 'ObjectID' ) )
  549. {
  550. eZDebug::writeError( "Missing ObjectID parameter for action " . $module->currentAction(),
  551. 'content/action' );
  552. return $module->redirectToView( 'view', array( 'full', 2 ) );
  553. }
  554. if ( !$module->hasActionParameter( 'NodeID' ) )
  555. {
  556. eZDebug::writeError( "Missing NodeID parameter for action " . $module->currentAction(),
  557. 'content/action' );
  558. return $module->redirectToView( 'view', array( 'full', 2 ) );
  559. }
  560. $objectID = $module->actionParameter( 'ObjectID' );
  561. $nodeID = $module->actionParameter( 'NodeID' );
  562. $object = eZContentObject::fetch( $objectID );
  563. if ( !$object )
  564. {
  565. return $module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel' );
  566. }
  567. $user = eZUser::currentUser();
  568. if ( !$object->checkAccess( 'edit' ) &&
  569. !$user->attribute( 'has_manage_locations' ) )
  570. {
  571. return $module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel' );
  572. }
  573. $existingNode = eZContentObjectTreeNode::fetch( $nodeID );
  574. if ( !$existingNode )
  575. {
  576. return $module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel' );
  577. }
  578. $class = $object->contentClass();
  579. if ( $module->isCurrentAction( 'AddAssignment' ) )
  580. {
  581. $selectedNodeIDArray = eZContentBrowse::result( 'AddNodeAssignment' );
  582. if ( !is_array( $selectedNodeIDArray ) )
  583. $selectedNodeIDArray = array();
  584. if ( eZOperationHandler::operationIsAvailable( 'content_addlocation' ) )
  585. {
  586. $operationResult = eZOperationHandler::execute( 'content',
  587. 'addlocation', array( 'node_id' => $nodeID,
  588. 'object_id' => $objectID,
  589. 'select_node_id_array' => $selectedNodeIDArray ),
  590. null,
  591. true );
  592. }
  593. else
  594. {
  595. eZContentOperationCollection::addAssignment( $nodeID, $objectID, $selectedNodeIDArray );
  596. }
  597. }
  598. else if ( $module->isCurrentAction( 'SelectAssignmentLocation' ) )
  599. {
  600. $ignoreNodesSelect = array();
  601. $ignoreNodesClick = array();
  602. $assigned = eZNodeAssignment::fetchForObject( $objectID, $object->attribute( 'current_version' ), 0, false );
  603. $publishedAssigned = $object->assignedNodes( false );
  604. $isTopLevel = false;
  605. foreach ( $publishedAssigned as $element )
  606. {
  607. $append = false;
  608. if ( $element['parent_node_id'] == 1 )
  609. $isTopLevel = true;
  610. foreach ( $assigned as $ass )
  611. {
  612. if ( $ass['parent_node'] == $element['parent_node_id'] )
  613. {
  614. $append = true;
  615. break;
  616. }
  617. }
  618. if ( $append )
  619. {
  620. $ignoreNodesSelect[] = $element['node_id'];
  621. $ignoreNodesClick[] = $element['node_id'];
  622. $ignoreNodesSelect[] = $element['parent_node_id'];
  623. }
  624. }
  625. if ( !$isTopLevel )
  626. {
  627. $ignoreNodesSelect = array_unique( $ignoreNodesSelect );
  628. $objectID = $object->attribute( 'id' );
  629. eZContentBrowse::browse( array( 'action_name' => 'AddNodeAssignment',
  630. 'description_template' => 'design:content/browse_placement.tpl',
  631. 'keys' => array( 'class' => $class->attribute( 'id' ),
  632. 'class_id' => $class->attribute( 'identifier' ),
  633. 'classgroup' => $class->attribute( 'ingroup_id_list' ),
  634. 'section' => $object->attribute( 'section_id' ) ),
  635. 'ignore_nodes_select' => $ignoreNodesSelect,
  636. 'ignore_nodes_click' => $ignoreNodesClick,
  637. 'persistent_data' => array( 'ContentNodeID' => $nodeID,
  638. 'ContentObjectID' => $objectID,
  639. 'ViewMode' => $viewMode,
  640. 'ContentObjectLanguageCode' => $languageCode,
  641. 'AddAssignmentAction' => '1' ),
  642. 'content' => array( 'object_id' => $objectID,
  643. 'object_version' => $object->attribute( 'current_version' ),
  644. 'object_language' => $languageCode ),
  645. 'cancel_page' => $module->redirectionURIForModule( $module, 'view', array( $viewMode, $nodeID, $languageCode ) ),
  646. 'from_page' => "/content/action" ),
  647. $module );
  648. return;
  649. }
  650. return $module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel' );
  651. }
  652. return $module->redirectToView( 'view', array( $viewMode, $nodeID, $languageCode ) );
  653. }
  654. else if ( $module->isCurrentAction( 'RemoveAssignment' ) )
  655. {
  656. if ( !$module->hasActionParameter( 'ObjectID' ) )
  657. {
  658. eZDebug::writeError( "Missing ObjectID parameter for action RemoveAssignment",
  659. 'content/action' );
  660. return $module->redirectToView( 'view', array( 'full', 2 ) );
  661. }
  662. if ( !$module->hasActionParameter( 'NodeID' ) )
  663. {
  664. eZDebug::writeError( "Missing NodeID parameter for action RemoveAssignment",
  665. 'content/action' );
  666. return $module->redirectToView( 'view', array( 'full', 2 ) );
  667. }
  668. $objectID = $module->actionParameter( 'ObjectID' );
  669. $nodeID = $module->actionParameter( 'NodeID' );
  670. $redirectNodeID = $nodeID;
  671. $object = eZContentObject::fetch( $objectID );
  672. if ( !$object )
  673. {
  674. return $module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel' );
  675. }
  676. $user = eZUser::currentUser();
  677. if ( !$object->checkAccess( 'edit' ) &&
  678. !$user->hasManageLocations() )
  679. {
  680. return $module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel' );
  681. }
  682. if ( $module->hasActionParameter( 'AssignmentIDSelection' ) )
  683. {
  684. eZDebug::writeError( "Use of POST variable 'AssignmentIDSelection' is deprecated, use the node ID and put it in 'LocationIDSelection' instead" );
  685. return $module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel' );
  686. }
  687. if ( !$module->hasActionParameter( 'LocationIDSelection' ) )
  688. return $module->redirectToView( 'view', array( $viewMode, $redirectNodeID, $languageCode ) );
  689. $locationIDSelection = $module->actionParameter( 'LocationIDSelection' );
  690. $hasChildren = false;
  691. $nodes = array();
  692. foreach ( $locationIDSelection as $locationID )
  693. {
  694. $nodes[] = eZContentObjectTreeNode::fetch( $locationID );
  695. }
  696. $removeList = array();
  697. foreach ( $nodes as $node )
  698. {
  699. if ( $node )
  700. {
  701. // Security checks, removal of current node is not allowed
  702. // and we require removal rights
  703. if ( !$node->canRemove() &&
  704. !$node->canRemoveLocation() )
  705. continue;
  706. if ( $node->attribute( 'node_id' ) == $nodeID )
  707. {
  708. $redirectNodeID = $node->attribute( 'parent_node_id' );
  709. }
  710. $removeList[$node->attribute( 'node_id' )] = 1;
  711. $count = $node->childrenCount( false );
  712. if ( $count > 0 )
  713. {
  714. $hasChildren = true;
  715. }
  716. }
  717. }
  718. if ( $hasChildren )
  719. {
  720. $http->setSessionVariable( 'CurrentViewMode', $viewMode );
  721. $http->setSessionVariable( 'DeleteIDArray', array_keys( $removeList ) );
  722. $http->setSessionVariable( 'ContentNodeID', $nodeID );
  723. $http->setSessionVariable( 'ContentLanguage', $languageCode );
  724. return $module->redirectToView( 'removeobject' );
  725. }
  726. else
  727. {
  728. if ( eZOperationHandler::operationIsAvailable( 'content_removelocation' ) )
  729. {
  730. $operationResult = eZOperationHandler::execute( 'content',
  731. 'removelocation', array( 'node_list' => array_keys( $removeList ) ),
  732. null,
  733. true );
  734. }
  735. else
  736. {
  737. eZContentOperationCollection::removeNodes( array_keys( $removeList ) );
  738. }
  739. }
  740. return $module->redirectToView( 'view', array( $viewMode, $redirectNodeID, $languageCode ) );
  741. }
  742. else if ( $http->hasPostVariable( 'EditButton' ) )
  743. {
  744. if ( $http->hasPostVariable( 'ContentObjectID' ) )
  745. {
  746. $parameters = array( $http->postVariable( 'ContentObjectID' ) );
  747. if ( $http->hasPostVariable( 'ContentObjectVersion' ) )
  748. {
  749. $parameters[] = $http->postVariable( 'ContentObjectVersion' );
  750. if ( $http->hasPostVariable( 'ContentObjectLanguageCode' ) )
  751. {
  752. $parameters[] = $http->postVariable( 'ContentObjectLanguageCode' );
  753. }
  754. }
  755. else
  756. {
  757. if ( $http->hasPostVariable( 'ContentObjectLanguageCode' ) )
  758. {
  759. $languageCode = $http->postVariable( 'ContentObjectLanguageCode' );
  760. if ( $languageCode == '' )
  761. {
  762. $parameters[] = 'a'; // this will be treatead as not entering the version number and offering
  763. // list with new languages
  764. }
  765. else
  766. {
  767. $parameters[] = 'f'; // this will be treatead as not entering the version number
  768. $parameters[]= $languageCode;
  769. }
  770. }
  771. }
  772. if ( $http->hasPostVariable( 'RedirectURIAfterPublish' ) )
  773. {
  774. $http->setSessionVariable( 'RedirectURIAfterPublish', $http->postVariable( 'RedirectURIAfterPublish' ) );
  775. }
  776. if ( $http->hasPostVariable( 'RedirectIfDiscarded' ) )
  777. {
  778. $http->setSessionVariable( 'RedirectIfDiscarded', $http->postVariable( 'RedirectIfDiscarded' ) );
  779. }
  780. $module->redirectToView( 'edit', $parameters );
  781. return;
  782. }
  783. }
  784. else if ( $http->hasPostVariable( 'PreviewPublishButton' ) )
  785. {
  786. if ( $http->hasPostVariable( 'ContentObjectID' ) )
  787. {
  788. $parameters = array( $http->postVariable( 'ContentObjectID' ) );
  789. if ( $http->hasPostVariable( 'ContentObjectVersion' ) )
  790. {
  791. $parameters[] = $http->postVariable( 'ContentObjectVersion' );
  792. if ( $http->hasPostVariable( 'ContentObjectLanguageCode' ) )
  793. {
  794. $parameters[] = $http->postVariable( 'ContentObjectLanguageCode' );
  795. }
  796. }
  797. $module->setCurrentAction( 'Publish', 'edit' );
  798. return $module->run( 'edit', $parameters );
  799. }
  800. }
  801. else if ( $http->hasPostVariable( 'RemoveButton' ) )
  802. {
  803. $viewMode = $http->postVariable( 'ViewMode', 'full' );
  804. $contentNodeID = $http->postVariable( 'ContentNodeID', 2 );
  805. $contentObjectID = $http->postVariable( 'ContentObjectID', 1 );
  806. $hideRemoveConfirm = false;
  807. if ( $http->hasPostVariable( 'HideRemoveConfirmation' ) )
  808. $hideRemoveConfirm = $http->postVariable( 'HideRemoveConfirmation' ) ? true : false;
  809. if ( $http->hasPostVariable( 'DeleteIDArray' ) or $http->hasPostVariable( 'SelectedIDArray' ) )
  810. {
  811. if ( $http->hasPostVariable( 'SelectedIDArray' ) )
  812. $deleteIDArray = $http->postVariable( 'SelectedIDArray' );
  813. else
  814. $deleteIDArray = $http->postVariable( 'DeleteIDArray' );
  815. if ( is_array( $deleteIDArray ) && count( $deleteIDArray ) > 0 )
  816. {
  817. $http->setSessionVariable( 'CurrentViewMode', $viewMode );
  818. $http->setSessionVariable( 'ContentNodeID', $contentNodeID );
  819. $http->setSessionVariable( 'HideRemoveConfirmation', $hideRemoveConfirm );
  820. $http->setSessionVariable( 'DeleteIDArray', $deleteIDArray );
  821. $object = eZContentObject::fetch( $contentObjectID );
  822. if ( $object instanceof eZContentObject )
  823. {
  824. $section = eZSection::fetch( $object->attribute( 'section_id' ) );
  825. }
  826. if ( isset($section) && $section )
  827. $navigationPartIdentifier = $section->attribute( 'navigation_part_identifier' );
  828. else
  829. $navigationPartIdentifier = null;
  830. if ( $navigationPartIdentifier and $navigationPartIdentifier == 'ezusernavigationpart' )
  831. {
  832. $module->redirectTo( $module->functionURI( 'removeuserobject' ) . '/' );
  833. }
  834. elseif ( $navigationPartIdentifier and $navigationPartIdentifier == 'ezmedianavigationpart' )
  835. {
  836. $module->redirectTo( $module->functionURI( 'removemediaobject' ) . '/' );
  837. }
  838. else
  839. {
  840. $module->redirectTo( $module->functionURI( 'removeobject' ) . '/' );
  841. }
  842. }
  843. else
  844. {
  845. $module->redirectTo( $module->functionURI( 'view' ) . '/' . $viewMode . '/' . $contentNodeID . '/' );
  846. }
  847. }
  848. else
  849. {
  850. $module->redirectTo( $module->functionURI( 'view' ) . '/' . $viewMode . '/' . $contentNodeID . '/' );
  851. }
  852. }
  853. else if ( $http->hasPostVariable( 'MoveButton' ) )
  854. {
  855. /* action for multi select move, uses same interface as RemoveButton */
  856. $viewMode = $http->postVariable( 'ViewMode', 'full' );
  857. $parentNodeID = $http->postVariable( 'ContentNodeID', 2 );
  858. $parentObjectID = $http->postVariable( 'ContentObjectID', 1 );
  859. if ( $http->hasPostVariable( 'DeleteIDArray' ) or $http->hasPostVariable( 'SelectedIDArray' ) )
  860. {
  861. if ( $http->hasPostVariable( 'SelectedIDArray' ) )
  862. $moveIDArray = $http->postVariable( 'SelectedIDArray' );
  863. else
  864. $moveIDArray = $http->postVariable( 'DeleteIDArray' );
  865. if ( is_array( $moveIDArray ) && count( $moveIDArray ) > 0 )
  866. {
  867. $ignoreNodesSelect = array();
  868. $ignoreNodesSelectSubtree = array();
  869. $ignoreNodesClick = array();
  870. $classIDArray = array();
  871. $classIdentifierArray = array();
  872. $classGroupArray = array();
  873. $sectionIDArray = array();
  874. $objectNameArray = array();
  875. foreach( $moveIDArray as $nodeID )
  876. {
  877. $node = eZContentObjectTreeNode::fetch( $nodeID );
  878. if ( !$node )
  879. return $module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel', array() );
  880. if ( !$node->canMoveFrom() )
  881. return $module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel', array() );
  882. $object = $node->object();
  883. if ( !$object )
  884. return $module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel', array() );
  885. $class = $object->contentClass();
  886. $classIDArray[] = $class->attribute( 'id' );
  887. $classIdentifierArray[] = $class->attribute( 'identifier' );
  888. $classGroupArray = array_merge( $classGroupArray, $class->attribute( 'ingroup_id_list' ) );
  889. $sectionIDArray[] = $object->attribute( 'section_id' );
  890. $objectNameArray[] = $object->attribute( 'name' );
  891. $publishedAssigned = $object->assignedNodes( false );
  892. foreach ( $publishedAssigned as $element )
  893. {
  894. $ignoreNodesSelect[] = $element['node_id'];
  895. $ignoreNodesSelectSubtree[] = $element['node_id'];
  896. $ignoreNodesClick[] = $element['node_id'];
  897. $ignoreNodesSelect[] = $element['parent_node_id'];
  898. }
  899. }
  900. $parentNode = eZContentObjectTreeNode::fetch( $parentNodeID );
  901. if ( !$parentNode )
  902. return $module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel', array() );
  903. $parentObject = $parentNode->object();
  904. if ( !$parentObject )
  905. return $module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel', array() );
  906. $parentObjectID = $parentObject->attribute( 'id' );
  907. $ignoreNodesSelect = array_unique( $ignoreNodesSelect );
  908. $ignoreNodesSelectSubtree = array_unique( $ignoreNodesSelectSubtree );
  909. $ignoreNodesClick = array_unique( $ignoreNodesClick );
  910. $classIDArray = array_unique( $classIDArray );
  911. $classIdentifierArray = array_unique( $classIdentifierArray );
  912. $classGroupArray = array_unique( $classGroupArray );
  913. $sectionIDArray = array_unique( $sectionIDArray );
  914. eZContentBrowse::browse( array( 'action_name' => 'MoveNode',
  915. 'description_template' => 'design:content/browse_move_node.tpl',
  916. 'keys' => array( 'class' => $classIDArray,
  917. 'class_id' => $classIdentifierArray,
  918. 'classgroup' => $classGroupArray,
  919. 'section' => $sectionIDArray ),
  920. 'ignore_nodes_select' => $ignoreNodesSelect,
  921. 'ignore_nodes_select_subtree' => $ignoreNodesSelectSubtree,
  922. 'ignore_nodes_click' => $ignoreNodesClick,
  923. 'persistent_data' => array( 'ContentNodeID' => implode( ',', $moveIDArray ),
  924. 'ViewMode' => $viewMode,
  925. 'ContentObjectLanguageCode' => $languageCode,
  926. 'MoveNodeAction' => '1' ),
  927. 'permission' => array( 'access' => 'create',
  928. 'contentclass_id' => $classIDArray ),
  929. 'content' => array( 'name_list' => $objectNameArray, 'node_id_list' => $moveIDArray ),
  930. 'start_node' => $parentNodeID,
  931. 'cancel_page' => $module->redirectionURIForModule( $module, 'view', array( $viewMode, $parentNodeID, $languageCode ) ),
  932. 'from_page' => "/content/action" ),
  933. $module );
  934. }
  935. else
  936. {
  937. eZDebug::writeError( "Empty SelectedIDArray parameter for action " . $module->currentAction(),
  938. 'content/action' );
  939. $module->redirectTo( $module->functionURI( 'view' ) . '/' . $viewMode . '/' . $parentNodeID . '/' );
  940. }
  941. }
  942. else
  943. {
  944. eZDebug::writeError( "Missing SelectedIDArray parameter for action " . $module->currentAction(),
  945. 'content/action' );
  946. $module->redirectTo( $module->functionURI( 'view' ) . '/' . $viewMode . '/' . $parentNodeID . '/' );
  947. }
  948. }
  949. else if ( $http->hasPostVariable( 'UpdatePriorityButton' ) )
  950. {
  951. $viewMode = $http->postVariable( 'ViewMode', 'full' );
  952. if ( $http->hasPostVariable( 'ContentNodeID' ) )
  953. {
  954. $contentNodeID = $http->postVariable( 'ContentNodeID' );
  955. }
  956. else
  957. {
  958. eZDebug::writeError( "Variable 'ContentNodeID' can not be found in template." );
  959. $module->redirectTo( $module->functionURI( 'view' ) . '/' . $viewMode . '/' . $contentNodeID . '/' );
  960. return;
  961. }
  962. if ( $http->hasPostVariable( 'Priority' ) and $http->hasPostVariable( 'PriorityID' ) )
  963. {
  964. $contentNode = eZContentObjectTreeNode::fetch( $contentNodeID );
  965. if ( !$contentNode->attribute( 'can_edit' ) )
  966. {
  967. eZDebug::writeError( 'Current user can not update the priorities because he has no permissions to edit the node' );
  968. $module->redirectTo( $module->functionURI( 'view' ) . '/' . $viewMode . '/' . $contentNodeID . '/' );
  969. return;
  970. }
  971. $priorityArray = $http->postVariable( 'Priority' );
  972. $priorityIDArray = $http->postVariable( 'PriorityID' );
  973. if ( eZOperationHandler::operationIsAvailable( 'content_updatepriority' ) )
  974. {
  975. $operationResult = eZOperationHandler::execute( 'content', 'updatepriority',
  976. array( 'node_id' => $contentNodeID,

Large files files are truncated, but you can click here to view the full file