\n';
if(document.getElementById){
if(this.config.useCookies) this.selectedwp_dtree_Node = this.getSelected();
str += this.addwp_dtree_Node(this.root);
} else str += 'Browser not supported.';
str += '
';
if(!this.selectedFound) this.selectedwp_dtree_Node = null;
this.completed = true;
return str;
};
// Creates the tree structure
wp_dTree.prototype.addwp_dtree_Node = function(pwp_dtree_Node){
var str = '';
var n=0;
if(this.config.inOrder) n = pwp_dtree_Node._ai;
for (n; n < this.awp_dtree_Nodes.length; n++){
if(this.awp_dtree_Nodes[n].pid == pwp_dtree_Node.id){
var cn = this.awp_dtree_Nodes[n];
cn._p = pwp_dtree_Node;
cn._ai = n;
this.setCS(cn);
if(!cn.target && this.config.target) cn.target = this.config.target;
if(cn._hc && !cn._io && this.config.useCookies) cn._io = this.isOpen(cn.id);
if(!this.config.folderLinks && cn._hc) cn.url = null;
if(this.config.useSelection && cn.id == this.selectedwp_dtree_Node && !this.selectedFound){
cn._is = true;
this.selectedwp_dtree_Node = n;
this.selectedFound = true;
}
str += this.node(cn, n);
if(cn._ls) break;
}
}
return str;
};
// Creates the node icon, url and text
wp_dTree.prototype.node = function(node, nodeId){
var str = '' + this.indent(node, nodeId);
if(this.config.useIcons){
if(!node.icon) node.icon = (this.root.id == node.pid) ? this.icon.root : ((node._hc) ? this.icon.folder : this.icon.node);
if(!node.iconOpen) node.iconOpen = (node._hc) ? this.icon.folderOpen : this.icon.node;
if(this.root.id != node.pid){
str += '
 ? node.iconOpen : node.icon) + ')
';
}
}
if(this.root.id != node.pid){
if(node.url){
str += '
';
str += this.addwp_dtree_Node(node);
str += '