function hook_views_bulk_operations_object_info in Views Bulk Operations (VBO) 6
Hook used by VBO to be able to handle different objects as does Views 2+ and the Drupal core action system.
The array returned for each object type contains: 'type' (required) => the object type name, should be the same as 'type' field in hook_action_info(). 'context' (optional) => the context name that should receive the object, defaults to the value of 'type' above. 'base_table' (required) => the Views 2 table name corresponding to that object type, should be the same as the $view->base_table attribute. 'oid' (currently unused) => an attribute on the object that returns the unique object identifier (should be the same as $view->base_field). 'load' (required) => a function($oid) that returns the corresponding object. 'title' (required) => an attribute on the object that returns a human-friendly identifier of the object. 'access' (optional) => a function($op, $node, $account = NULL) that behaves like node_access().
The following attributes allow VBO to show actions on view types different than the action's type: 'hook' (optional) => the name of the hook supported by this object type, as defined in the 'hooks' attribute of hook_action_info(). 'normalize' (optional) => a function($type, $object) that takes an object type and the object instance, returning additional context information for cross-type
e.g., an action declaring hook => array('user') while of type 'system' will be shown on user views, and VBO will call the user's 'normalize' function to prepare the action to fit the user context.
1 function implements hook_views_bulk_operations_object_info()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
2 invocations of hook_views_bulk_operations_object_info()
- views_bulk_operations_rules_action_info in ./
views_bulk_operations.rules.inc - Implementation of hook_rules_action_info().
- _views_bulk_operations_get_object_info in ./
views_bulk_operations.module - Helper function to return all object info.
File
- ./
views_bulk_operations.api.php, line 27 - Documentation of hooks.
Code
function hook_views_bulk_operations_object_info() {
$object_info = array(
'node' => array(
'type' => 'node',
'base_table' => 'node',
'load' => '_views_bulk_operations_node_load',
'oid' => 'nid',
'title' => 'title',
'access' => 'node_access',
'hook' => 'nodeapi',
'normalize' => '_views_bulk_operations_normalize_node_context',
),
);
return $object_info;
}