Ejemplo n.º 1
0
function grow_dhtml_trees_export($fp,$tree_id) {
	global $colors, $config;
	include_once($config["library_path"] . "/tree.php");
	include_once($config["library_path"] . "/data_query.php");

	fwrite($fp, "<script type=\"text/javascript\">");
	fwrite($fp,"<!--
			USETEXTLINKS = 1
			STARTALLOPEN = 0
			USEFRAMES = 0
			USEICONS = 0
			WRAPTEXT = 1
			PERSERVESTATE = 1
			HIGHLIGHT = 1\n");

	$dhtml_tree = create_dhtml_tree_export($tree_id);

	$total_tree_items = sizeof($dhtml_tree) - 1;
	for ($i = 2; $i <= $total_tree_items; $i++) {
		fwrite($fp,$dhtml_tree[$i]);
	}

	fwrite($fp,"foldersTree.treeID = \"t2\"
			//-->\n
			</script>\n");
}
Ejemplo n.º 2
0
function grow_dhtml_trees_export($fp, $tree_id)
{
    global $colors, $config;
    include_once $config["library_path"] . "/tree.php";
    include_once $config["library_path"] . "/data_query.php";
    fwrite($fp, "<script type='text/javascript'>\n");
    fwrite($fp, "<!--\n\t\t\tUSETEXTLINKS = 1\n\t\t\tSTARTALLOPEN = 0\n\t\t\tUSEFRAMES = 0\n\t\t\tUSEICONS = 0\n\t\t\tWRAPTEXT = 1\n\t\t\tICONPATH = 'treeview/'\n\t\t\tPERSERVESTATE = 1\n\t\t\tHIGHLIGHT = 1\n");
    if (read_config_option("export_tree_isolation") == "off") {
        $dhtml_tree_base = 0;
    } else {
        $dhtml_tree_base = $tree_id;
    }
    $dhtml_tree = create_dhtml_tree_export($dhtml_tree_base);
    $total_tree_items = sizeof($dhtml_tree) - 1;
    for ($i = 2; $i <= $total_tree_items; $i++) {
        fwrite($fp, $dhtml_tree[$i]);
    }
    fwrite($fp, "foldersTree.treeID = \"t2\"\n\t\t\t//-->\n\n\t\t\t</script>\n");
}
Ejemplo n.º 3
0
function grow_dhtml_trees_export($fp, $tree_id)
{
    global $colors, $config, $dhtml_trees;
    include_once $config["library_path"] . "/tree.php";
    include_once $config["library_path"] . "/data_query.php";
    fwrite($fp, "<script type='text/javascript'>\n");
    fwrite($fp, "<!--\n\t\t\tUSETEXTLINKS = 1\n\t\t\tSTARTALLOPEN = 0\n\t\t\tUSEFRAMES = 0\n\t\t\tUSEICONS = 0\n\t\t\tWRAPTEXT = 1\n\t\t\tICONPATH = 'treeview/'\n\t\t\tPERSERVESTATE = 1\n\t\t\tHIGHLIGHT = 1\n");
    if (read_config_option("export_tree_isolation") == "off") {
        $dhtml_tree_base = 0;
    } else {
        $dhtml_tree_base = $tree_id;
    }
    if (!isset($dhtml_trees[$dhtml_tree_base])) {
        $dhtml_tree = create_dhtml_tree_export($dhtml_tree_base);
        $dhtml_trees[$dhtml_tree_base] = $dhtml_tree;
    } else {
        $dhtml_tree = $dhtml_trees[$dhtml_tree_base];
    }
    foreach ($dhtml_tree as $key => $item) {
        if ($key > 1) {
            fwrite($fp, $item);
        }
    }
    fwrite($fp, "foldersTree.treeID = \"t2\"\n\t\t\t//-->\n\n\t\t\t</script>\n");
}
Ejemplo n.º 4
0
function grow_dhtml_trees_export($fp, $tree_id, $node)
{
    global $config, $dhtml_trees;
    include_once $config["library_path"] . "/tree.php";
    include_once $config["library_path"] . "/data_query.php";
    fwrite($fp, "\t<div id=\"jstree\">\n");
    if (read_config_option("export_tree_isolation") == "off") {
        $dhtml_tree_base = 0;
    } else {
        $dhtml_tree_base = $tree_id;
    }
    if (!isset($dhtml_trees[$dhtml_tree_base])) {
        $dhtml_tree = create_dhtml_tree_export($dhtml_tree_base);
        $dhtml_trees[$dhtml_tree_base] = $dhtml_tree;
    } else {
        $dhtml_tree = $dhtml_trees[$dhtml_tree_base];
    }
    foreach ($dhtml_tree as $key => $item) {
        if ($key > 1) {
            fwrite($fp, $item);
        }
    }
    fwrite($fp, "</div>\n");
    fwrite($fp, "<script type=\"text/javascript\">\n");
    fwrite($fp, "\n\t\t//var node='{$node}';\n\t\tvar node='';\n\n\t\tif (node == '') {\n\t\t\tnode = basename(document.location.pathname, '.html');\n\t\t}\n\n\t\tfunction basename(path, suffix) {\n\t\t\tvar b = path;\n\t\t\tvar lastChar = b.charAt(b.length - 1);\n\n\t\t\tif (lastChar === '/' || lastChar === '\\\\') {\n\t\t\t\tb = b.slice(0, -1);\n\t\t\t}\n\n\t\t\tb = b.replace(/^.*[\\/\\\\]/g, '');\n\n\t\t\tif (typeof suffix === 'string' && b.substr(b.length - suffix.length) == suffix) {\n\t\t\t\tb = b.substr(0, b.length - suffix.length);\n\t\t\t}\n\n\t\t\treturn b;\n\t\t}\n\n\t\t\$(function () {\n\t\t\t\$('#navigation').css('height', (\$(window).height()-80)+'px');\n\t\t\t\$(window).resize(function() {\n\t\t\t\t\$('#navigation').css('height', (\$(window).height()-80)+'px');\n\t\t\t});\n\n\t\t\t\$('#jstree')\n\t\t\t.on('ready.jstree', function(e, data) {\n\t\t\t\tif (node!='') {\n\t\t\t\t\t\$('#jstree').jstree('set_theme', 'default', './js/themes/default/style.css');\n\t\t\t\t\tif (node.substring(0,6) != 'graph_') {\n\t\t\t\t\t\t\$('#jstree').jstree('deselect_all', node);\n\t\t\t\t\t\t\$('#jstree').jstree('select_node', node);\n\t\t\t\t\t\t\$('#jstree').jstree('save_state');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('set_state.jstree', function(e, data) {\n\t\t\t\tif (node.substring(0,6) != 'graph_') {\n\t\t\t\t\t\$('#jstree').jstree('deselect_all', node);\n\t\t\t\t\t\$('#jstree').jstree('select_node', node);\n\t\t\t\t\t\$('#jstree').jstree('save_state');\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on('activate_node.jstree', function(e, data) {\n\t\t\t\tif (data.node.id) {\n\t\t\t\t\tdocument.location = \$('#'+data.node.id+' > a').attr('href');\n\t\t\t\t}\n\t\t\t})\n\t\t\t.jstree({\n\t\t\t\t'core' : {\n\t\t\t\t\t'animation' : 0\n\t\t\t\t},\n\t\t\t\t'themes' : {\n\t\t\t\t\t'name' : 'default',\n\t\t\t\t\t'responsive' : true,\n\t\t\t\t\t'url' : true,\n\t\t\t\t\t'dots' : true\n\t\t\t\t},\n\t\t\t\t'plugins' : [ 'state', 'wholerow' ]\n\t\t\t});\n\t\t});\n");
    fwrite($fp, "\t\t</script>\n");
    fwrite($fp, "\t</div>\n");
}