From bc0661b7b32a99016b9e71b0ece969f6584034c2 Mon Sep 17 00:00:00 2001 From: PiBa-NL Date: Sun, 26 Mar 2017 16:23:30 +0200 Subject: load package add-on tabs into config to avoid parsing all installed package xml's, fix tabgroup filter --- src/etc/inc/pkg-utils.inc | 3 +++ src/usr/local/www/guiconfig.inc | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/etc/inc/pkg-utils.inc b/src/etc/inc/pkg-utils.inc index 09547b0..e576241 100644 --- a/src/etc/inc/pkg-utils.inc +++ b/src/etc/inc/pkg-utils.inc @@ -812,6 +812,9 @@ function install_package_xml($package_name) { } update_status(gettext("done.") . "\n"); } + if (is_array($pkg_config['tabs'])) { + $config['installedpackages']['package'][$pkgid]['tabs'] = $pkg_config['tabs']; + } } else { pkg_debug("Unable to find config file\n"); update_status(gettext("Loading package configuration... failed!") . "\n\n" . gettext("Installation aborted.")); diff --git a/src/usr/local/www/guiconfig.inc b/src/usr/local/www/guiconfig.inc index 43321d9..fb0134f 100644 --- a/src/usr/local/www/guiconfig.inc +++ b/src/usr/local/www/guiconfig.inc @@ -1091,13 +1091,14 @@ function add_package_tabs($tabgroup, &$tab_array) { } foreach ($config['installedpackages']['package'] as $pkg) { - $pkg_config = read_package_configurationfile($pkg['name']); - - if (!isset($pkg_config['tabs']['tab'])) { + if (!is_array($pkg['tabs']['tab'])) { continue; } - foreach ($pkg_config['tabs']['tab'] as $tab) { + foreach ($pkg['tabs']['tab'] as $tab) { + if ($tab['tabgroup'] != $tabgroup) { + continue; + } $tab_entry = array(); if ($tab['name']) { $tab_entry[] = $tab['name']; -- cgit v1.1