3
** Copyright (C) 2000-2005 SIA Zabbix
5
** This program is free software; you can redistribute it and/or modify
6
** it under the terms of the GNU General Public License as published by
7
** the Free Software Foundation; either version 2 of the License, or
8
** (at your option) any later version.
10
** This program is distributed in the hope that it will be useful,
11
** but WITHOUT ANY WARRANTY; without even the implied warranty of
12
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
** GNU General Public License for more details.
15
** You should have received a copy of the GNU General Public License
16
** along with this program; if not, write to the Free Software
17
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
// JavaScript Document
20
var IE = document.all?true:false;
21
var OP = window.opera?true:false;
26
if((tree_init = cookie.read(tree_name)) != null){
27
var nodes = tree_init.split('.');
28
var c = nodes.length-1;
29
for(var i=0; i<c;i++){
30
this.onStartSetStatus(nodes[i]);
32
this.onStartOpen(nodes);
36
getNodeStatus : function(id){
38
if(treenode[id].status == 'close'){
48
ChangeNodeStatus : function(id){
50
if(treenode[id].status == 'close'){
51
treenode[id].status = 'open';
53
treenode[id].status = 'close';
56
for(var i = 1; i < treenode.length; i++){
57
if(typeof(treenode[i]) != 'undefined'){
58
if(treenode[i].status == 'open'){
63
cookie.create(tree_name,cookie_str);
65
IE?(alert(e.description)):(alert(e));
70
closeSNodeX : function(id,img){
72
nodelist = treenode[id].nodelist.split('.');
73
if(this.getNodeStatus(id) == 'close'){
74
this.OpenNode(nodelist);
75
img.src = 'images/general/tree/'+img.name.toUpperCase()+'.gif';
77
this.CloseNode(nodelist);
78
img.src = 'images/general/tree/'+img.name.toUpperCase()+'c.gif';
80
this.ChangeNodeStatus(id);
82
// alert('closeSNodeX: '+e);
87
OpenNode : function(nodelist){
89
var c = nodelist.length-1;
90
for(var i=0; i<c; i++){
91
document.getElementById(nodelist[i]).style.display = (!IE || OP)?("table-row"):('block');
92
if(this.getNodeStatus(nodelist[i]) == 'open'){
93
this.OpenNode(treenode[nodelist[i]].nodelist.split('.'));
97
// alert('OpenNode: '+e);
101
CloseNode : function(nodelist){
103
var c = nodelist.length-1;
104
for(var i=0; i<c; i++){
105
document.getElementById(nodelist[i]).style.display = 'none';
106
if(this.getNodeStatus(nodelist[i]) == 'open'){
107
this.CloseNode(treenode[nodelist[i]].nodelist.split('.'));
111
// alert('CloseNode: '+e);
115
onStartOpen : function(nodes){
116
var nodes = tree_init.split('.');
117
var c = nodes.length-1;
118
for(var i=0; i<c;i++){
119
if(typeof(nodes[i]) != 'undefined'){
121
// alert(nodes[i]+' : '+this.checkParent(nodes[i]));
122
if(this.checkParent(nodes[i])){
123
var nodelist = treenode[nodes[i]].nodelist.split('.');
124
this.OpenNode(nodelist);
127
cookie.erase(tree_name);
128
// alert('OnStartOpen: '+e);
134
onStartSetStatus : function(id){
136
if(typeof(treenode[id]) == 'undefined') return;
138
var img = document.getElementById(img_id);
139
img.src = 'images/general/tree/'+img.name.toUpperCase()+'.gif';
141
treenode[id].status = 'open';
143
// alert('OnStartSetStatus: '+e);
147
checkParent : function(id){
152
} else if(typeof(treenode[id]) == 'undefined'){
154
} else if(treenode[id].status != 'open'){
157
return this.checkParent(treenode[id].parentid);
160
// alert('checkPparent: '+e);
3
** Copyright (C) 2000-2005 SIA Zabbix
5
** This program is free software; you can redistribute it and/or modify
6
** it under the terms of the GNU General Public License as published by
7
** the Free Software Foundation; either version 2 of the License, or
8
** (at your option) any later version.
10
** This program is distributed in the hope that it will be useful,
11
** but WITHOUT ANY WARRANTY; without even the implied warranty of
12
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
** GNU General Public License for more details.
15
** You should have received a copy of the GNU General Public License
16
** along with this program; if not, write to the Free Software
17
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
// JavaScript Document
20
var IE = document.all?true:false;
21
var OP = window.opera?true:false;
26
if((tree_init = cookie.read(tree_name)) != null){
27
var nodes = tree_init.split('.');
28
var c = nodes.length-1;
29
for(var i=0; i<c;i++){
30
this.onStartSetStatus(nodes[i]);
32
this.onStartOpen(nodes);
36
getNodeStatus : function(id){
38
if(treenode[id].status == 'close'){
48
ChangeNodeStatus : function(id){
50
if(treenode[id].status == 'close'){
51
treenode[id].status = 'open';
53
treenode[id].status = 'close';
56
for(var i = 1; i < nodeid_list.length; i++){
57
if(typeof(treenode[nodeid_list[i]]) != 'undefined'){
58
if(treenode[nodeid_list[i]].status == 'open'){
59
cookie_str+=nodeid_list[i]+'.';
63
cookie.create(tree_name,cookie_str);
65
// IE?(alert(e.description)):(alert(e));
70
closeSNodeX : function(id,img){
72
nodelist = treenode[id].nodelist.split('.');
73
if(this.getNodeStatus(id) == 'close'){
74
this.OpenNode(nodelist);
75
img.src = 'images/general/tree/'+img.name.toUpperCase()+'.gif';
77
this.CloseNode(nodelist);
78
img.src = 'images/general/tree/'+img.name.toUpperCase()+'c.gif';
80
this.ChangeNodeStatus(id);
82
// alert('closeSNodeX: '+e);
87
OpenNode : function(nodelist){
89
var c = nodelist.length-1;
90
for(var i=0; i<c; i++){
91
document.getElementById(nodelist[i]).style.display = (!IE || OP)?("table-row"):('block');
92
if(this.getNodeStatus(nodelist[i]) == 'open'){
93
this.OpenNode(treenode[nodelist[i]].nodelist.split('.'));
97
// alert('OpenNode: '+e);
101
CloseNode : function(nodelist){
103
var c = nodelist.length-1;
104
for(var i=0; i<c; i++){
105
document.getElementById(nodelist[i]).style.display = 'none';
106
if(this.getNodeStatus(nodelist[i]) == 'open'){
107
this.CloseNode(treenode[nodelist[i]].nodelist.split('.'));
111
// alert('CloseNode: '+e);
115
onStartOpen : function(nodes){
116
var nodes = tree_init.split('.');
117
var c = nodes.length-1;
118
for(var i=0; i<c;i++){
119
if(typeof(nodes[i]) != 'undefined'){
121
// alert(nodes[i]+' : '+this.checkParent(nodes[i]));
122
if(this.checkParent(nodes[i])){
123
var nodelist = treenode[nodes[i]].nodelist.split('.');
124
this.OpenNode(nodelist);
127
cookie.erase(tree_name);
128
// alert('OnStartOpen: '+e);
134
onStartSetStatus : function(id){
136
if(typeof(treenode[id]) == 'undefined') return;
138
var img = document.getElementById(img_id);
139
img.src = 'images/general/tree/'+img.name.toUpperCase()+'.gif';
141
treenode[id].status = 'open';
143
// alert('OnStartSetStatus: '+e);
147
checkParent : function(id){
152
} else if(typeof(treenode[id]) == 'undefined'){
154
} else if(treenode[id].status != 'open'){
157
return this.checkParent(treenode[id].parentid);
160
// alert('checkPparent: '+e);