1
<cfsetting enablecfoutputonly="yes">
2
<cfparam name="attributes.width" default="100%">
3
<cfparam name="attributes.height" default="100%">
4
<cfparam name="attributes.name" default="t#left(replace(CreateUUID(),'-','','All'),15)#">
5
<cfparam name="attributes.JSPath" default="js/">
6
<cfparam name="attributes.CSSPath" default="css/">
7
<cfparam name="attributes.iconspath" default="imgs/">
8
<cfparam name="attributes.xmldoc" default="">
9
<cfparam name="attributes.checkboxes" default="none"> <!--- [ Scand: none, twoState, threeState ] --->
10
<cfparam name="attributes.dragndrop" default="false">
11
<cfparam name="attributes.style" default="background-color:whitesmoke;border:1px solid blue;">
12
<cfparam name="attributes.onSelect" default="">
13
<cfparam name="attributes.onDrop" default="">
14
<cfparam name="attributes.onCheck" default="">
15
<cfparam name="attributes.xmlFile" default="">
17
<cfparam name="attributes.im1" default="">
18
<cfparam name="attributes.im2" default="">
19
<cfparam name="attributes.im3" default="">
21
<cfif not ThisTag.HasEndTag>
22
<cfabort showerror="You need to supply a closing <CF_dhtmlXTree> tag.">
25
<cfif ThisTag.ExecutionMode is "End">
26
<cfsavecontent variable="treeOutput">
28
<cfif not isDefined("request.dhtmlXTreeScriptsInserted")>
29
<link rel="STYLESHEET" type="text/css" href="#attributes.CSSPath#dhtmlXTree.css">
30
<script src="#attributes.JSPath#dhtmlXCommon.js"></script>
31
<script src="#attributes.JSPath#dhtmlXTree.js"></script>
32
<cfset request.dhtmlXTreeScriptsInserted=1>
34
<div id="treebox_#attributes.name#" style="width:#attributes.width#; height:#attributes.height#; overflow:auto; #attributes.style#"></div>
36
function drawTree#attributes.name#(){
37
#attributes.name#=new dhtmlXTreeObject('treebox_#attributes.name#',"100%","100%",0);
38
#attributes.name#.setImagePath("#attributes.iconspath#");
39
<cfswitch expression="#attributes.checkboxes#">
40
<cfcase value="twoState">
41
#attributes.name#.enableCheckBoxes(true)
42
#attributes.name#.enableThreeStateCheckboxes(false);
44
<cfcase value="threeState">
45
#attributes.name#.enableCheckBoxes(true)
46
#attributes.name#.enableThreeStateCheckboxes(true);
49
#attributes.name#.enableCheckBoxes(false)
50
#attributes.name#.enableThreeStateCheckboxes(false);
53
<cfif len(attributes.onSelect)>
54
#attributes.name#.setOnClickHandler("#attributes.onSelect#");
56
<cfif len(attributes.onCheck)>
57
#attributes.name#.setOnCheckHandler("#attributes.onCheck#");
59
<cfif len(attributes.onDrop)>
60
#attributes.name#.setDragHandler("#attributes.onDrop#");
62
#attributes.name#.enableDragAndDrop(#attributes.dragndrop#)
63
<cfif (len(attributes.im1) or len(attributes.im2)) or len(attributes.im3)>
64
#attributes.name#.setStdImages("#attributes.im1#","#attributes.im2#","#attributes.im3#");
66
<cfif len(attributes.xmlFile)>
67
#attributes.name#.setXMLAutoLoading("#attributes.xmlFile#");
68
#attributes.name#.loadXML("#attributes.xmlFile#")
70
<cfif Len(Trim(ThisTag.GeneratedContent))>
71
#attributes.name#.loadXMLString("<?xml version='1.0'?><tree id='0'>#replace(replace(ThisTag.GeneratedContent,'"',"'","ALL"),"#chr(13)##chr(10)#","","ALL")#</tree>")
74
window.setTimeout("drawTree#attributes.name#()",100);
80
<cfset ThisTag.GeneratedContent = treeOutput>
82
<cfsetting enablecfoutputonly="no">
b'\\ No newline at end of file'