public function open_the_way_to_node($node_to_find) { $lowerest_node_to_replace = ''; $path_to_node = $this->apm_tree->get_path_to_node($node_to_find); if (!empty($path_to_node)) { array_pop($path_to_node); foreach ($path_to_node as $node) { if ($this->tree_state->node_is_folded($node)) { $lowerest_node_to_replace = $node; break; } } $this->tree_state->unfold_nodes($path_to_node); $this->save_tree_state(); } else { //Node not found in the tree... return false; } return $lowerest_node_to_replace; }