You are here

function workflow_extensions_views_data_alter in Workflow Extensions 7

Same name and namespace in other branches
  1. 6 views/workflow_extensions.views.inc \workflow_extensions_views_data_alter()

Implements hook_views_data_alter().

File

views/workflow_extensions.views.inc, line 20
Declare new and alter workflow fields, sorts and filters.

Code

function workflow_extensions_views_data_alter(&$data) {
  $data['workflow_node']['state_change_form'] = array(
    'title' => t('State transition form'),
    'help' => t("Display a form to transition the node's workflow state"),
    'field' => array(
      'handler' => 'workflow_extensions_handler_field_state_change_form',
      'click sortable' => FALSE,
    ),
  );
  $data['workflow_node_history']['hid'] = array(
    'title' => t('Hid'),
    'help' => t('Unique number for state transition log record'),
    'field' => array(
      'handler' => 'views_handler_field_numeric',
      'click sortable' => TRUE,
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_numeric',
      'numeric' => TRUE,
    ),
    'sort' => array(
      'handler' => 'views_handler_sort',
    ),
  );
  $data['workflow_node_history']['uid'] = array(
    'title' => t('User'),
    'help' => t('Relate this transition record to the user who transitioned state.'),
    'relationship' => array(
      'handler' => 'views_handler_relationship',
      'base' => 'users',
      'base field' => 'uid',
      'label' => t('user'),
    ),
  );
  $data['workflow_node_history']['edit_comment'] = array(
    'title' => t('Edit comment'),
    'help' => t('Provide a link to edit the workflow log comment.'),
    'field' => array(
      'handler' => 'workflow_extensions_handler_field_workflow_comment_link_edit',
    ),
  );
  return;
}