You are here

function views_bulk_operations_action_info in Views Bulk Operations (VBO) 7.3

Same name and namespace in other branches
  1. 5 views_bulk_operations.module \views_bulk_operations_action_info()
  2. 6.3 views_bulk_operations.module \views_bulk_operations_action_info()
  3. 6 views_bulk_operations.module \views_bulk_operations_action_info()

Implements hook_action_info().

Registers custom VBO actions as Drupal actions.

File

./views_bulk_operations.module, line 19
Allows operations to be performed on items selected in a view.

Code

function views_bulk_operations_action_info() {
  $actions = array();
  $files = views_bulk_operations_load_action_includes();
  foreach ($files as $filename) {
    $action_info_fn = 'views_bulk_operations_' . str_replace('.', '_', basename($filename, '.inc')) . '_info';
    if (is_callable($action_info_fn)) {
      $action_info = call_user_func($action_info_fn);
      if (is_array($action_info)) {
        $actions += $action_info;
      }
    }
    else {
      watchdog('views bulk operations', 'views_bulk_operations_action_info() expects action filenames to have a matching valid callback function named: %function', array(
        '%function' => $action_info_fn,
      ), WATCHDOG_WARNING);
    }
  }
  return $actions;
}