diff options
author | Renato Botelho <garga@FreeBSD.org> | 2015-05-07 10:01:23 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2015-05-07 10:01:23 -0300 |
commit | 253b37d8c1da5f0d863e3cd034a4df21d6f8d8a6 (patch) | |
tree | fcdc426e329bccf32fd5e049ae3800f534d8ccd1 | |
parent | 0bd239d97935560bc4aee414f395cd203b3c42eb (diff) | |
download | pfsense-253b37d8c1da5f0d863e3cd034a4df21d6f8d8a6.zip pfsense-253b37d8c1da5f0d863e3cd034a4df21d6f8d8a6.tar.gz |
Read tab information from package xml file instead of config.xml
-rw-r--r-- | usr/local/www/guiconfig.inc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc index 804869c..8ad9e92 100644 --- a/usr/local/www/guiconfig.inc +++ b/usr/local/www/guiconfig.inc @@ -1105,20 +1105,22 @@ function display_top_tabs(& $tab_array, $no_drop_down = false) { } } -function add_package_tabs($tabgroup, & $tab_array) { +function add_package_tabs($pkgname, &$tab_array) { global $config, $g; - if (!is_array($config['installedpackages'])) { + $pkg = get_pkg_data($pkgname); + + if (!isset($pkg['configurationfile']) || !file_exists('/usr/local/pkg/' . $pkg['configurationfile'])) { return; } - if (!is_array($config['installedpackages']['tab'])) { + + $pkg_config = parse_xml_config_pkg('/usr/local/pkg/' . $pkg['configurationfile'], "packagegui"); + + if (!isset($pkg_config['tabs']['tab'])) { return; } - foreach ($config['installedpackages']['tab'] as $tab) { - if ($tab['group'] !== $group) { - continue; - } + foreach($pkg_config['tabs']['tab'] as $tab) { $tab_entry = array(); if ($tab['name']) { $tab_entry[] = $tab['name']; |