Returns all path element strings found for the given path $levelData.

@param array $levelData

@return string[]
424413
protected function extractPathElements(array $levelData)
    {
        $elements = [];

        if (isset($levelData['translations']['always-available'])) {
            // NOP entry
            $elements[] = $levelData['translations']['always-available'];
        } else {
            // Language(s) entry
            $elements = array_values($levelData['translations']);
        }

        return $elements;
    }
42544
private function getMappedSettings(array $settingsData): array
    {
        $settings = [];
        foreach ($settingsData as $settingName => $settingValue) {
            $settings[] = new ModuleSetting($settingName, $settingValue);
        }

        return $settings;
    }
428364
private function getPathsData($data, string $root): ?array
    {
        if ($data === null || !\is_array($data) || \count($data) === 0) {
            return null;
        }

        return $this->existingPaths($data, $root);
    }
424355
public function getChildNodes($dsId, $level = 1)
    {
        $children = [];

        $childrenDsIds = $this->getChildrenDsIds($dsId, $level);
        foreach ($childrenDsIds as $childDsId) {
            $children[] = $this->getNode($childDsId);
        }

        return $children;
    }
304568
public function parent(string $path, int $levels = 1): string
    {
        [$scheme, $path] = $this->getSchemeAndHierarchy($path);

        if ($this->normalize !== false) {
            $path = $this->normalizePathPart($path);
        }

        if ($path === '' || $path === '.') {
            return '';
        }

        [$scheme, $parent] = $this->dirnameInternal($scheme, $path, $levels);

        return $parent !== $path ? $this->toString($scheme, $parent) : '';
    }
1312420
final protected function parseData(array $data, $parentId = 0)
    {
        $result = array();

        foreach ($data as $subArray) {
            $nested = array();

            if (isset($subArray[$this->childrenKey])) {
                // Recursive call
                $nested = $this->parseData($subArray[$this->childrenKey], $subArray[RelationBuilder::TREE_PARAM_ID]);
            }

            $result[] = array(
                RelationBuilder::TREE_PARAM_ID => $subArray[RelationBuilder::TREE_PARAM_ID], 
                RelationBuilder::TREE_PARAM_PARENT_ID => $parentId
            );

            $result = array_merge($result, $nested);
        }

        return $result;
    }
1271533
private function getHeaders($rawData)
    {
        if (is_string($rawData)) {
            $rawData = explode("\n", $rawData);
        }

        $key = null;
        $headers = array();
        foreach ($rawData as $line) {
            $line = trim($line);
            if (preg_match("/^([a-zA-Z0-9-]+):/i", $line, $matches)) {
                $key = strtolower($matches[1]);
                if (isset($headers[$key])) {
                    if (!is_array($headers[$key])) {
                        $headers[$key] = array($headers[$key]);
                    }

                    $headers[$key][] = trim(str_replace($matches[0], '', $line));
                    continue;
                }

                $headers[$key] = trim(str_replace($matches[0], '', $line));
                continue;
            }

            if (!is_null($key) && isset($headers[$key])) {
                if (is_array($headers[$key])) {
                    $headers[$key][count($headers[$key])-1] .= ' '.$line;
                    continue;
                }

                $headers[$key] .= ' '.$line;
            }
        }

        return $headers;
    }
287583
static function getFirstAndRestPathElements ($path) {
		$elements = explode(self::SEPARATOR, $path, 2);

		if (count($elements) < 2) {
			$elements[] = null;
		}

		return $elements;
	}
259711
public function getDescendants($id, $level = 1)
    {
        $nodes = [];
        foreach ($this->_tree as $key => $value) {
            if ($value[$this->_parentSign] == $id) {
                $value['level'] = $level;
                $nodes[] = $value;
                $nodes = array_merge($nodes, $this->getDescendants($value['id'], $level + 1));
            }
        }
        return $nodes;
    }
