<?
////////////////////////////////////////////////////
// Conciliación: gestión de conciliación de activos
// Version: 1.0
//
// Copyright (C) 2014  Eustotem Multimedia, S.L.
//
// License: MIT, see LICENSE
////////////////////////////////////////////////////


include("../conf/preferences.php");
session_name(SYS_APP_SESSNAME);
session_start();
include("../conf/langs/".$langs[$_SESSION['userlang']][0]."/MAIN.php");
include("../conf/connections.php");
include("../phplib/auth.php");
require_once("../phplib/Content.class.php");	// Debe ir antes de utils.php
require_once("../phplib/utils.php");
require_once("../core/plugins.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Menú principal</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../<? echo SYS_USER_STYLES_PATH ?>styles_menu.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" media="screen" href="../jslib/jq/ui/css/Aristo/jquery-ui.custom.css" id="ui_css" />
<script type="text/javascript" src="../jslib/jq/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="../jslib/jq/jquery.blockUI.js"></script>
<script type="text/javascript" src="../jslib/jq/ui/js/jquery-ui-1.8.21.custom.min.js"></script>
<script type="text/javascript" src="../jslib/jq/tree/jquery.jstree.js"></script>
<script type="text/javascript" src="../jslib/jq/jqexts.js"></script>
<style type="text/css">
.iconomenu{vertical-align:middle !important; border:none;}
.tree,.tree ul, .tree li.last,.jstree-classic.jstree-focused {	background-color:transparent !important;}
</style>

<script type="text/javascript">
var clh=true;	
$(document).ready(function () {
	$("#treediv").jstree({
		core: {"animation": 0},
		html_data:{ajax:{url: "XHR.menu.php?action=getMenu"}},
		themes: {"theme": "classic", "dots": false, "icons":false},
		plugins: ["html_data", "types", "themes", "ui", "hotkeys"]
	})
	$("#treediv").delegate("a","dblclick", function(e) {
		var a=$(this); var tipo=a.attr("rel");
		var idn = a.parent().attr("id").split("_")[1];
		if(tipo=="folder"){
			var lid=a.parent().attr("id");
			$("#treediv").jstree("toggle_node","#"+lid);
		}
	});
	$("#treediv").delegate("a","click", function(e) {
		if(clh==false) return;
		clh=false;
		t=setTimeout("clearTime()",1000);
		var a=$(this); var tipo=a.attr("rel");
		var idn = a.parent().attr("id").split("_")[1];
		if(tipo=="item"){
			if(a.attr("target")=="_blank"){
				window.open(a.attr("href"));
			}else{
				top[a.attr("target")].location.href=a.attr("href");
			}
		}
	});
});
function clearTime(){clh=true;}
</script>
</head>

<body>
<div id="pageBar">
	<h1>Navegación</h1>
</div>
<div style=" width:100%; overflow:hidden; margin:0; padding:0;">
<div id="treewrapper">
	<div id="treediv"> </div>
</div>
</div>
</body>
</html>
