View source
<?php
function user_activity_views_views_handlers() {
return array(
'info' => array(
'path' => drupal_get_path('module', 'user_activity_views'),
),
'handlers' => array(
'views_handler_filter_user_activity_views_language' => array(
'parent' => 'views_handler_filter_boolean_operator',
),
'views_handler_filter_user_activity_views_user_requested' => array(
'parent' => 'views_handler_filter_boolean_operator',
),
),
);
}
function heartbeat_views_data() {
$data = array(
'user_activity' => array(
'table' => array(
'group' => t('User activity log table'),
'base' => array(
'field' => 'uaid',
'title' => t('Activities'),
'help' => t("User activities on the site"),
),
),
'uid' => array(
'title' => t('User'),
'help' => t('The user who carried out the activity'),
'relationship' => array(
'base' => 'users',
'field' => 'uid',
'handler' => 'views_handler_relationship',
'label' => t('User'),
),
),
'uid_current' => array(
'real field' => 'uid',
'title' => t('Currently logged in user carried out the activity'),
'help' => t('The user who did the activity is the currently logged in user'),
'filter' => array(
'handler' => 'views_handler_filter_user_current',
),
),
'uid_requested' => array(
'real field' => 'uid',
'title' => t('Currently requested user (url argument) carried out the activity'),
'help' => t('The user who did the activity is third argument in url heartbeat/user/% '),
'argument' => array(
'handler' => 'views_handler_argument_user_uid',
),
),
'uid_target' => array(
'title' => t('Target User'),
'help' => t('The user who was the target of the activity (if present)'),
'relationship' => array(
'base' => 'users',
'field' => 'uid',
'handler' => 'views_handler_relationship',
'label' => t('User'),
),
),
'uid_tarted_current' => array(
'real field' => 'uid_target',
'title' => t('Currently logged in user is the activity\'s recipient'),
'help' => t('The user who was the target of the activity is the currently logged in user'),
'filter' => array(
'handler' => 'views_handler_filter_user_current',
),
),
'nid_target' => array(
'title' => t('Target Node'),
'help' => t('The node which was the target of the activity (if present)'),
'relationship' => array(
'base' => 'node',
'field' => 'nid',
'handler' => 'views_handler_relationship',
'label' => t('Node'),
),
),
'message' => array(
'title' => t('Message'),
'help' => t('Logged Message'),
'field' => array(
'handler' => 'views_handler_field_markup',
'format' => FILTER_FORMAT_DEFAULT,
),
'filter' => array(
'handler' => 'views_handler_filter_string',
),
),
'language' => array(
'title' => t('Display language is current language(usertime)'),
'help' => t('The language the content is in.'),
'field' => array(
'handler' => 'views_handler_field',
),
'filter' => array(
'handler' => 'views_handler_filter_user_activity_views_language',
),
),
'timestamp' => array(
'title' => t('Action\'s timestamp'),
'help' => t('When the action happened'),
'field' => array(
'handler' => 'views_handler_field_date',
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort_date',
),
'filter' => array(
'handler' => 'views_handler_filter_date',
),
),
),
);
return $data;
}