You are here

function rules_core_action_transform_info in Rules 6

Transforms action info written for core to the rules format. If the action should not be used by the rules modules, an empty array is returned.

Related topics

1 call to rules_core_action_transform_info()
rules_rules_action_info in rules/modules/rules.rules.inc
Implementation of hook_rules_action_info().

File

rules/modules/rules.rules.inc, line 323
rules integration for the rules module

Code

function rules_core_action_transform_info($name, $core_action_info, $type_map) {

  // If there is no entry in the type map or we should ignore it, we don't use this action.
  if (!empty($core_action_info['rules_ignore']) || !isset($type_map[$core_action_info['type']])) {
    return array();
  }
  $info = $type_map[$core_action_info['type']];

  // Make sure there is a object.
  $info += array(
    'arguments' => array(
      'object' => array(
        'type' => 'value',
        'default value' => NULL,
      ),
    ),
  );
  $info['label'] = $core_action_info['description'];

  // Special handling of labels for node actions
  // For consistency with the rule naming convention of calling a node "content".
  if ($core_action_info['type'] == 'node') {
    $info['label'] = str_replace(t('post'), t('content'), $info['label']);
  }
  $info['base'] = 'rules_core_action_execute';
  $info['action_name'] = $name;
  $info['configurable'] = $core_action_info['configurable'];
  return $info;
}