function wsMenuGen($data) { global $DropdownMenuText, $level, $SITE, $menuArray, $extraP, $lang, $pathString; foreach ($data->item as $menuItem) { $Show = true; // default every xml-menu setting is shown if (isset($menuItem['show'])) { # show can be (1) 'yes/'no' or (2) true/false or (3) a reference to a $SITE setting which can be (1) 'yes/'no' or (2) true/false (3) if ($menuItem['show'] == false) { continue; } if (trim($menuItem['show']) == 'no') { continue; } $string = strval($menuItem['show']); if (isset($SITE[$string])) { if ($SITE[$string] === false || $SITE[$string] === 'no') { continue; } } // eo check sitestring } // eo check if this menu item be shown to the visitor # for ($i = 1; $i <= $level; $i++) { $DropdownMenuText .= "\t"; } // number of tabs if (isset($SITE['skipTop']) && $SITE['skipTop']) { $top = '#data-area'; } else { $top = ''; } if (isset($menuItem['top'])) { $string = trim($menuItem['top']); if ($menuItem['top'] == false) { $top = ''; } elseif ($string == 'no') { $top = ''; } else { $top = '#' . $string; } } if (!isset($menuItem['title'])) { $menuTitle = $menuItem['caption']; } else { $menuTitle = $menuItem['title']; } $img = ''; if (isset($menuItem['img'])) { $img = trim((string) $menuItem['img']); if ($img == 'updated') { $img = 'img/menu_updated.gif'; } elseif ($img == 'new') { $img = 'img/menu_new.gif'; } $img = ' <img src ="' . $img . '" alt=" ">'; } if (!isset($menuItem['link'])) { // submenuheaders have no link specified $DropdownMenuText .= '<li class="withImg"> <a href="#" title="' . langtransstr($menuTitle) . '">' . langtransstr($menuItem['caption']) . $img . '</a>' . PHP_EOL; for ($i = 1; $i <= $level; $i++) { $DropdownMenuText .= ' '; } // number of tabs $DropdownMenuText .= ' <ul>' . PHP_EOL; // new ul group $level = $level + 1; // extra tab in new level $data2 = $menuItem; // wsMenuGen($data2); // this function calls itself for nested menu levels for ($i = 1; $i <= $level; $i++) { $DropdownMenuText .= ' '; } $DropdownMenuText .= '</ul>' . PHP_EOL; // end new ul group $level = $level - 1; // back 1 level for ($i = 1; $i <= $level; $i++) { $DropdownMenuText .= ' '; } $DropdownMenuText .= '</li>' . PHP_EOL; } else { $nr = (string) $menuItem['nr']; if (isset($SITE['noChoice']) && $SITE['noChoice'] == $nr) { $top = ''; } $menuArray[$nr]['choice'] = trim((string) $menuItem['nr']); $menuArray[$nr]['css'] = trim((string) $menuItem['css']); $menuArray[$nr]['head'] = trim((string) $menuItem['head']); $menuArray[$nr]['show'] = trim((string) $menuItem['show']); $tekst = trim((string) $menuItem['folder']); if ($tekst == '') { $menuArray[$nr]['folder'] = ''; } else { $menuArray[$nr]['folder'] = $tekst; } $tekst = trim((string) $menuItem['gizmo']); if ($tekst == '' || $tekst == '0' || $tekst == 'no' || $tekst == 'false') { $menuArray[$nr]['gizmo'] = false; } else { $menuArray[$nr]['gizmo'] = true; } $link_string = trim((string) $menuItem['link']); $menuArray[$nr]['link'] = $link_string; $arr = explode('/', $link_string); $end = count($arr) - 1; list($pagename, $type) = explode('.', $arr[$end]); # echo $link_string; print_r ($arr); $SITE['pages'][$pagename] = 'index.php?p=' . $menuArray[$nr]['choice']; $menuArray[$nr]['noutf8'] = trim((string) $menuItem['noutf8']); $menuArray[$nr]['title'] = trim((string) $menuTitle); $DropdownMenuText .= '<li><a href="index.php?p=' . $nr . '&lang=' . $lang . $extraP . $top . '" title="' . langtransstr($menuTitle) . '">' . langtransstr($menuItem['caption']) . $img . '</a></li>' . PHP_EOL; } // eof link aanwezig of niveau dieper } // eof foreach }
} if ($SITE['charset'] == 'UTF-8' && $noutf8 != '') { // test for: noutf8 = "WINDOWS-1252" $SITE['charset'] = $noutf8; // generate page in requested character set ini_set('default_charset', $SITE['charset']); $LANGLOOKUP = array(); // clean arrays with utf-8 language data $missingTrans = array(); $dir = $SITE['langDir']; langMergeFile($dir); // reload lang files with nonutf8 data $menuArray = array(); $DropdownMenuText = ''; $level = 1; wsMenuGen($xmlStr); // generate new menu files } unset($xmlStr); # $SITE['pageRequest'] = $p . '|' . $link; #----------------------------------------------------------------------------------------- # generate headers and first part of page #----------------------------------------------------------------------------------------- if (!isset($lang)) { $lang = $SITE['lang']; } header('Vary: User-Agent'); header("Content-Type: text/html; charset=" . strtoupper($SITE['charset'])); echo '<!DOCTYPE html> <html lang="' . $lang . '">