<?php

register_findobjects();
function register_findobjects() {

    $component_args = array(

        COMPONENT_NAME              => 'findobjects',
        COMPONENT_TITLE             => _('Find Objects'),
        COMPONENT_VERSION           => '1.0.0',
        COMPONENT_DATE              => '05/12/2021',
        COMPONENT_AUTHOR            => 'Nagios Enterprises, LLC',
        COMPONENT_DESCRIPTION       => _('Search for objects in any of your fused Nagios XI systems.'),
        COMPONENT_REQUIRES_VERSION  => 4000,
        COMPONENT_FUNCTION          => 'findobjects_successful_registration',
    );

    register_component($component_args);
}

function findobjects_successful_registration()
{
    register_callback(CALLBACK_MENU_INITIALIZED, 'register_findobjects_menu');
}

function register_findobjects_menu($cb, &$menu)
{
    $menu->add_section('home', _('Global Search'), 'find-objects');
    $menu->add_link(menu_link(_('Find Objects'), get_components_base_url() . 'findobjects/search.php'), 'find-objects');
}
