summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2004-12-27 19:19:18 +0000
committerScott Ullrich <sullrich@pfsense.org>2004-12-27 19:19:18 +0000
commit7bb0d0fc34c0f50750ab8eef0fdde4eb1428eea4 (patch)
tree3e292ca8aa3fa8d5338ca895a8fbf3cfbb614d97
parent04714d83e7ff99d4c8ff11d5bcd9dc6a531b4c1b (diff)
downloadpfsense-7bb0d0fc34c0f50750ab8eef0fdde4eb1428eea4.zip
pfsense-7bb0d0fc34c0f50750ab8eef0fdde4eb1428eea4.tar.gz
Allow multiple menu items to be installed
-rwxr-xr-xusr/local/www/pkg_mgr_install.php18
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");
OpenPOWER on IntegriCloud