Developer Guide

Callback Reference

Introduction

Each of these callbacks are explained in a sense of when they are executed and what to expect the function you define as the callback to expect as far as arguments. There are plenty of examples in the Nagios Fusion codebase, so make sure to take a look and see how they're being utilized in other places too.

Every callback function defined must accept two arguments: $cbtype (the callback type) and $cbargs (the arguments passed along) - and sometimes $cbargs should be passed as reference.

Details

CALLBACK_FOOTER_CONTENT_END

Description

Executed after the parent footer content is printed.

$cbargs definition
Array keyTypeDescription
childBooleanIs this a child page?
Pass by Reference?No

CALLBACK_FOOTER_CONTENT_START

Description

Executed before the parent footer content is printed.

$cbargs definition
Array keyTypeDescription
childBooleanIs this a child page?
Pass by Reference?No

CALLBACK_FOOTER_END

Description

Executed after either of the footers are printed.

$cbargs definition
Array keyTypeDescription
childBooleanIs this a child page?
Pass by Reference?No

CALLBACK_FOOTER_START

Description

Executed before either of the footers are printed.

$cbargs definition
Array keyTypeDescription
childBooleanIs this a child page?
Pass by Reference?No

CALLBACK_HEADER_END

Description

Executed after either of the headers are printed.

$cbargs definition
Array keyTypeDescription
childBooleanIs this a child page?
Pass by Reference?No

CALLBACK_HEADER_START

Description

Executed before either of the headers are printed.

$cbargs definition
Array keyTypeDescription
childBooleanIs this a child page?
Pass by Reference?No

CALLBACK_HOME_PAGE

Description

Executed before printing the landing page.

$cbargs definition
Array keyTypeDescription
page_titleStringThe title of the home page
product_in_page_titleBooleanInclude the product name in the title?
iframe_srcBooleanThe iframe src (href) to include
Pass by Reference?YES

CALLBACK_SESSION_STARTED

Description

Executed when the session is initialized.

CALLBACK_PROCESS_AUTH_INFO

Description

Executed during check_login_credentials before local checking occurs.

$cbargs definition
Array keyTypeDescription
credentials['username']StringThe string containing the username
credentials['password']StringThe string containing the password
login_okIntThe value to set if authentication was successful (1)
debugArrayAn array of debug messages incurred during callback authentication
errorArrayAn array of error messages incurred during callback authentication
Pass by Reference?YES

CALLBACK_POLLED_PRE

Description

Executed directly before a server is about to be polled.

$cbargs definition
Array keyTypeDescription
serverIntThe server id of the server about to be polled
userStringThe user for whom the data is being polled
Pass by Reference?No

CALLBACK_POLLED_POST

Description

Executed directly after a server is polled.

$cbargs definitionThis is a little different. The data passed here is the transformed data used via the register_poll_callback function. Before you attempt to use this function, you should be experimenting heavily with the output via print_r and var_dump to ensure that you really know what's going on. You can seriously alter the data you see in Fusion based on this callback. Use at your own risk!
Pass by Reference?YES

CALLBACK_DBMAINT

Description

Executed directly after the database maintenace subsystem runs.

CALLBACK_MENU_INITIALIZED

Description

Executed directly after the internal menu object is initialized.

$cbargs definitionThe actual $menu object is passed by reference to your defined callback. You can use $cbargs->add_link to add menu items this way.
Pass by Reference?YES

CALLBACK_FUSION_LOGO

Description

Overwrite the Fusion logo information.

$cbargs definition
Array keyTypeDescription
display_fusion_logoBooleanDisplay the logo at all?
logo_imgStringThe image URL to display
logo_textStringThe text to display in place of the word 'Fusion'
logo_altStringThe alternate text for the specified image
logo_targetStringThe link target for the logo
logo_urlBooleanThe link
Pass by Reference?YES

CALLBACK_GET_DASHBOARD

Description

Executed after everytime a dashboard is retrieved from the database, but before it is displayed.

$cbargs definitionThe entire dashboard array is passed by reference. Again, print_r and var_dump are your friends.
Pass by Reference?No

CALLBACK_USER_CREATED

Description

$cbargs definition
Array keyTypeDescription
user_idIntThe user id of the user created
usernameStringThe username of the user created
emailStringThe email address of the user created
levelIntThe user level of the user created (0 for non admin, 1 for admin)
Pass by Reference?No