diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2004-12-27 19:19:18 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2004-12-27 19:19:18 +0000 |
commit | 7bb0d0fc34c0f50750ab8eef0fdde4eb1428eea4 (patch) | |
tree | 3e292ca8aa3fa8d5338ca895a8fbf3cfbb614d97 | |
parent | 04714d83e7ff99d4c8ff11d5bcd9dc6a531b4c1b (diff) | |
download | pfsense-7bb0d0fc34c0f50750ab8eef0fdde4eb1428eea4.zip pfsense-7bb0d0fc34c0f50750ab8eef0fdde4eb1428eea4.tar.gz |
Allow multiple menu items to be installed
-rwxr-xr-x | usr/local/www/pkg_mgr_install.php | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/usr/local/www/pkg_mgr_install.php b/usr/local/www/pkg_mgr_install.php index 688809c..49124c0 100755 --- a/usr/local/www/pkg_mgr_install.php +++ b/usr/local/www/pkg_mgr_install.php @@ -336,11 +336,19 @@ if(file_exists("/usr/local/pkg/" . $pkgent['name'] . ".xml")) { } } } - // install menu item into the ext folder - fwrite($fd_log, "Adding menu option to " . $package_conf['menu']['section'] . "/" . $package_conf['menu']['name'] . "\n"); - $fd = fopen("/usr/local/www/ext/" . $package_conf['menu']['section'] . "/" . $package_conf['menu']['name'] , "w"); - fwrite($fd, "/pkg.php?xml=" . $package_conf['name'] . ".xml\n"); - fclose($fd); + // loop through menu installation items + // installing multiple items if need be. + foreach ($package_conf['menu'] as $menu) { + // install menu item into the ext folder + fwrite($fd_log, "Adding menu option to " . $menu['section'] . "/" . $menu['name'] . "\n"); + $fd = fopen("/usr/local/www/ext/" . $menu['section'] . "/" . $menu['name'] , "w"); + if($menu['url'] <> "") { + fwrite($fd, $menu['url'] . "\n"); + } else { + fwrite($fd, "/pkg.php?xml=" . $menu['name'] . ".xml\n"); + } + fclose($fd); + } } else { update_output_window("WARNING! /usr/local/pkg/" . $pkgent['name'] . ".xml" . " does not exist!\n"); fwrite($fd_log, "WARNING! /usr/local/pkg/" . $pkgent['name'] . ".xml" . " does not exist!\n"); |