44 $this->levels = $levels;
46 $this->JSVarName =
'eid' . $uniqueParam;
47 $this->JSMenuName = $this->mconf[
'menuName'] ?:
'JSmenu' . $uniqueParam;
49 var ' . $this->JSMenuName .
' = new JSmenu(' . $levels .
', \'' . $this->JSMenuName .
'Form\');';
50 for ($a = 1; $a <= $levels; $a++) {
52 var ' . $this->JSVarName . $a .
'=0;';
54 $JScode .= $this->
generate_level($levels, 1, $this->
id, $this->menuArr, $this->MP_array) . LF;
55 $GLOBALS[
'TSFE']->additionalHeaderData[
'JSMenuCode'] =
'<script type="text/javascript" src="' .
$GLOBALS[
'TSFE']->absRefPrefix .
'typo3/sysext/frontend/Resources/Public/JavaScript/jsfunc.menu.js"></script>';
56 $GLOBALS[
'TSFE']->additionalJavaScript[
'JSCode'] .= $JScode;
59 for ($a = 1; $a <= $this->levels; $a++) {
61 $levelConf = $this->mconf[$a .
'.'];
62 $length = $levelConf[
'width'] ?: 14;
64 for ($b = 0; $b < $length; $b++) {
67 $height = $levelConf[
'elements'] ?: 5;
68 $formCode .=
'<select name="selector' . $a .
'" onchange="' . $this->JSMenuName .
'.act(' . $a .
');"' . ($levelConf[
'additionalParams'] ?
' ' . $levelConf[
'additionalParams'] :
'') .
'>';
69 for ($b = 0; $b < $height; $b++) {
70 $formCode .=
'<option value="0">';
72 $formCode .= $lengthStr;
74 $formCode .=
'</option>';
76 $formCode .=
'</select>';
77 $allFormCode .= $this->tmpl->wrap($formCode, $levelConf[
'wrap']);
79 $formCode = $this->tmpl->wrap($allFormCode, $this->mconf[
'wrap']);
80 $formCode =
'<form action="" method="post" style="margin: 0 0 0 0;" name="' . $this->JSMenuName .
'Form">' . $formCode .
'</form>';
81 $formCode .=
'<script type="text/javascript"> /*<![CDATA[*/ ' . $this->JSMenuName .
'.writeOut(1,' . $this->JSMenuName .
'.openID,1); /*]]>*/ </script>';
82 return $this->tmpl->wrap($formCode, $this->mconf[
'wrapAfterTags']);
100 $levelConf = $this->mconf[$count .
'.'];
102 $mount_info = $this->sys_page->getMountPointInfo($pid);
103 if (is_array($mount_info)) {
105 $pid = $mount_info[
'mount_pid'];
110 $var = $this->JSVarName;
111 $menuName = $this->JSMenuName;
112 $parent = $count == 1 ? 0 : $var . ($count - 1);
116 $menuItems = is_array($menuItemArray) ? $menuItemArray : $this->sys_page->getMenu($pid);
117 foreach ($menuItems as
$uid => $data) {
121 if (array_key_exists(
'_MP_PARAM', $data) && $data[
'_MP_PARAM']) {
122 $MP_array_sub[] = $data[
'_MP_PARAM'];
125 $MP_var = implode(
',', $MP_array_sub);
126 $MP_params = $MP_var ?
'&MP=' . rawurlencode($MP_var) :
'';
130 if ($this->mconf[
'SPC'] || !$spacer) {
133 if ($count < $levels) {
134 $addLines = $this->
generate_level($levels, $count + 1, $data[
'uid'],
'', $MP_array_sub);
138 $title = $data[
'title'];
141 if (!$addLines && !$levelConf[
'noLink'] || $levelConf[
'alwaysLink']) {
142 $LD = $this->
menuTypoLink($data, $this->mconf[
'target'],
'',
'', array(), $MP_params, $this->mconf[
'forceTypeValue']);
145 $url =
$GLOBALS[
'TSFE']->baseUrlWrap($LD[
'totalURL']);
146 $target = $LD[
'target'];
150 $active = $levelConf[
'showActive'] && $this->
isActive($data[
'uid'], $MP_var);
152 $first = !$c && $levelConf[
'showFirst'];
154 if ($active || $first) {
156 $codeLines .= LF . $menuName .
'.openID = ' . $var . $count .
';';
158 $codeLines .= LF . $menuName .
'.entry[' . $parent .
'].openID = ' . $var . $count .
';';
162 $codeLines .= $addLines;
163 $prev = $var . $count;
168 if ($this->mconf[
'firstLabelGeneral'] && !$levelConf[
'firstLabel']) {
169 $levelConf[
'firstLabel'] = $this->mconf[
'firstLabelGeneral'];
171 if ($levelConf[
'firstLabel'] && $codeLines) {
static forceIntegerInRange($theInt, $min, $max=2000000000, $defaultValue=0)
static quoteJSvalue($value)
static shortMD5($input, $len=10)
static inArray(array $in_array, $item)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
static inList($list, $item)