2 namespace TYPO3\CMS\Backend\Tree\Pagetree;
31 public function visiblyNode($nodeData)
38 $newNode->setLeaf($node->isLeafNode());
39 $returnValue = $newNode->toArray();
43 'error' => $exception->getMessage()
55 public function disableNode($nodeData)
62 $newNode->setLeaf($node->isLeafNode());
63 $returnValue = $newNode->toArray();
67 'message' => $exception->getMessage()
79 public function deleteNode($nodeData)
85 $returnValue = array();
86 if (
$GLOBALS[
'BE_USER']->workspace) {
88 if ($record[
'_ORIG_uid']) {
89 $newNode = Commands::getNewNode($record);
90 $returnValue = $newNode->toArray();
96 'message' => $exception->getMessage()
109 public function restoreNode($nodeData, $destination)
116 $returnValue = $newNode->toArray();
118 $returnValue = array(
120 'message' => $exception->getMessage()
134 public function updateLabel($nodeData, $updatedLabel)
136 if ($updatedLabel ===
'') {
144 $returnValue = array(
145 'editableText' => $updatedLabel,
146 'updatedText' => htmlspecialchars($shortendedText)
149 $returnValue = array(
151 'message' => $exception->getMessage()
163 public static function setTemporaryMountPoint($nodeData)
167 $GLOBALS[
'BE_USER']->uc[
'pageTree_temporaryMountPoint'] = $node->getId();
179 public function moveNodeToFirstChildOfDestination($nodeData, $destination)
186 $newNode->setLeaf($node->isLeafNode());
187 $returnValue = $newNode->toArray();
189 $returnValue = array(
191 'message' => $exception->getMessage()
204 public function moveNodeAfterDestination($nodeData, $destination)
211 $newNode->setLeaf($node->isLeafNode());
212 $returnValue = $newNode->toArray();
214 $returnValue = array(
216 'message' => $exception->getMessage()
230 public function copyNodeToFirstChildOfDestination($nodeData, $destination)
239 $newNode->setLeaf($node->isLeafNode());
240 $returnValue = $newNode->toArray();
242 $returnValue = array(
244 'message' => $exception->getMessage()
258 public function copyNodeAfterDestination($nodeData, $destination)
267 $newNode->setLeaf($node->isLeafNode());
268 $returnValue = $newNode->toArray();
270 $returnValue = array(
272 'message' => $exception->getMessage()
285 public function insertNodeToFirstChildOfDestination($parentNodeData, $pageType)
293 $returnValue = array(
295 'message' => $exception->getMessage()
309 public function insertNodeAfterDestination($parentNodeData, $destination, $pageType)
317 $returnValue = array(
319 'message' => $exception->getMessage()
331 public static function getViewLink($nodeData)
337 if (preg_match(
'/window\\.open\\(\'([^\']+)\'/i', $javascriptLink, $match)) {
340 $extractedLink = json_decode(
'"' . trim($match[1],
'"') .
'"', JSON_HEX_AMP);
342 return $extractedLink;
355 public static function addRootlineOfNodeToStateHash($stateId, $nodeId)
357 $mountPoints = array_map(
'intval',
$GLOBALS[
'BE_USER']->returnWebmounts());
358 if (empty($mountPoints)) {
359 $mountPoints = array(0);
361 $mountPoints[] = (int)
$GLOBALS[
'BE_USER']->uc[
'pageTree_temporaryMountPoint'];
362 $mountPoints = array_unique($mountPoints);
365 $state = $userSettingsController->process(
'get',
'BackendComponents.States.' . $stateId);
366 $state->stateHash = (object) $state->stateHash;
368 $rootlineIds = array();
369 foreach ($rootline as $pageData) {
370 $rootlineIds[] = (int)$pageData[
'uid'];
372 foreach ($mountPoints as $mountPoint) {
373 if (!in_array($mountPoint, $rootlineIds,
true)) {
377 foreach ($rootline as $pageData) {
378 $node = Commands::getNewNode($pageData, $mountPoint);
380 $isFirstNode =
false;
381 $state->stateHash->lastSelectedNode = $node->calculateNodeId();
383 $state->stateHash->{$node->calculateNodeId(
'')} = 1;
387 $userSettingsController->process(
'set',
'BackendComponents.States.' . $stateId, $state);
388 return (array)$state->stateHash;