mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-03 20:14:52 +02:00
minor fix
Former-commit-id: 1ccd9e446645362fb9b305a699527c5aa2c20369
This commit is contained in:
parent
bc1195e78e
commit
a4c048dd29
@ -1980,41 +1980,49 @@ class NetworkMap
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search for relations.
|
if (!$this->relations) {
|
||||||
foreach ($this->nodes as $k => $item) {
|
// Search for relations.
|
||||||
$target = $this->calculateRelations($k);
|
foreach ($this->nodes as $k => $item) {
|
||||||
|
$target = $this->calculateRelations($k);
|
||||||
|
|
||||||
// Adopt all orphan nodes but pandora one.
|
// Adopt all orphan nodes but pandora one.
|
||||||
if (empty($target)) {
|
if (empty($target)) {
|
||||||
if (isset($this->noPandoraNode) === false
|
if (isset($this->noPandoraNode) === false
|
||||||
|| $this->noPandoraNode == false
|
|| $this->noPandoraNode == false
|
||||||
) {
|
) {
|
||||||
if ($item['id_node'] != 0) {
|
if ($item['id_node'] != 0) {
|
||||||
$rel = [];
|
$rel = [];
|
||||||
$rel['id_parent'] = 0;
|
$rel['id_parent'] = 0;
|
||||||
$rel['id_child'] = $item['id_node'];
|
$rel['id_child'] = $item['id_node'];
|
||||||
$rel['parent_type'] = NODE_PANDORA;
|
$rel['parent_type'] = NODE_PANDORA;
|
||||||
$rel['child_type'] = $item['node_type'];
|
$rel['child_type'] = $item['node_type'];
|
||||||
$rel['id_child_source_data'] = $item['id_source_data'];
|
$rel['id_child_source_data'] = $item['id_source_data'];
|
||||||
|
|
||||||
$orphans[] = $rel;
|
$orphans[] = $rel;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Flattern edges.
|
||||||
|
foreach ($target as $rel) {
|
||||||
|
$edges[] = $rel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// Flattern edges.
|
|
||||||
foreach ($target as $rel) {
|
|
||||||
$edges[] = $rel;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$edges = $this->relations;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($edges as $rel) {
|
if (is_array($edges)) {
|
||||||
$graph .= $this->createDotEdge(
|
foreach ($edges as $rel) {
|
||||||
[
|
$graph .= $this->createDotEdge(
|
||||||
'to' => $rel['id_child'],
|
[
|
||||||
'from' => $rel['id_parent'],
|
'to' => $rel['id_child'],
|
||||||
]
|
'from' => $rel['id_parent'],
|
||||||
);
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$edges = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($this->noPandoraNode) === false
|
if (isset($this->noPandoraNode) === false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user