/**
  * Delete the page
  *
  * @param stdClass $nodeData
  * @return array
  */
 public function deleteNode($nodeData)
 {
     /** @var $node \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode */
     $node = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode::class, (array) $nodeData);
     try {
         Commands::deleteNode($node);
         $returnValue = array();
         if ($GLOBALS['BE_USER']->workspace) {
             $record = Commands::getNodeRecord($node->getId());
             if ($record['_ORIG_uid']) {
                 $newNode = Commands::getNewNode($record);
                 $returnValue = $newNode->toArray();
             }
         }
     } catch (\Exception $exception) {
         $returnValue = array('success' => false, 'message' => $exception->getMessage());
     }
     return $returnValue;
 }
Exemplo n.º 2
0
 /**
  * Delete the page
  *
  * @param \stdClass $nodeData
  * @return array
  */
 public function deleteNode($nodeData)
 {
     /** @var $node PagetreeNode */
     $node = GeneralUtility::makeInstance(PagetreeNode::class, (array) $nodeData);
     try {
         Commands::deleteNode($node);
         $returnValue = [];
         if (static::getBackendUser()->workspace) {
             $record = Commands::getNodeRecord($node->getId());
             if ($record['_ORIG_uid']) {
                 $newNode = Commands::getNewNode($record);
                 $returnValue = $newNode->toArray();
             }
         }
     } catch (\Exception $exception) {
         $returnValue = ['success' => false, 'message' => $exception->getMessage()];
     }
     return $returnValue;
 }