2 namespace TYPO3\CMS\Backend\Module;
52 public function createModuleMenu()
54 if (empty($this->moduleMenu->getEntries())) {
72 foreach ($rawModuleData as $module) {
73 $entry = $this->createEntryFromRawData($module);
74 if (isset($module[
'subitems']) && !empty($module[
'subitems'])) {
75 foreach ($module[
'subitems'] as $subitem) {
76 $subEntry = $this->createEntryFromRawData($subitem);
77 $entry->addChild($subEntry);
80 $this->moduleMenu->attachEntry($entry);
90 protected function createEntryFromRawData(array $module)
94 if (!empty($module[
'name']) && is_string($module[
'name'])) {
95 $entry->setName($module[
'name']);
97 if (!empty($module[
'title']) && is_string($module[
'title'])) {
100 if (!empty($module[
'onclick']) && is_string($module[
'onclick'])) {
101 $entry->setOnClick($module[
'onclick']);
103 if (!empty($module[
'link']) && is_string($module[
'link'])) {
104 $entry->setLink($module[
'link']);
106 if (empty($module[
'link']) && !empty($module[
'path']) && is_string($module[
'path'])) {
107 $entry->setLink($module[
'path']);
109 if (!empty($module[
'description']) && is_string($module[
'description'])) {
110 $entry->setDescription($module[
'description']);
112 if (!empty($module[
'icon']) && is_array($module[
'icon'])) {
113 $entry->setIcon($module[
'icon']);
115 if (!empty($module[
'navigationComponentId']) && is_string($module[
'navigationComponentId'])) {
116 $entry->setNavigationComponentId($module[
'navigationComponentId']);
129 foreach (
$GLOBALS[
'TBE_MODULES_EXT'] as $mainModule => $tbeModuleExt) {
130 list($main) = explode(
'_', $mainModule);
131 $mainEntry = $this->moduleMenuRepository->findByModuleName($main);
132 if ($mainEntry !==
false) {
133 $subEntries = $mainEntry->getChildren();
134 if (!empty($subEntries)) {
135 $matchingSubEntry = $this->moduleMenuRepository->findByModuleName($mainModule);
136 if ($matchingSubEntry !==
false) {
137 if (array_key_exists(
'MOD_MENU', $tbeModuleExt) && array_key_exists(
'function', $tbeModuleExt[
'MOD_MENU'])) {
138 foreach ($tbeModuleExt[
'MOD_MENU'][
'function'] as $subModule) {
139 $entry = $this->createEntryFromRawData($subModule);
140 $matchingSubEntry->addChild($entry);