You are here

function rules_get_item_defaults in Rules 6

Returns all defined item defaults $item_type Which defaults to return, e.g. 'rules', 'rule_sets' or 'states'

1 call to rules_get_item_defaults()
rules_get_configured_items in rules/rules.module
Gets all configured items, regardless if defined by the admin or by a module

File

rules/rules.module, line 53
Rules engine module

Code

function rules_get_item_defaults($item_type = 'rules') {
  rules_include('rules_defaults');
  $defaults = rules_gather_data('rules_defaults', 'all', FALSE);
  if ($item_type == 'rules' && isset($defaults[$item_type])) {

    // Apply the rule format upgrade to each rule if necessary.
    $items = array_map('rules_rule_format_upgrade', $defaults[$item_type]);
    $items = array_map('rules_import_hook', $items);
    return $items;
  }
  return isset($defaults[$item_type]) ? $defaults[$item_type] : array();
}