Skip to content

Instantly share code, notes, and snippets.

@PiBa-NL
Last active February 24, 2018 11:49
Show Gist options
  • Save PiBa-NL/90d7310ee5aa4439ea950a1fba099c6f to your computer and use it in GitHub Desktop.
Save PiBa-NL/90d7310ee5aa4439ea950a1fba099c6f to your computer and use it in GitHub Desktop.
<?php
require_once("config.inc");
/*
a check should be added to avoid duplicate items..
*/
/*
$menu = array();
$menu['name'] = "NEW MENU ITEM";
$menu['section'] = "Services";
$menu['url'] = "http://www.pfsense.org";
$config['installedpackages']['menu'][] = $menu;
*/
function deleteMenu($menu) {
global $config;
$menus =&$config['installedpackages']['menu'];
foreach ($menus as $key => $instmenu) {
if ($instmenu['name'] == $menu) {
unset($menus[$key]);
break;
}
}
}
deleteMenu("NEW MENU ITEM");
write_config("Menu change saved");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment