You are here

function _views_bulk_operations_normalize_node_context in Views Bulk Operations (VBO) 6

Same name and namespace in other branches
  1. 6.3 views_bulk_operations.module \_views_bulk_operations_normalize_node_context()

Normalize function for node context.

See also

_trigger_normalize_node_context()

2 string references to '_views_bulk_operations_normalize_node_context'
hook_views_bulk_operations_object_info in ./views_bulk_operations.api.php
Hook used by VBO to be able to handle different objects as does Views 2+ and the Drupal core action system.
views_bulk_operations_views_bulk_operations_object_info in ./views_bulk_operations.module
Implementation of hook_views_bulk_operations_object_info()

File

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

Code

function _views_bulk_operations_normalize_node_context($type, $node) {
  switch ($type) {

    // If an action that works on comments is being called in a node context,
    // the action is expecting a comment object. But we do not know which comment
    // to give it. The first? The most recent? All of them? So comment actions
    // in a node context are not supported.
    // An action that works on users is being called in a node context.
    // Load the user object of the node's author.
    case 'user':
      return user_load(array(
        'uid' => $node->uid,
      ));
  }
}