1) $menu_name = $r2; else $menu_name = $r1; //this is a one level menu, you can define your internal structure and define wich one appears on the menu $menus = array(); array_push($menus, array("key" => array("",""), "file" => "home", "title" => array("Home", "Home"), "menu" => "1", "base_page" => 1, "childs" => array())); //dynamic templates of a simple text template $templatetext = new AYSchema(); $templatetext->load(0,"Section"); $templatetext->setCurrentLanguage($_SESSION["lang"]); $sections = $templatetext = $templatetext->selectAll(array("active"), array(1), array("=")); $templatepage = new AYSchema(); $templatepage->load(0,"Page"); $templatepage->setCurrentLanguage($_SESSION["lang"]); for($i = 0; $i < sizeof($templatetext); $i++) { $childs = $templatepage->selectAll(array("active", "section_id"), array(1, $templatetext[$i]["id"])); array_push($menus, array("key" => array($templatetext[$i]["urlseo"],$templatetext[$i]["urlseo"]), "file" => "template_text", "title" => array($templatetext[$i]["title"],$templatetext[$i]["title"]), "menu" => $templatetext[$i]["is_menu"], "childs" => $childs, "section_id" => $templatetext[$i]["id"], "link" => $templatetext[$i]["link"])); } if(DOMAIN == "mohid") { array_push($menus, array("key" => array("regist","regist"), "file" => "regist", "title" => array("Novo Registo", "New Regist"), "menu" => "0", "childs" => array())); if(isset($_SESSION["login_id"]) && is_numeric($_SESSION["login_id"])) { array_push($menus, array("key" => array("downloads","downloads"), "file" => "template_text", "title" => array("Downloads", "Downloads"), "menu" => "1", "base_page" => 1, "childs" => array())); } else { array_push($menus, array("key" => array("downloads","downloads"), "file" => "home", "title" => array("Downloads", "Downloads"), "menu" => "1", "base_page" => 1, "childs" => array())); } } array_push($menus, array("key" => array("contacts","contacts"), "file" => "contacts", "title" => array("Contactos", "Contacts"), "menu" => "1", "base_page" => 1, "childs" => array())); array_push($menus, array("key" => array("search","search"), "file" => "search", "title" => array("Pesquisa", "Search"), "menu" => "0", "childs" => array())); array_push($menus, array("key" => array("logout","logout"), "file" => "logout", "title" => array("", ""), "menu" => "0", "childs" => array())); array_push($menus, array("key" => array("account-confirmation","account-confirmation"), "file" => "home", "title" => array("Home", "Home"), "menu" => "0", "childs" => array())); $change_lang = array(); array_push($change_lang, $langs); $menu_item = NULL; for($i = 0; $i < sizeof($menus); $i++) { if(parseLanguage($menus[$i]["key"]) == $menu_name) { $menu_item = $menus[$i]; break; } } if($menu_item == NULL) $menu_item = $menus[0]; array_push($change_lang, $menu_item["key"]); $file = $menu_item["file"]; $page = parseLanguage($menu_item["key"]); $page_title = parseLanguage($menu_item["title"]); $sitetags = new AYSchema(); $sitetags->load(0,"SiteMetatagsAnalytics"); $sitetags->setCurrentLanguage($_SESSION["lang"]); $sitetags_detail = $sitetags->selectFirst(); $site_title = $sitetags_detail["title"]; $site_description = $sitetags_detail["description"]; $site_keywords = $sitetags_detail["keywords"]; $schema_text = new AYSchema(); $schema_text->load(0,"Page"); $schema_text->setCurrentLanguage($_SESSION["lang"]); $pages = $schema_text->selectAll(array("active"), array("1")); ob_start(); if(file_exists("pages/".$file.".php")) include_once("pages/".$file.".php"); $contents = ob_get_clean(); ob_start(); if(file_exists("pages/header.php")) include_once("pages/header.php"); $header = ob_get_clean(); ob_start(); if(file_exists("pages/footer.php")) include_once("pages/footer.php"); $footer = ob_get_clean(); ?> <? echo $site_title; if($page_title != "") echo " - " . $page_title; ?> '; if(DOMAIN == "mohid") { ?> document.location.href="/' . $_SESSION["lang"] . '/regist";'; } ?>
'; ?>