You are here

function views_bulk_operations_rules_action_info in Views Bulk Operations (VBO) 6

Same name and namespace in other branches
  1. 7.3 views_bulk_operations.rules.inc \views_bulk_operations_rules_action_info()

Implementation of hook_rules_action_info().

File

./views_bulk_operations.rules.inc, line 6

Code

function views_bulk_operations_rules_action_info() {
  $actions = array();

  // Execute VBO programmatically.
  foreach (module_invoke_all('views_bulk_operations_object_info') as $type => $info) {
    $actions['views_bulk_operations_rules_action_' . $type] = array(
      'label' => t('Use !type object to execute a VBO programmatically', array(
        '!type' => $type,
      )),
      'arguments' => array(
        'object' => array(
          'type' => $type,
          'label' => t('Object'),
          'description' => t('The chosen object will be loaded as the <code>$object</code> variable, available below.'),
        ),
      ),
      'module' => 'Views Bulk Operations',
      'eval input' => array(),
      'base' => 'views_bulk_operations_rules_action',
    );
  }

  // Modify node fields.
  $actions['views_bulk_operations_fields_rules_action'] = array(
    'label' => t('Modify node fields'),
    'arguments' => array(
      'node' => array(
        'type' => 'node',
        'label' => t('Node'),
      ),
    ),
    'module' => 'Node',
  );
  return $actions;
}