function user_activity_comment_defaults in Heartbeat 6.2
Function to work with comment events
1 call to user_activity_comment_defaults()
- user_activity_rules_defaults in user_activity/
user_activity.rules_defaults.inc - Implementation of hook_rules_defaults
File
- user_activity/
user_activity.rules_defaults.inc, line 113 - Rules' pre-configured rules for default drupal core behaviour.
Code
function user_activity_comment_defaults() {
$config = array(
// comment_add_activity_rule
'comment_add_activity_rule' => array(
'#type' => 'rule',
'#name' => 'comment_add_activity_rule',
'#categories' => array(
'heartbeat',
),
'#set' => 'event_comment_insert',
'#label' => 'Heartbeat: User activity - log user added new reply (comment)',
'#active' => 1,
'#weight' => '0',
'#status' => 'default',
'#conditions' => array(),
'#actions' => rules_use_action('user_activity_rules_default_action', array(
'#settings' => array(
'event_param' => 'event_comment_insert',
'uid_param' => '[comment_author:uid]',
'uid_target_param' => '[node_author:uid]',
'nid_target_param' => '[node:nid]',
'message_param' => t(heartbeat_event_messages('event_comment_insert', 'message')),
'message_concat_param' => t(heartbeat_event_messages('event_node_update', 'message_concat')),
'variables_param' => heartbeat_event_messages('event_comment_insert', 'variables'),
'#eval input' => array(
'token_rules_input_evaluator' => array(
'uid_param' => array(
0 => 'comment_author',
),
'uid_target_param' => array(
0 => 'node_author',
),
'nid_target_param' => array(
0 => 'node',
),
'variables_param' => array(
0 => 'comment_author',
1 => 'node',
),
),
),
),
)),
),
// end comment_add_activity_rule
// comment_update_activity_rule
'comment_update_activity_rule' => array(
'#type' => 'rule',
'#name' => 'comment_update_activity_rule',
'#categories' => array(
'heartbeat',
),
'#set' => 'event_comment_update',
'#label' => 'Heartbeat: User activity - log user updating a comment',
'#active' => 1,
'#weight' => '0',
'#status' => 'default',
'#conditions' => array(),
'#actions' => rules_use_action('user_activity_rules_default_action', array(
'#settings' => array(
'event_param' => 'event_comment_update',
'uid_param' => '[comment_author:uid]',
'uid_target_param' => '[node_author:uid]',
'nid_target_param' => '[node:nid]',
'message_param' => t(heartbeat_event_messages('event_comment_update', 'message')),
'message_concat_param' => t(heartbeat_event_messages('event_node_update', 'message_concat')),
'variables_param' => heartbeat_event_messages('event_comment_update', 'variables'),
'#eval input' => array(
'token_rules_input_evaluator' => array(
'uid_param' => array(
0 => 'comment_author',
),
'uid_target_param' => array(
0 => 'node_author',
),
'nid_target_param' => array(
0 => 'node',
),
'variables_param' => array(
0 => 'comment_author',
1 => 'node',
),
),
),
),
)),
),
);
return $config;
}