array( 'send_views_handler_field_module' => array( 'parent' => 'views_handler_field', 'path' => drupal_get_path('module', 'send') . '/includes', ), 'send_views_handler_field_count' => array( 'parent' => 'views_handler_field', 'path' => drupal_get_path('module', 'send') . '/includes', ), 'send_views_handler_sort_count' => array( 'parent' => 'views_handler_sort', 'path' => drupal_get_path('module', 'send') . '/includes', ), 'send_views_handler_sort_date' => array( 'parent' => 'views_handler_sort_date', 'path' => drupal_get_path('module', 'send') . '/includes', ), 'send_views_handler_filter_in_operator_module' => array( 'parent' => 'views_handler_filter_in_operator', 'path' => drupal_get_path('module', 'send') . '/includes', ), ), ); } /** * Implementation of hook_views_data(). */ function send_views_data() { $data = array(); $data['send']['table']['group'] = t('Send'); $data['send']['table']['base'] = array( 'field' => 'sid', 'title' => t('Send'), 'help' => t('Data relating senders, recipients, and sent nodes'), ); $data['send']['table']['join'] = array( 'users' => array( 'field' => 'uid', 'left_field' => 'uid', 'type' => 'inner', ), 'node' => array( 'left_table' => 'send_recipient', 'field' => 'sid', 'left_field' => 'sid', 'type' => 'inner', ), ); $data['send']['sid'] = array( 'title' => t('Send id'), 'help' => t('The unique id of a send message'), 'argument' => array( 'handler' => 'views_handler_argument_numeric', ), ); $data['send']['send_count'] = array( 'title' => t('Count'), 'help' => t('Total times sent'), 'field' => array( 'handler' => 'send_views_handler_field_count', ), 'sort' => array( 'help' => t('Sort by total times a node has been sent'), 'handler' => 'send_views_handler_sort_count', ), ); $data['send']['module'] = array( 'title' => t('Module'), 'help' => t('The module that sent the message'), 'field' => array( 'handler' => 'send_views_handler_field_module', 'click sortable' => TRUE, ), 'filter' => array( 'handler' => 'send_views_handler_filter_in_operator_module', ), 'sort' => array( 'help' => t('Sort by send module used'), 'handler' => 'views_handler_sort', ), 'argument' => array( 'help' => t('Filter by the module which sent the message'), 'handler' => 'views_handler_argument_string', ), ); $data['send']['timestamp'] = array( 'title' => t('Timestamp'), 'help' => t('Date and time message was sent'), 'field' => array( 'handler' => 'views_handler_field_date', 'click sortable' => TRUE, ), 'filter' => array( 'help' => t('Filter by date and time message was sent'), 'handler' => 'views_handler_filter_date', ), 'sort' => array( 'help' => t('Sort by date and time message was sent'), 'handler' => 'send_views_handler_sort_date', ), ); $data['send']['uid'] = array( 'title' => t('Sender'), 'help' => t('The user id of the user who sent the message.'), 'relationship' => array( 'handler' => 'views_handler_relationship', 'base' => 'users', 'relationship field' => 'uid', 'label' => t('Send: Sender'), ), ); $data['send']['subject'] = array( 'title' => t('Subject'), 'help' => t('The subject of the sent message'), 'field' => array( 'handler' => 'views_handler_field', 'click sortable' => TRUE, ), ); $data['send']['message'] = array( 'title' => t('Message'), 'help' => t('The message which was sent'), 'field' => array( 'handler' => 'views_handler_field', 'click sortable' => FALSE, ), ); $data['send_recipient']['table']['group'] = t('Send'); $data['send_recipient']['table']['join'] = array( 'node' => array( 'left_field' => 'nid', 'field' => 'nid', 'type' => 'inner', ), 'users' => array( 'field' => 'rid', 'left_field' => 'uid', 'type' => 'inner', ), 'send' => array( 'left_field' => 'sid', 'field' => 'sid', ), ); $data['send_recipient']['rid'] = array( 'title' => t('Recipient'), 'help' => t('The message recipient'), 'relationship' => array( 'base' => 'users', 'field' => 'rid', 'handler' => 'views_handler_relationship', 'label' => t('Send: Recipient'), ), ); $data['send_recipient']['rcount'] = array( 'title' => t('Recipient count'), 'help' => t('The total number of recipients for a message'), 'field' => array( 'handler' => 'views_handler_field_numeric', 'click sortable' => TRUE, ), 'sort' => array( 'handler' => 'views_handler_sort', ), ); $data['send_recipient']['nid'] = array( 'title' => t('Node'), 'help' => t('Nodes that have been sent'), 'relationship' => array( 'base' => 'node', 'field' => 'nid', 'handler' => 'views_handler_relationship', 'label' => t('Send: Node'), ), ); return $data; }