You are here

function rules_item_rule_import in Rules 6

Item type callback: Customize to be imported rules

File

rules_admin/rules_admin.export.inc, line 54

Code

function rules_item_rule_import(&$name, &$rule) {
  $rules = rules_get_configured_items('rules');
  if (!isset($rule['#status']) || $rule['#status'] == 'default') {
    if (!isset($rules[$name])) {

      // This default rule doesn't exist on this system, so we make it custom
      $rule['#status'] = 'custom';
    }
  }
  if (isset($rule['#status']) && $rule['#status'] == 'custom' && (!isset($rules[$name]) || $rules[$name]['#label'] != $rule['#label'] || $rules[$name]['#set'] != $rule['#set'])) {
    $rule['#status'] = 'custom';
  }
  rules_import_hook($rule);
}