MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
mtree.class
Ir para a documentação deste ficheiro.
1
<?php
2
// +-----------------------------------------------------------------+
3
// | MIOLO - Miolo Development Team - UNIVATES Centro Universitário |
4
// +-----------------------------------------------------------------+
5
// | CopyLeft (L) 2001-2002 UNIVATES, Lajeado/RS - Brasil |
6
// +-----------------------------------------------------------------+
7
// | Licensed under GPL: see COPYING.TXT or FSF at www.fsf.org for |
8
// | further details |
9
// | |
10
// | Site: http://miolo.codigolivre.org.br |
11
// | E-mail: vgartner@univates.br |
12
// | ts@interact2000.com.br |
13
// +-----------------------------------------------------------------+
14
// | Abstract: |
15
// | |
16
// | Created: 2001/08/14 Thomas Spriestersbach |
17
// | Vilson Cristiano Gärtner, |
18
// | |
19
// | History: Initial Revision |
20
// +-----------------------------------------------------------------+
21
26
class
MTree
27
{
31
var
$root
;
// an array of arrays of tree nodes
32
43
function
__construct
()
44
{
45
}
46
61
function
AddItem
(
$id
, $parent, $data)
62
{
63
if
(!$parent)
64
$parent =
$this->root
;
65
66
$node =
FindNode
($this->root, $parent);
67
}
68
72
function
&
FindNode
($parent,
$id
)
73
{
74
if
(!$parent)
75
return
null
;
76
77
foreach
($parent as $key => $data)
78
{
79
if
($key ==
$id
)
80
return
$data;
81
82
$node = $this->
FindNode
($data);
83
84
if
($node)
85
return
$node;
86
}
87
88
return
null
;
89
}
90
101
function
Generate
()
102
{
103
}
104
}
105
?>
MTree
Definição
mtree.class:27
MTree\__construct
__construct()
Definição
mtree.class:43
MTree\Generate
Generate()
Definição
mtree.class:101
MTree\$root
$root
Definição
mtree.class:31
MTree\FindNode
& FindNode($parent, $id)
Definição
mtree.class:72
MTree\AddItem
AddItem($id, $parent, $data)
Definição
mtree.class:61
$id
$id
Definição
base.php:5
classes
utils
mtree.class
Gerado por
1.10.0