You are here

Message API

Message API for easier message customisation in Drupal modules.

Files

message_api.info is the configuration file for Drupal modules, is compulsory, and identifies the files containing classes.
message_api.module is the other compulsory file in Drupal modules and contains only the bare minimum code to load the module components when needed. There is a function to load the API when needed and the admin page when needed.
message_api.install is the database table definition file for Drupal modules and defines two tables.
message_api.admin.php defines the administration page and is called from the menu definition in the .module file.
message_api.class.php contains the Message API class and is identified for automatic loading in the .info file.
message_api_module.class.php contains the Message API module class and is identified for automatic loading in the .info file.

Functions

message_api_schema()

Function message_api_schema() implements the Drupal 7 hook schema and provides the definition of the database tables. This function is in file message_api.install.

Function message_api_module_name() is defined in message_api.module and provides the internal name, or machine name, of the module for use in self configuring code.

Function message_api($module_machine_name) is defined in message_api.module and returns the API object from the API class. This function requires the internal name, or machine name, of the module using the API. The following code shows the typical use of this function for a module named example.
$api = message_api('example');

Function message_api_list() is for internal use to produce information on the admin page for this module. There is nothing to configure on the page. The page is a simple list of whatever is created through the API.

Function __construct($module_name, $module_class_name = NULL) in the message_api class is for internal use only and accepts some data for self configuration.

Function module_name() in the message_api class is for internal use only and returns some data for self configuration.

Function module_name_set($module_name) in the message_api class is for internal use only and accepts some data for self configuration.

Function module_class_name() in the message_api class is for internal use only and returns some data for self configuration.

Function module_class_name_set($module_class_name) in the message_api class is for internal use only and accepts some data for self configuration.

Function module($module_machine_name) in the message_api class is for internal use only and returns a configured object from the API module class.

Function __construct($message_api, $module_machine_name) in the message_api_module class is for internal use only and accepts some data for self configuration.