2 namespace TYPO3\CMS\Frontend\ContentObject\Menu;
55 $this->JSVarName =
'eid' . $uniqueParam;
56 $this->JSMenuName = $this->mconf[
'menuName'] ?:
'JSmenu' . $uniqueParam;
59 for ($a = 1; $a <=
$levels; $a++) {
61 var ' . $this->JSVarName . $a .
'=0;';
64 $GLOBALS[
'TSFE']->additionalHeaderData[
'JSMenuCode'] =
'<script type="text/javascript" src="' .
$GLOBALS[
'TSFE']->absRefPrefix .
'typo3/sysext/frontend/Resources/Public/JavaScript/jsfunc.menu.js"></script>';
65 $GLOBALS[
'TSFE']->additionalJavaScript[
'JSCode'] .= $JScode;
70 $levelConf = $this->mconf[$a .
'.'];
71 $length = $levelConf[
'width'] ?: 14;
73 for ($b = 0; $b < $length; $b++) {
76 $height = $levelConf[
'elements'] ?: 5;
77 $formCode .=
'<select name="selector' . $a .
'" onchange="' . $this->JSMenuName .
'.act(' . $a .
');"' . ($levelConf[
'additionalParams'] ?
' ' . $levelConf[
'additionalParams'] :
'') .
'>';
78 for ($b = 0; $b < $height; $b++) {
79 $formCode .=
'<option value="0">';
81 $formCode .= $lengthStr;
83 $formCode .=
'</option>';
85 $formCode .=
'</select>';
86 $allFormCode .= $this->WMcObj->wrap($formCode, $levelConf[
'wrap']);
88 $formContent = $this->WMcObj->wrap($allFormCode, $this->mconf[
'wrap']);
89 $formCode =
'<form action="" method="post" style="margin: 0 0 0 0;" name="' . $this->JSMenuName .
'Form">' . $formContent .
'</form>';
90 $formCode .=
'<script type="text/javascript"> /*<![CDATA[*/ ' . $this->JSMenuName .
'.writeOut(1,' . $this->JSMenuName .
'.openID,1); /*]]>*/ </script>';
91 return $this->WMcObj->wrap($formCode, $this->mconf[
'wrapAfterTags']);
108 $count = (int)$count;
109 $levelConf = $this->mconf[$count .
'.'];
111 $mount_info = $this->sys_page->getMountPointInfo($pid);
112 if (is_array($mount_info)) {
114 $pid = $mount_info[
'mount_pid'];
121 $parent = $count === 1 ? 0 : $var . ($count - 1);
125 $menuItems = is_array($menuItemArray) ? $menuItemArray : $this->sys_page->getMenu($pid);
126 foreach ($menuItems as $uid => $data) {
130 if (array_key_exists(
'_MP_PARAM', $data) && $data[
'_MP_PARAM']) {
131 $MP_array_sub[] = $data[
'_MP_PARAM'];
134 $MP_var = implode(
',', $MP_array_sub);
135 $MP_params = $MP_var ?
'&MP=' . rawurlencode($MP_var) :
'';
139 if ($this->mconf[
'SPC'] || !$spacer) {
147 $title = $data[
'title'];
150 if (!$addLines && !$levelConf[
'noLink'] || $levelConf[
'alwaysLink']) {
151 $LD = $this->
menuTypoLink($data, $this->mconf[
'target'],
'',
'', array(), $MP_params, $this->mconf[
'forceTypeValue']);
155 $target = $LD[
'target'];
159 $active = $levelConf[
'showActive'] && $this->
isActive($data[
'uid'], $MP_var);
161 $first = !$c && $levelConf[
'showFirst'];
163 if ($active || $first) {
165 $codeLines .= LF . $menuName .
'.openID = ' . $var . $count .
';';
167 $codeLines .= LF . $menuName .
'.entry[' . $parent .
'].openID = ' . $var . $count .
';';
171 $codeLines .= $addLines;
172 $prev = $var . $count;
177 if ($this->mconf[
'firstLabelGeneral'] && !$levelConf[
'firstLabel']) {
178 $levelConf[
'firstLabel'] = $this->mconf[
'firstLabelGeneral'];
180 if ($levelConf[
'firstLabel'] && $codeLines) {