$hierarchy * @var string $prefix * @var Tree $tree */ preg_match_all('/^(\d+) (\w+) ?(.*)/m', $gedcom, $matches); [, $levels, $tags, $values] = $matches; $levels = array_map(static fn(string $x): int => (int) $x, $levels); $keys = array_keys($levels); $elements = []; $ids = []; foreach ($keys as $key) { $hierarchy[$levels[$key]] = $tags[$key]; $full_tag = implode(':', array_slice($hierarchy, 0, 1 + $levels[$key])); $elements[$key] = Registry::elementFactory()->make($full_tag); $ids[$key] = Uuid::uuid4()->toString() . '-' . $full_tag; } ?> 0 && $levels[$key] > $levels[$key - 1] && $elements[$key] instanceof AbstractXrefElement) : ?>
XXX
edit($ids[$key], $prefix . 'values[]', strtr($values[$key], ["\r" => "\n"]), $tree) ?>