From b4011e9ecbbcffde81a8dd6620e3a15e25efcc29 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 18 Aug 2015 14:09:47 +0000 Subject: [PATCH] (legacy) extend legacy base with legacy_list_aliasses --- src/etc/inc/legacy_bindings.inc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/etc/inc/legacy_bindings.inc b/src/etc/inc/legacy_bindings.inc index 1b8b8cd4d..ff4ff9555 100644 --- a/src/etc/inc/legacy_bindings.inc +++ b/src/etc/inc/legacy_bindings.inc @@ -72,3 +72,26 @@ function legacy_html_escape_form_data(&$settings) } } } + +/** + * list aliasses by type + * @param string $type type port or network + */ +function legacy_list_aliasses($type) { + global $config; + $result = array(); + if (isset($config['aliases']['alias'])) { + foreach ($config['aliases']['alias'] as $alias) { + if ($type == "port") { + if (preg_match("/port/i", $alias['type'])) { + $result[] = $alias; + } + } else { + if (!preg_match("/port/i", $alias['type'])){ + $result[] = $alias; + } + } + } + } + return $result; +}