//new Image().src="/php/drzewo/img/base.gif"; new Image().src="/php/drzewo/img/empty.gif"; new Image().src="/php/drzewo/img/folder.gif"; new Image().src="/php/drzewo/img/folderopen.gif"; new Image().src="/php/drzewo/img/join.gif"; new Image().src="/php/drzewo/img/joinbottom.gif"; new Image().src="/php/drzewo/img/line.gif"; new Image().src="/php/drzewo/img/minus.gif"; new Image().src="/php/drzewo/img/minusbottom.gif"; new Image().src="/php/drzewo/img/nolines_minus.gif"; new Image().src="/php/drzewo/img/nolines_plus.gif"; new Image().src="/php/drzewo/img/page.gif"; new Image().src="/php/drzewo/img/plus.gif"; new Image().src="/php/drzewo/img/plusbottom.gif"; document.getElementById('tree').style.display="none"; function czyscXML(n) { var i=0; if (!n.hasChildNodes()) return; while(n.childNodes[i]) { czyscXML(n.childNodes[i]); if (n.childNodes[i].nodeType==3 && n.childNodes[i].nodeValue.replace(/(\r|\n|\t|^ *| *$)/g,'')=='') { n.removeChild(n.childNodes[i]); i--; } i++; } } licznik=0; function wypiszXML(n, poziom, l) { var i=0; if (!n.hasChildNodes()) return; while(n.childNodes[i]) { if (n.childNodes[i].nodeName=="#text" && n.childNodes[i].nodeValue!=null) { link = n.childNodes[i].parentNode.getAttribute('href'); mysql.add(licznik,l,n.childNodes[i].nodeValue,link); licznik++; l = licznik-1; } poziom++; wypiszXML(n.childNodes[i],poziom, l); poziom--; i++; } } /*--------------------------------------------------| | dTree 2.05 | www.destroydrop.com/javascript/tree/ | |---------------------------------------------------| | Copyright (c) 2002-2003 Geir Landrö | | | | This script can be used freely as long as all | | copyright messages are intact. | | | | Updated: 17.04.2003 | |--------------------------------------------------*/ // Node object function Node(id, pid, name, url, title, target, icon, iconOpen, open) { this.id = id; this.pid = pid; this.name = name; this.url = url; this.title = title; this.target = target; this.icon = icon; this.iconOpen = iconOpen; this._io = open || false; this._is = false; this._ls = false; this._hc = false; this._ai = 0; this._p; }; // Tree object function dTree(objName) { this.config = { target : null, folderLinks : false, useSelection : false, useCookies : true, useLines : true, useIcons : true, useStatusText : false, closeSameLevel : false, inOrder : false } this.icon = { root : '/php/drzewo/img/p.gif', folder : '/php/drzewo/img/folder.gif', folderOpen : '/php/drzewo/img/folderopen.gif', node : '/php/drzewo/img/page.gif', empty : '/php/drzewo/img/empty.gif', line : '/php/drzewo/img/line.gif', join : '/php/drzewo/img/join.gif', joinBottom : '/php/drzewo/img/joinbottom.gif', plus : '/php/drzewo/img/plus.gif', plusBottom : '/php/drzewo/img/plusbottom.gif', minus : '/php/drzewo/img/minus.gif', minusBottom : '/php/drzewo/img/minusbottom.gif', nlPlus : '/php/drzewo/img/nolines_plus.gif', nlMinus : '/php/drzewo/img/nolines_minus.gif' }; this.obj = objName; this.aNodes = []; this.aIndent = []; this.root = new Node(-1); this.selectedNode = null; this.selectedFound = false; this.completed = false; }; // Adds a new node to the node array dTree.prototype.add = function(id, pid, name, url, title, target, icon, iconOpen, open) { this.aNodes[this.aNodes.length] = new Node(id, pid, name, url, title, target, icon, iconOpen, open); }; // Open/close all nodes dTree.prototype.openAll = function() { this.oAll(true); }; dTree.prototype.closeAll = function() { this.oAll(false); }; // Outputs the tree to the page dTree.prototype.toString = function() { var str = '
| '; } str += node.name; if (this.root.id == node.pid) { str +=' | otwórz wszystkie • zamknij wszystkie |