function rb_cck_rules_action_info in Rules Bonus Pack 6
Implementation of hook_rules_action_info().
File
- ./
rb_cck.module, line 40 - Functions for extending CCK field management with Rules.
Code
function rb_cck_rules_action_info() {
// Add all actions that doesn't require additional modules.
$actions = array(
'rb_cck_action_set_field_unvalidated' => array(
'label' => t('Set a CCK field without validation'),
'arguments' => array(
'node' => array(
'type' => 'node',
'label' => t('Node to change'),
),
),
'eval input' => array(
'value',
),
'module' => 'Rules Bonus: CCK',
),
'rb_cck_action_insert_value_multiple' => array(
'label' => t('Insert a value in a multiple-value field'),
'arguments' => array(
'node' => array(
'type' => 'node',
'label' => t('Node to change'),
),
),
'eval input' => array(
'value',
),
'module' => 'Rules Bonus: CCK',
),
'rb_cck_action_remove_value_multiple' => array(
'label' => t('Remove a value from a multiple-value field'),
'arguments' => array(
'node' => array(
'type' => 'node',
'label' => t('Node to change'),
),
),
'eval input' => array(
'value',
),
'module' => 'Rules Bonus: CCK',
),
'rb_cck_action_get_field_value' => array(
'label' => t('Get a field value, bypassing Token'),
'arguments' => array(
'node' => array(
'type' => 'node',
'label' => t('Node'),
),
),
'new variables' => array(
'raw' => array(
'type' => 'string',
'label' => t('Raw field value'),
'save' => TRUE,
),
'formatted' => array(
'type' => 'string',
'label' => t('CCK-formatted field value'),
'save' => TRUE,
),
),
'module' => 'Rules Bonus: CCK',
),
'rb_cck_action_copy_multiple' => array(
'label' => t('Copy multiple field content between nodes'),
'arguments' => array(
'source' => array(
'type' => 'node',
'label' => t('Source node'),
),
'target' => array(
'type' => 'node',
'label' => t('Target node'),
),
),
'help' => t('Note that only fields existing in both source and target node
will be copied.'),
'module' => 'Rules Bonus: CCK',
),
'rb_cck_action_copy_field' => array(
'label' => t('Copy entire field content between nodes'),
'arguments' => array(
'source' => array(
'type' => 'node',
'label' => t('Source node'),
),
'target' => array(
'type' => 'node',
'label' => t('Target node'),
),
),
'module' => 'Rules Bonus: CCK',
),
'rb_cck_action_set_multiple_values' => array(
'label' => t('Insert multiple values to a CCK field'),
'arguments' => array(
'node' => array(
'type' => 'node',
'label' => t('Node'),
),
),
'eval input' => array(
'values',
),
'module' => 'Rules Bonus: CCK',
),
'rb_cck_action_merge_multiple_values' => array(
'label' => t('Merge two multiple-value fields'),
'arguments' => array(
'source' => array(
'type' => 'node',
'label' => t('Source'),
),
'target' => array(
'type' => 'node',
'label' => t('Target'),
),
),
'module' => 'Rules Bonus: CCK',
),
'rb_cck_action_force_to_allowed_values' => array(
'label' => t('Force a text field to an allowed value'),
'arguments' => array(
'node' => array(
'type' => 'node',
'label' => t('Node to correct'),
),
),
'help' => t('Note that this action will empty the field if a relevant
match against allowed values cannot be made. It only works with text
fields, and only single-value fields.'),
'module' => 'Rules Bonus: CCK',
),
);
// Add actions that depend on additional modules.
if (module_exists('userreference')) {
$actions['rb_cck_action_email_userreference'] = array(
'label' => t('Send e-mail to all users in a user reference field'),
'arguments' => array(
'node' => array(
'type' => 'node',
'label' => t('Node with user references'),
),
),
'help' => t('Note that this action will send all e-mail messages at once,
which may cause server choking or blacklisting for large amounts of
messages.'),
'module' => 'Rules Bonus: CCK',
'eval input' => array(
'sender',
'subject',
'message',
),
);
}
return $actions;
}