34 $splitCount = count($this->menuArr);
38 if (!empty($this->mconf[
'debugItemConf'])) {
39 echo
'<h3>$NOconf:</h3>';
42 $this->result = $NOconf;
56 if (empty($this->result)) {
61 $this->INPfixMD5 = substr(md5(microtime() .
'tmenu'), 0, 4);
62 $this->WMmenuItems = count($this->result);
63 $typoScriptService = GeneralUtility::makeInstance(TypoScriptService::class);
64 $this->WMsubmenuObjSuffixes = $typoScriptService->explodeConfigurationForOptionSplit([
'sOSuffix' => $this->mconf[
'submenuObjSuffixes']], $this->WMmenuItems);
66 foreach ($this->result as $key => $val) {
67 $GLOBALS[
'TSFE']->register[
'count_HMENU_MENUOBJ']++;
68 $GLOBALS[
'TSFE']->register[
'count_MENUOBJ']++;
70 $this->WMcObj->start($this->menuArr[$key],
'pages');
72 $this->I[
'key'] = $key;
73 $this->I[
'INPfix'] = ($this->imgNameNotRandom ?
'' :
'_' .
$this->INPfixMD5) .
'_' . $key;
74 $this->I[
'val'] = $val;
75 $this->I[
'title'] = isset($this->I[
'val'][
'stdWrap.']) ? $this->WMcObj->stdWrap($this->
getPageTitle($this->menuArr[$key][
'title'], $this->menuArr[$key][
'nav_title']), $this->I[
'val'][
'stdWrap.']) : $this->
getPageTitle($this->menuArr[$key][
'title'], $this->menuArr[$key][
'nav_title']);
76 $this->I[
'uid'] = $this->menuArr[$key][
'uid'];
77 $this->I[
'mount_pid'] = $this->menuArr[$key][
'mount_pid'];
78 $this->I[
'pid'] = $this->menuArr[$key][
'pid'];
79 $this->I[
'spacer'] = $this->menuArr[$key][
'isSpacer'];
81 if ($this->mconf[
'accessKey']) {
82 $this->I[
'accessKey'] = $this->
accessKey($this->I[
'title']);
84 $this->I[
'accessKey'] = [];
87 $this->I[
'val'][
'ATagParams'] = $this->WMcObj->getATagParams($this->I[
'val']);
88 if (isset($this->I[
'val'][
'additionalParams.'])) {
89 $this->I[
'val'][
'additionalParams'] = $this->WMcObj->stdWrap($this->I[
'val'][
'additionalParams'], $this->I[
'val'][
'additionalParams.']);
91 $this->I[
'linkHREF'] = $this->
link($key, $this->I[
'val'][
'altTarget'], $this->mconf[
'forceTypeValue']);
92 if (empty($this->I[
'linkHREF'])) {
93 $this->I[
'val'][
'doNotLinkIt'] = 1;
96 $titleAttrValue = isset($this->I[
'val'][
'ATagTitle.']) ? $this->WMcObj->stdWrap($this->I[
'val'][
'ATagTitle'], $this->I[
'val'][
'ATagTitle.']) . $this->I[
'accessKey'][
'alt'] : $this->I[
'val'][
'ATagTitle'] . $this->I[
'accessKey'][
'alt'];
97 if ($titleAttrValue !==
'') {
98 $this->I[
'linkHREF'][
'title'] = $titleAttrValue;
104 if (isset($this->I[
'val'][
'doNotLinkIt.'])) {
105 $this->I[
'val'][
'doNotLinkIt'] = $this->WMcObj->stdWrap($this->I[
'val'][
'doNotLinkIt'], $this->I[
'val'][
'doNotLinkIt.']);
108 if (!$this->I[
'val'][
'doNotLinkIt']) {
109 $this->I[
'val'][
'doNotLinkIt'] = 0;
111 if (!$this->I[
'spacer'] && $this->I[
'val'][
'doNotLinkIt'] != 1) {
118 if ($this->I[
'val'][
'ATagBeforeWrap']) {
119 $wrapPartsBefore = explode(
'|', $this->I[
'val'][
'linkWrap']);
120 $wrapPartsAfter = [
'',
''];
122 $wrapPartsBefore = [
'',
''];
123 $wrapPartsAfter = explode(
'|', $this->I[
'val'][
'linkWrap']);
125 if ($this->I[
'val'][
'stdWrap2'] || isset($this->I[
'val'][
'stdWrap2.'])) {
126 $stdWrap2 = isset($this->I[
'val'][
'stdWrap2.']) ? $this->WMcObj->stdWrap(
'|', $this->I[
'val'][
'stdWrap2.']) :
'|';
127 $wrapPartsStdWrap = explode($this->I[
'val'][
'stdWrap2'] ? $this->I[
'val'][
'stdWrap2'] :
'|', $stdWrap2);
129 $wrapPartsStdWrap = [
'',
''];
132 $this->I[
'parts'] = [];
134 $this->I[
'parts'][
'stdWrap2_begin'] = $wrapPartsStdWrap[0];
136 if (isset($this->I[
'val'][
'doNotShowLink.'])) {
137 $this->I[
'val'][
'doNotShowLink'] = $this->WMcObj->stdWrap($this->I[
'val'][
'doNotShowLink'], $this->I[
'val'][
'doNotShowLink.']);
139 if (!$this->I[
'val'][
'doNotShowLink']) {
140 $this->I[
'parts'][
'notATagBeforeWrap_begin'] = $wrapPartsAfter[0];
141 $this->I[
'parts'][
'ATag_begin'] = $this->I[
'A1'];
142 $this->I[
'parts'][
'ATagBeforeWrap_begin'] = $wrapPartsBefore[0];
143 $this->I[
'parts'][
'title'] = $this->I[
'title'];
144 $this->I[
'parts'][
'ATagBeforeWrap_end'] = $wrapPartsBefore[1];
145 $this->I[
'parts'][
'ATag_end'] = $this->I[
'A2'];
146 $this->I[
'parts'][
'notATagBeforeWrap_end'] = $wrapPartsAfter[1];
148 $this->I[
'parts'][
'stdWrap2_end'] = $wrapPartsStdWrap[1];
151 if ($this->mconf[
'IProcFunc']) {
155 $this->I[
'theItem'] = implode(
'', $this->I[
'parts']);
158 $allWrap = isset($this->I[
'val'][
'allWrap.']) ? $this->WMcObj->stdWrap($this->I[
'val'][
'allWrap'], $this->I[
'val'][
'allWrap.']) : $this->I[
'val'][
'allWrap'];
159 $this->I[
'theItem'] = $this->WMcObj->wrap($this->I[
'theItem'], $allWrap);
160 if ($this->I[
'val'][
'subst_elementUid']) {
161 $this->I[
'theItem'] = str_replace(
'{elementUid}', $this->I[
'uid'], $this->I[
'theItem']);
164 if (is_array($this->I[
'val'][
'allStdWrap.'])) {
165 $this->I[
'theItem'] = $this->WMcObj->stdWrap($this->I[
'theItem'], $this->I[
'val'][
'allStdWrap.']);
182 if ($imgInfo = $this->WMcObj->getImgResource($this->I[
'val'][$pref .
'Img'], $this->I[
'val'][$pref .
'Img.'])) {
183 $theName = $this->imgNamePrefix . $this->I[
'uid'] . $this->I[
'INPfix'] . $pref;
184 $name =
' ' . $this->nameAttribute .
'="' . $theName .
'"';
185 $GLOBALS[
'TSFE']->imagesOnPage[] = $imgInfo[3];
186 $res =
'<img' .
' src="' .
$GLOBALS[
'TSFE']->absRefPrefix . $imgInfo[3] .
'"' .
' width="' . $imgInfo[0] .
'"' .
' height="' . $imgInfo[1] .
'"' . $name . ($this->I[
'val'][$pref .
'ImgTagParams'] ?
' ' . $this->I[
'val'][$pref .
'ImgTagParams'] :
'') . $this->parent_cObj->getBorderAttr(
' border="0"');
187 if (!strstr($res,
'alt="')) {
192 if ($this->I[
'val'][$pref .
'ImgLink']) {
193 $res = $this->I[
'A1'] . $res . $this->I[
'A2'];
196 $processedPref = isset($this->I[
'val'][$pref .
'.']) ? $this->WMcObj->stdWrap($this->I[
'val'][$pref], $this->I[
'val'][$pref .
'.']) : $this->I[
'val'][$pref];
197 if (isset($this->I[
'val'][$pref .
'Wrap'])) {
198 return $this->WMcObj->wrap($res . $processedPref, $this->I[
'val'][$pref .
'Wrap']);
200 return $res . $processedPref;
233 if (!$this->I[
'spacer']) {
234 $this->I[
'theItem'] .= $this->
subMenu($this->I[
'uid'], $this->WMsubmenuObjSuffixes[$key][
'sOSuffix']);
236 $part = isset($this->I[
'val'][
'wrapItemAndSub.']) ? $this->WMcObj->stdWrap($this->I[
'val'][
'wrapItemAndSub'], $this->I[
'val'][
'wrapItemAndSub.']) : $this->I[
'val'][
'wrapItemAndSub'];
237 $this->WMresult .= $part ? $this->WMcObj->wrap($this->I[
'theItem'], $part) : $this->I[
'theItem'];
262 if (is_array($this->mconf[
'stdWrap.'])) {
263 $this->WMresult = $this->WMcObj->stdWrap($this->WMresult, $this->mconf[
'stdWrap.']);