276922
private function getValidationMessages(array $validationData)
    {
        $messages = array();
        $messagesData = $validationData['messages'];
        foreach ($messagesData as $messageData) {
            $message = new W3CMarkupValidatorMessage($messageData);
            $messages[] = $message;
        }

        return $messages;
    }
1196227
public function dirname(string $path, int $levels = 1): string
    {
        [$scheme, $path] = $this->getSchemeAndHierarchy($path);

        if ($this->normalize || ($scheme && null === $this->normalize)) {
            $path = $this->normalizePathPart($path);
        }

        [$scheme, $path] = $this->dirnameInternal($scheme, $path, $levels);

        return $this->toString($scheme, $path);
    }
91439
protected function findElementXpaths($xpath) {
    $elements = $this->browser->find("xpath", $xpath);
    $nodeXPaths = array();

    if (!isset($elements["ids"])) {
      return array();
    }

    foreach ($elements["ids"] as $i => $elementId) {
      $nodeXPaths[] = sprintf('(%s)[%d]', $xpath, $i + 1);
    }
    return $nodeXPaths;
  }
421355
private static function _flatToNested(
        array $flatTree,
        string $levelName = 'level',
        ?int $level = null,
        int $startPos = 0,
        array &$result = array()
    ): array {
        $total = count($flatTree);
        $first = true;

        for ($pos = $startPos; $pos < $total; ++$pos) {
            $item = $flatTree[$pos];

            if (null === $level) {
                $level = $item[$levelName];
            }

            if (!array_key_exists('_children', $item)) {
                $item['_children'] = array();
            }

            if ($level == $item[$levelName]) {
                $result[] = $item;
                $first = true;
            } elseif (($level + 1) == $item[$levelName] && true == $first) {
                $children = array($item);
                self::_flatToNested($flatTree, $levelName, (int) $item[$levelName], $pos + 1, $children);
                $result[count($result) - 1]['_children'] = $children;
                $first = false;
            } elseif ($level > $item[$levelName]) {
                break;
            }
        }

        return $result;
    }
269744
private function purgeObjects(array $data, $level) {
        $tmp = [];
        foreach ($data as $k => $v) {
            if (is_array($v)) {
                $tmp[$k] = ($this->deepLevel !== null && $level <= $this->deepLevel) || $this->deepLevel === null
                    ? $this->purgeObjects($v, ++$level)
                    : '(array)';

            } elseif (is_object($v)) {
                $tmp[$k] = spl_object_hash($v) . ' ' . get_class($v);
            } else {
                ob_start();
                var_dump($v);
                $tmp[$k] = str_replace('</pre>', '',
                    preg_replace("/<pre[^>]+\>/i", '$1', ob_get_clean()));
            }
        }
        return $tmp;
    }
485377
public static function arrayToXml($data, $root = null, $level = 1, $format = true)
    {
        if (empty($root)) {
            $root = config('df.xml_root', 'dfapi');
        }

        return '<?xml version="1.0" ?>' . static::arrayToXmlInternal($data, $root, $level, $format);
    }
