The Maintain Modules can be connected to arbitrary module hooks in the frontend and backend of Maintain. The module hooks are documented here and will later be available on the maintain web page.
Module hooks are not context sensitive.
Action hooks
Frontend
- module_dashboard_admin
No parameters. Is supposed to return (phphtmllib or plain text) content for the admin dashboard. Content will be displayed in the modules widget there.
- module_dashboard_main
No parameters. Is supposed to return (phphtmllib or plain text) content for the main page dashboard. Content will be displayed in the modules widget there.
Backend
- backend_backup
No parameters, nothing returned. Is the first backend hook to be executed. Supposed to do backup tasks, like dumping the database or exporting values.
- backend_build
No parameters, nothing returned. Third backend hook. Builds config files for services like DHCP or DNS, which will be copied to the servers later.
- backend_maintenance
No parameters, nothing returned. Second backend hook. Executes maintenance tasks like wiping out old log entries or backup files.
- backend_push
No parameters, nothing returned. Fourth backend hook. Copies config files (that were probably created during backend_build) to the respective servers.
- search
No parameters, returns true if the module is searchable.
Filter hooks
Frontend
- action_module
Recieves the action links container from the action column in datalists.
- admin_dashboard
Receives the "Dashboard" container representing the admin page. It contains all main page widgets. Can be appended to, changed, or removed altogether, for example.
- admin_misc_tools
Receives the "Misc. Tools" widget on the admin page.
- admin_network_tools
Receives the "Network Tools" widget on the admin page.
- admin_statistics
Receives the "Global Statistics" widget on the admin page.
- admin_user_tools
Receives the "User Tools" widget on the admin page.
- dashboard
Receives the "Dashboard" container representing the main page. It contains all main page widgets. Can be appended to, changed, or removed altogether, for example.
- host_widget
Receives the "Manage Hosts" widget container displayed on the main page. Can be appended to, changed, or removed altogether, for example.
- login_motd
Receives an empty container that can be filled with information (such as a message of the day, the date, or just "welcome"). This will be displayed underneath the login form on the login page.
- manage_widget
Receives the "Manage Other Objects" widget container displayed on the main page. Can be appended to, changed, or removed altogether, for example.
- mod_page
Allows modules to populate their own htdocs pages. When web_root()/mod_page.php?mod=modname is called, the filter method is going to be executed on this particular module, provided it registered to this hook. The said method gets passed an empty phphtmllib container that it can fill up arbitrarily and return afterwards.
Multiple pages can be made by adding another GET variable to the URI (e.g. "page") and switch() ing over $_REQUEST['page'] in the method registered to this hook.
- modules_widget
Receives the "Modules" widget container displayed on the main page (containing all random dashboard out created by modules). Can be appended to, changed, or removed altogether, for example.
- navLinks
Receives an object reference to the phphtmllib container "menu". Add new links to the main Maintain navigation bar. Take the menu object and use its add method to append new links to the nav bar. For an example look at the maintain_nav module.
- object_info
Receives a reference to an object info container (which is for example displayed when you click on a host in the host datalist). The second parameter it gets is the DAO object of the actual object just being displayed.
If you only want to respond to a certain type of objects, say, hosts, is_a($object, 'host') will do the trick.
- permissions_widget
Receives the "Modify Permissions" widget container displayed on the main page. Can be appended to, changed, or removed altogether, for example.
- post_login_forward
This filter receives the HTTP forward location that is triggered after successfully logging into Maintain. The default is (web_root)/index.php, but using this hook, modules can forward newly logged in users to an arbitrary other address.
- report_widget
Receives the "Reporting and Information" widget container displayed on the main page. Can be appended to, changed, or removed altogether, for example.
- username_display
Receives a username that is about to be displayed on the page in a sentence or similar constructions. Can be used to display a full name rather than a short username.
- zoneinfo_widget
Receives the "Zone Information" widget container displayed on the main page. Can be appended to, changed, or removed altogether, for example.
Backend
|
|