TYPO3 CMS  TYPO3_6-2
ContextMenuConfiguration.php
Go to the documentation of this file.
1 <?php
3 
23 
29  protected function initDataProvider() {
31  $dataProvider = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\ContextMenu\\Pagetree\\ContextMenuDataProvider');
33  }
34 
41  public function getActionsForNodeArray($nodeData) {
43  $node = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Tree\\Pagetree\\PagetreeNode', (array) $nodeData);
44  $node->setRecord(\TYPO3\CMS\Backend\Tree\Pagetree\Commands::getNodeRecord($node->getId()));
45  $this->initDataProvider();
46  $this->dataProvider->setContextMenuType('table.' . $node->getType());
47  $actionCollection = $this->dataProvider->getActionsForNode($node);
48  if ($actionCollection instanceof \TYPO3\CMS\Backend\ContextMenu\ContextMenuActionCollection) {
49  $actions = $actionCollection->toArray();
50  }
51  return $actions;
52  }
53 
54 }
setDataProvider(\TYPO3\CMS\Backend\ContextMenu\AbstractContextMenuDataProvider $dataProvider)