array( 'send_views_handler_field_module' => array( 'parent' => 'views_handler_field', '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( 'send_recipient' => array( 'table' => array( 'group' => t('Send recipient'), 'base' => array( 'field' => 'sid', 'title' => t('Send recipient data'), 'help' => t('Data relating senders, recipients, and sent nodes'), ), 'join' => array( 'users' => array( 'field' => 'rid', 'left_field' => 'uid', 'type' => 'inner', ), 'node' => array( 'field' => 'nid', 'left_field' => 'nid', ), 'send' => array( 'field' => 'sid', 'left_field' => 'sid', ), ), ), 'rid' => array( 'title' => t('Recipient'), 'help' => t('The message recipient'), 'relationship' => array( 'base' => 'users', 'field' => 'rid', 'handler' => 'views_handler_relationship', 'label' => t('Send: Recipient'), ), ), 'rcount' => array( 'title' => t('Recipient count'), 'help' => t('The number of recipients'), 'field' => array( 'handler' => 'views_handler_field', 'click sortable' => TRUE, ), 'sort' => array( 'handler' => 'views_handler_sort', ), ), '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'), ), ), ), 'send' => array( 'table' => array( 'group' => t('Send'), 'base' => array( 'field' => 'sid', 'title' => t('Send data'), 'help' => t('Data relating senders, recipients, and sent nodes'), ), 'join' => array( 'users' => array( 'field' => 'uid', 'left_field' => 'uid', ), 'node' => array( 'left_table' =>'send_recipients', 'left_field' => 'sid', 'field' => 'sid', ), ), ), 'module' => array( 'title' => t('Module'), 'field' => array( 'help' => t('Send module used'), 'handler' => 'send_views_handler_field_module', ), 'filter' => array( 'help' => t('Filter by send module used'), 'handler' => 'send_views_handler_filter_in_operator_module', ), 'sort' => array( 'help' => t('Sort by send module used'), 'handler' => 'views_handler_sort', ), ), 'timestamp' => array( 'title' => t('Timestamp'), 'field' => array( 'help' => t('Date and time message was sent'), 'handler' => 'views_handler_field_date', ), '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' => 'views_handler_sort_date', ), ), 'sid' => array( 'title' => t('Recipients'), 'help' => t('Relationship to recipients of send messages'), 'relationship' => array( 'base' => 'send_recipient', 'field' => 'sid', 'hanlder' => 'views_handler_relationship', 'label' => t('Send: Sender'), ), ), 'uid' => array( 'title' => t('Sender'), 'help' => t('The sender of the message'), 'relationship' => array( 'base' => 'users', 'hanlder' => 'views_handler_relationship', 'label' => t('Send: Sender'), 'required' => TRUE, ), ), 'subject' => array( 'title' => t('Subject'), 'help' => t('The subject of the sent message'), 'field' => array( 'handler' => 'views_handler_field', ), ), 'message' => array( 'title' => t('Message'), 'help' => t('The message which was sent'), 'field' => array( 'handler' => 'views_handler_field', ), ), ), ); return $data; }