You are here

heartbeat.rules_defaults.inc in Heartbeat 6.3

Rules' pre-configured rules for default drupal core behaviour.

File

heartbeat.rules_defaults.inc
View source
<?php

/**
 * @file
 * Rules' pre-configured rules for default drupal core behaviour.
 */

/**
 * Implementation of hook_rules_defaults
 *
 * @return configured rules array
 */
function heartbeat_rules_defaults() {
  return array(
    'rules' => array(
      'rules_heartbeat_0' => array(
        '#type' => 'rule',
        '#categories' => array(
          0 => 'heartbeat',
        ),
        '#set' => 'event_node_update',
        '#label' => 'Heartbeat - user updates content',
        '#active' => 1,
        '#weight' => '0',
        '#status' => 'default',
        '#conditions' => array(
          0 => array(
            '#weight' => 0,
            '#info' => array(
              'label' => 'Updated content is published',
              'arguments' => array(
                'node' => array(
                  'type' => 'node',
                  'label' => 'Content',
                ),
              ),
              'module' => 'Node',
            ),
            '#name' => 'rules_condition_content_is_published',
            '#settings' => array(
              '#argument map' => array(
                'node' => 'node',
              ),
            ),
            '#type' => 'condition',
          ),
        ),
        '#actions' => array(
          0 => array(
            '#weight' => 0,
            '#info' => array(
              'label' => 'Logs user activity on node change',
              'label callback' => false,
              'eval input' => array(
                0 => 'uid_param',
                1 => 'uid_target_param',
                2 => 'nid_target_param',
                3 => 'message_id_param',
                4 => 'variables_param',
              ),
              'module' => 'heartbeat',
            ),
            '#name' => 'heartbeat_rules_default_action',
            '#settings' => array(
              'uid_param' => '[user:user-id]',
              'uid_target_param' => '[node:uid]',
              'nid_target_param' => '[node:nid]',
              'message_id_param' => 'heartbeat_edit_node',
              'variables_param' => '@username=|=[user:user-name-url]-|-@node_type=|=[node:type]-|-@node_title=|=[node:title-link]-|-',
              '#eval input' => array(
                'token_rules_input_evaluator' => array(
                  'uid_param' => array(
                    0 => 'user',
                  ),
                  'uid_target_param' => array(
                    0 => 'node',
                  ),
                  'nid_target_param' => array(
                    0 => 'node',
                  ),
                  'variables_param' => array(
                    0 => 'node',
                    1 => 'user',
                  ),
                ),
              ),
            ),
            '#type' => 'action',
          ),
        ),
        '#version' => 6003,
      ),
      'rules_heartbeat_1' => array(
        '#type' => 'rule',
        '#categories' => array(
          0 => 'heartbeat',
        ),
        '#set' => 'event_node_insert',
        '#label' => 'Heartbeat - user adds new page content',
        '#active' => 1,
        '#weight' => '10',
        '#status' => 'default',
        '#conditions' => array(
          0 => array(
            '#type' => 'condition',
            '#settings' => array(
              '#argument map' => array(
                'node' => 'node',
              ),
            ),
            '#name' => 'rules_condition_content_is_published',
            '#info' => array(
              'label' => 'Created content is published',
              'arguments' => array(
                'node' => array(
                  'type' => 'node',
                  'label' => 'Inhoud',
                ),
              ),
              'module' => 'Node',
            ),
            '#weight' => 0,
          ),
          1 => array(
            '#weight' => 0,
            '#info' => array(
              'label' => 'Content has type page',
              'label callback' => false,
              'arguments' => array(
                'node' => array(
                  'type' => 'node',
                  'label' => 'Content',
                ),
              ),
              'module' => 'Node',
            ),
            '#name' => 'rules_condition_content_is_type',
            '#settings' => array(
              'type' => array(
                'page' => 'page',
              ),
              '#argument map' => array(
                'node' => 'node',
              ),
            ),
            '#type' => 'condition',
          ),
        ),
        '#actions' => array(
          0 => array(
            '#type' => 'action',
            '#settings' => array(
              'uid_param' => '[user:user-id]',
              'uid_target_param' => '0',
              'nid_target_param' => '[node:nid]',
              'message_id_param' => 'heartbeat_add_node',
              'variables_param' => '@username=|=[user:user-name-url]-|-@node_type=|=[node:type]-|-@node_title=|=[node:title-link]-|-',
              '#eval input' => array(
                'token_rules_input_evaluator' => array(
                  'uid_param' => array(
                    0 => 'user',
                  ),
                  'nid_target_param' => array(
                    0 => 'node',
                  ),
                  'variables_param' => array(
                    0 => 'node',
                    1 => 'user',
                  ),
                ),
              ),
            ),
            '#name' => 'heartbeat_rules_default_action',
            '#info' => array(
              'label' => 'Logs user activity for single users',
              'eval input' => array(
                0 => 'uid_param',
                1 => 'uid_target_param',
                2 => 'nid_target_param',
                3 => 'message_id_param',
                4 => 'variables_param',
              ),
              'module' => 'heartbeat',
            ),
            '#weight' => 0,
          ),
        ),
        '#version' => 6003,
      ),
      'rules_heartbeat_2' => array(
        '#type' => 'rule',
        '#categories' => array(
          0 => 'heartbeat',
        ),
        '#set' => 'event_comment_insert',
        '#label' => 'Heartbeat - user replies to content (all types)',
        '#active' => 1,
        '#weight' => '3',
        '#status' => 'default',
        '#conditions' => array(),
        '#actions' => array(
          0 => array(
            '#type' => 'action',
            '#weight' => 5,
            '#info' => array(
              'label' => 'Logs relational user activity',
              'eval input' => array(
                0 => 'uid_param',
                1 => 'uid_target_param',
                2 => 'nid_target_param',
                3 => 'message_id_param',
                4 => 'variables_param',
              ),
              'module' => 'Heartbeat activity',
            ),
            '#name' => 'heartbeat_rules_default_action',
            '#settings' => array(
              'uid_param' => '[user:user-id]',
              'uid_target_param' => '[node:author-uid]',
              'nid_target_param' => '[node:nid]',
              'message_id_param' => 'heartbeat_add_comment',
              'variables_param' => '@username=|=[user:user-name-url]  -|-@title=|=[node:title-link]-|-',
              '#eval input' => array(
                'token_rules_input_evaluator' => array(
                  'uid_param' => array(
                    0 => 'user',
                  ),
                  'uid_target_param' => array(
                    0 => 'node',
                  ),
                  'nid_target_param' => array(
                    0 => 'node',
                  ),
                  'variables_param' => array(
                    0 => 'node',
                    1 => 'user',
                  ),
                ),
              ),
            ),
          ),
        ),
        '#version' => 6003,
      ),
      'rules_heartbeat_3' => array(
        '#type' => 'rule',
        '#categories' => array(
          0 => 'heartbeat',
        ),
        '#set' => 'event_comment_update',
        '#label' => 'Heartbeat - user changes a reply (update comment)',
        '#active' => 0,
        '#weight' => '0',
        '#status' => 'default',
        '#conditions' => array(),
        '#actions' => array(
          0 => array(
            '#weight' => 5,
            '#info' => array(
              'label' => 'Logs relational user activity',
              'eval input' => array(
                0 => 'uid_param',
                1 => 'uid_target_param',
                2 => 'nid_target_param',
                3 => 'message_id_param',
                4 => 'variables_param',
              ),
              'module' => 'Heartbeat activity',
            ),
            '#name' => 'heartbeat_rules_default_action',
            '#settings' => array(
              'uid_param' => '[user:user-id]',
              'uid_target_param' => '[node:author-uid]',
              'nid_target_param' => '[node:nid]',
              'message_id_param' => 'heartbeat_edit_comment',
              'variables_param' => '@username=|=[user:user-name-url]-|-@title=|=[node:title-link]-|-',
              '#eval input' => array(
                'token_rules_input_evaluator' => array(
                  'uid_param' => array(
                    0 => 'user',
                  ),
                  'uid_target_param' => array(
                    0 => 'node',
                  ),
                  'nid_target_param' => array(
                    0 => 'node',
                  ),
                  'variables_param' => array(
                    0 => 'node',
                    1 => 'user',
                  ),
                ),
              ),
            ),
            '#type' => 'action',
          ),
        ),
        '#version' => 6003,
      ),
      'rules_heartbeat_4' => array(
        '#type' => 'rule',
        '#categories' => array(
          0 => 'heartbeat',
        ),
        '#set' => 'event_user_update',
        '#label' => 'Heartbeat - After user updates his account',
        '#active' => 1,
        '#weight' => '0',
        '#status' => 'default',
        '#conditions' => array(),
        '#actions' => array(
          0 => array(
            '#weight' => 0,
            '#info' => array(
              'label' => 'Logs default user activity',
              'eval input' => array(
                0 => 'uid_param',
                1 => 'uid_target_param',
                2 => 'nid_target_param',
                3 => 'message_id_param',
                4 => 'variables_param',
              ),
              'module' => 'heartbeat',
            ),
            '#name' => 'heartbeat_rules_default_action',
            '#settings' => array(
              'uid_param' => '[user:user-id]',
              'uid_target_param' => '0',
              'nid_target_param' => '0',
              'message_id_param' => 'heartbeat_edit_account',
              'variables_param' => '@username=|=[account:user-name-url]-|-',
              '#eval input' => array(
                'token_rules_input_evaluator' => array(
                  'uid_param' => array(
                    0 => 'user',
                  ),
                  'variables_param' => array(
                    0 => 'account',
                  ),
                ),
              ),
            ),
            '#type' => 'action',
          ),
        ),
        '#version' => 6003,
      ),
    ),
  );
}

Functions

Namesort descending Description
heartbeat_rules_defaults Implementation of hook_rules_defaults