902759
public static function convertTreeToOptionsMulti($data, $level = 0, $options = [], & $result) {
		if (empty($options['name_field'])) $options['name_field'] = 'name';
		if (!isset($options['i18n'])) $options['i18n'] = true;
		// skip_keys - convert to array
		if (!empty($options['skip_keys']) && !is_array($options['skip_keys'])) {
			$options['skip_keys'] = [$options['skip_keys']];
		}
		$inactive = i18n(null, \Object\Content\Messages::INFO_INACTIVE);
		// translate name column
		foreach ($data as $k => $v) {
			if (is_array($options['name_field'])) {
				$temp = [];
				foreach ($options['name_field'] as $k2 => $v2) {
					if (!isset($v[$v2])) continue;
					$temp[] = !empty($options['i18n']) ? i18n(null, $v[$v2]) : $v[$v2];
				}
				$data[$k]['name'] = implode(\Format::$symbol_comma . ' ', $temp);
			} else {
				$data[$k]['name'] = !empty($options['i18n']) ? i18n(null, $v[$options['name_field']]) : $v[$options['name_field']];
			}
			// handle inactive
			if (!empty($v['inactive']) && strpos($data[$k]['name'], \Format::$symbol_comma . ' ' . $inactive) !== false) {
				$data[$k]['name'].= \Format::$symbol_comma . ' ' . $inactive;
			}
		}
		// sorting
		if (!empty($options['i18n']) && $options['i18n'] !== 'skip_sorting') {
			array_key_sort($data, ['name' => SORT_ASC], ['name' => SORT_NATURAL]);
		}
		// assemble
		foreach ($data as $k => $v) {
			// if we are skipping certain keys
			if (!empty($options['skip_keys']) && in_array($k, $options['skip_keys'])) {
				continue;
			}
			// assemble variable
			$value = $v;
			$value['level'] = $level;
			if (!empty($options['icon_field'])) {
				$value['icon_class'] = \HTML::icon(['type' => $v[$options['icon_field']], 'class_only' => true]);
			}
			if (!empty($options['disabled_field'])) {
				$value['disabled'] = !empty($v[$options['disabled_field']]);
			}
			$result[$k] = $value;
			// if we have options
			if (!empty($v['options'])) {
				self::convertTreeToOptionsMulti($v['options'], $level + 1, $options, $result);
			}
		}
	}
1143154
protected static function arrayToXmlInternal($data, $root = null, $level = 1, $format = true)
    {
        $xml = null;
        if (is_array($data)) {
            if (!Arr::isAssoc($data)) {
                foreach ($data as $value) {
                    $xml .= self::arrayToXmlInternal($value, $root, $level, $format);
                }
            } else {
                if (Arr::isAssoc($data)) {
                    if (!empty($root)) {
                        if ($format) {
                            $xml .= str_repeat("\t", $level - 1);
                        }
                        $xml .= "<$root>";
                        if ($format) {
                            $xml .= "\n";
                        }
                    }
                    foreach ($data as $key => $value) {
                        $xml .= self::arrayToXmlInternal($value, $key, $level + 1, $format);
                    }
                    if (!empty($root)) {
                        if ($format) {
                            $xml .= str_repeat("\t", $level - 1);
                        }
                        $xml .= "</$root>";
                        if ($format) {
                            $xml .= "\n";
                        }
                    }
                } else {
                    // empty array
                    if (!empty($root)) {
                        if ($format) {
                            $xml .= str_repeat("\t", $level - 1);
                        }
                        $xml .= "<$root></$root>";
                        if ($format) {
                            $xml .= "\n";
                        }
                    }
                }
            }
        } elseif (is_object($data)) {
            if ($data instanceof Arrayable) {
                $xml .= self::arrayToXmlInternal($data->toArray(), $root, $level, $format);
            } else {
                $dataString = (string)$data;
                if (!empty($root)) {
                    if ($format) {
                        $xml .= str_repeat("\t", $level - 1);
                    }
                    $xml .= "<$root>$dataString</$root>";
                    if ($format) {
                        $xml .= "\n";
                    }
                }
            }
        } else {
            // not an array or object
            if (!empty($root)) {
                if ($format) {
                    $xml .= str_repeat("\t", $level - 1);
                }
                $xml .= "<$root>";
                if (!is_null($data)) {
                    if (is_bool($data)) {
                        $xml .= ($data) ? 'true' : 'false';
                    } else {
                        if (is_int($data) || is_float($data)) {
                            $xml .= $data;
                        } else {
                            if (is_string($data)) {
                                $htmlValue = htmlspecialchars($data, ENT_QUOTES, 'UTF-8');
                                $xml .= $htmlValue;
                            }
                        }
                    }
                }
                $xml .= "</$root>";
                if ($format) {
                    $xml .= "\n";
                }
            }
        }

        return $xml;
    }