function hook_menu_position_rule_plugins in Menu Position 7.2
Same name and namespace in other branches
- 8 menu_position.api.php \hook_menu_position_rule_plugins()
- 6 menu_position.api.php \hook_menu_position_rule_plugins()
- 7 menu_position.api.php \hook_menu_position_rule_plugins()
Registers rule plugins with menu_position module.
Modules implementing menu position rule plugins should return an associative array of data. Each key in the array should be the name of plugin implemented by the module. Each key's value should be an associative array with the following optional data:
- form_callback: (optional) The name of the function to use to add a configurable form elements to the rule definition form. Defaults to "MODULE_menu_position_rule_PLUGIN_form".
- condition_callback: (optional) The name of the function to use when the rule is being tested. Defaults to "MODULE_menu_position_condition_PLUGIN".
- file: (optional) The path, relative to the .module file, to an include file containing the form and condition callback function definitions. The hook_menu_position_rule_plugins() implementation must be in a .module file, but the include file will only be loaded if a rule is configured to use the plugin's condition.
Return value
An associative array containing the information about each plugin.
1 function implements hook_menu_position_rule_plugins()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
1 invocation of hook_menu_position_rule_plugins()
- menu_position_get_plugins in ./
menu_position.module - Retrieves a list of information about every rule plugin.
File
- ./
menu_position.api.php, line 52 - Hooks provided by the Menu Position module.
Code
function hook_menu_position_rule_plugins() {
return array(
// Register the "foo" plugin.
'foo' => array(
'form_callback' => 'my_module_menu_position_rule_foo_form',
'condition_callback' => 'my_module_menu_position_condition_foo',
'file' => 'my_module.foo.inc',
),
// Register the "bar" plugin.
'bar' => array(),
);
}