View source
<?php
function user_activity_views_api() {
return array(
'api' => 2,
'path' => drupal_get_path('module', 'user_activity'),
);
}
function user_activity_menu() {
$items = array();
$items['admin/settings/heartbeat/user_activity'] = array(
'title' => 'user activity settings',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'user_activity_admin_settings',
),
'access arguments' => array(
'configure user activity',
),
'type' => MENU_LOCAL_TASK,
'weight' => 6,
'file' => 'user_activity.admin.inc',
);
return $items;
}
function user_activity_log($data, $args = array()) {
$user_activity = new user_activity($data);
$user_activity
->save($args);
}
function user_activity_heartbeat_message_info() {
$info = array(
0 => array(
'message' => '!username_link has updated !node_title_link.',
'message_concat' => '!username_link has updated !node_title_link.',
'concat_args' => array(
'type' => 'single',
),
'event' => 'event_node_update',
'module' => 'user_activity',
'karma_index' => 1,
'description' => t('Message to use when a user updates content.'),
'variables' => array(
'@username' => '[author:user]',
'@title' => '[node:title]',
'@language' => '[node:language]',
'@nid' => '[node:nid]',
'@node_type' => '[node:type]',
'@node_title_link' => '[node:title-link]',
'@username_link' => '[author:user-name-url]',
'@username_profile_link' => '[author:user-profile-url]',
'@username_account_url' => '[author:account-url]',
),
),
1 => array(
'message' => '!username_link added !node_title_link.',
'message_concat' => '!username_link added %titles%.',
'concat_args' => array(
'type' => 'summary',
'target' => 'titles',
'separator' => ', ',
),
'event' => 'event_node_insert',
'module' => 'user_activity',
'karma_index' => 1,
'description' => t('Message to use when one user adds new content, like a page, blogpost, etc ... .'),
'variables' => array(
'@username' => '[author:user]',
'@title' => '[node:title]',
'@language' => '[node:language]',
'@nid' => '[node:nid]',
'@node_type' => '[node:type]',
'@node_title_link' => '[node:title-link]',
'@username_link' => '[author:user-name-url]',
'@username_profile_link' => '[author:user-profile-url]',
'@username_account_url' => '[author:account-url]',
),
),
2 => array(
'message' => '!username_link changed a comment on !node_title_link.',
'message_concat' => '!username_link has changed a comment on !node_title_link %number% times.',
'concat_args' => array(
'type' => 'count',
'target' => 'number',
),
'event' => 'event_comment_update',
'module' => 'user_activity',
'karma_index' => 1,
'description' => t('Message to use when a user edits a reply or comment.'),
'variables' => array(
'@username' => '[comment_author:user]',
'@title' => '[node:title]',
'@language' => '[node:language]',
'@node_title_link' => '[node:title-link]',
'@username_link' => '[comment_author:user-name-url]',
'@username_account_url' => '[comment_author:account-url]',
'@username_profile_link' => '[comment_author:user-profile-url]',
),
),
3 => array(
'message' => '!username_link replied on !node_title_link.',
'message_concat' => '!username_link replied %number% times on !node_title_link.',
'concat_args' => array(
'type' => 'count',
'target' => 'number',
),
'event' => 'event_comment_insert',
'module' => 'user_activity',
'karma_index' => 1,
'description' => t('Message to use when one user adds a new comment.'),
'variables' => array(
'@username' => '[comment_author:user]',
'@title' => '[node:title]',
'@language' => '[node:language]',
'@node_title_link' => '[node:title-link]',
'@username_link' => '[comment_author:user-name-url]',
'@username_account_url' => '[comment_author:account-url]',
'@username_profile_link' => '[comment_author:user-profile-url]',
),
),
);
return $info;
}