Module Mondays: Views Bulk Operations
A couple of engineers at CivicActions were interested in the Views Bulk Operations module. Me too! So I checked it out.
Easily installed, the most important bit I can tell you about is this:
test1_node_operations() was easily created after I reviewed Drupal's API:
http://api.drupal.org/api/function/hook_node_operations/5
Working similarly to hook_menu(), it informs Drupal of the operation test1_bulk.
views_bulk_operations finds test1_bulk and it is immediately available to any bulk view. An administrator will need to check the box for 'test1 node operations' in the Operations tab of the bulk view to make this new operation available to users.
In this case, test1_bulk doesn't actually affect any node, but it gives you starting point.
Overall, Views Bulk Operations has a ton of potential. With a little more clarity/development with Actions created through the Actions user interface, this module will be of great value to developers and administrators.
- clone the view that comes with views_bulk_operations (admin_content)
- in the clone be sure to go to the Filters and select all content types for the Content Type filter (so you can see all nodes with the view)
- click Save, then start messing with it!
function test1_node_operations() {
$operations = array('test1' => array(
'label' => t('test1 node operations'),
'callback' => 'test1_bulk',
));
return $operations;
}
function test1_bulk() {
drupal_set_message('test1_bulk ran');
return;
}



















Comments
Thanks Robin for this
Glad you like it