Beispiel #1
0
/**
 * Adds an item to the menu register
 *
 * @param string $menu_name The name of the top-level menu
 * @param string $menu_url The URL of the page
 * @param array $menu_children Optionally, an array of submenu items
 * @return true|false Depending on success
 */
function add_menu($menu_name, $menu_url, $menu_children = array(), $context = "")
{
    global $CONFIG;
    if (!isset($CONFIG->menucontexts)) {
        $CONFIG->menucontexts = array();
    }
    if (empty($context)) {
        $context = get_plugin_name();
    }
    $CONFIG->menucontexts[] = $context;
    return add_to_register('menu', $menu_name, $menu_url, $menu_children);
}
/**
 * Function to add a custom field type to a register
 */
function add_custom_field_type($register_name, $field_type, $field_display_name, $options)
{
    add_to_register($register_name, $field_type, $field_display_name, $options);
}