[TASK] Add unit test to cover stdWrap_innerWrap
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / ContextMenu / Extdirect / AbstractExtdirectContextMenu.php
1 <?php
2 namespace TYPO3\CMS\Backend\ContextMenu\Extdirect;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * Abstract Context Menu for ExtDirect
19 *
20 * This is a concrete implementation that should stay here to be shared
21 * between the different ExtDirect implementation. Just create a subclass
22 * for adding specific purposes.
23 */
24 abstract class AbstractExtdirectContextMenu extends \TYPO3\CMS\Backend\ContextMenu\AbstractContextMenu
25 {
26 /**
27 * Returns the actions for the given node information
28 *
29 * Note: This method should be overriden to fit your specific needs.
30 *
31 * The informations should contain the basic informations of a
32 * \TYPO3\CMS\Backend\Tree\TreeNode for further processing. Also the classname
33 * (property type) of the node should be given, because we need this information
34 * to create the node.
35 *
36 * @param \stdClass $nodeData
37 * @return array
38 */
39 public function getActionsForNodeArray($nodeData)
40 {
41 if ($this->dataProvider === null) {
42 $dataProvider = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\ContextMenu\AbstractContextMenuDataProvider::class);
43 $this->setDataProvider($dataProvider);
44 }
45 /** @var $node \TYPO3\CMS\Backend\Tree\TreeNode */
46 $node = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Tree\TreeNode::class, (array)$nodeData);
47 $actions = $this->dataProvider->getActionsForNode($node);
48 return $actions;
49 }
50
51 /**
52 * Unused for this implementation
53 *
54 * @see getActionsForNodeArray()
55 * @param \TYPO3\CMS\Backend\Tree\TreeNode $node
56 * @return array
57 */
58 public function getActionsForNode(\TYPO3\CMS\Backend\Tree\TreeNode $node)
59 {
60 }
61 }