You are here

user_activity_views.views.inc in Heartbeat 6.2

File

user_activity_views/user_activity_views.views.inc
View source
<?php

// http://blue.live4all.co.il/~mooffie/tmp/views_illustrated/

//http://views.doc.logrus.com/

/**
 * Implementation of hook_views_handlers
 *
 * @return unknown
 */
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',
      ),
    ),
  );
}

/**
 * Implementation of views hook hook_views_data()
 *
 * @return unknown
 */
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 field
      '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;
}

Functions

Namesort descending Description
heartbeat_views_data Implementation of views hook hook_views_data()
user_activity_views_views_handlers Implementation of hook_views_handlers