You are here

function fusion_apply_rule_save in Fusion Accelerator 7

Same name and namespace in other branches
  1. 7.2 fusion_apply/fusion_apply_rules.module \fusion_apply_rule_save()

Save a skins rule object.

Parameters

$rule: A rule object.

Return value

The rule ID.

6 calls to fusion_apply_rule_save()
FusionApplyDisplayTestCase::testFusionApplyRulesLoadSave in fusion_apply/tests/fusion_apply.test
Tests loading and saving of rules.
FusionApplyRulesApiTestCase::testFusionApplyRulesVisibility in fusion_apply/tests/fusion_apply.test
Tests visibility of rules.
fusion_apply_rule_add_submit in fusion_apply/fusion_apply_ui.rules.inc
Process fusion_apply_rule_add() submissions.
fusion_apply_rule_add_submit in fusion_apply/fusion_apply_rules.inc
Process fusion_apply_rule_add() submissions.
fusion_apply_rule_edit_submit in fusion_apply/fusion_apply_ui.rules.inc
Form submission handler for the rule configuration form.

... See full list

File

fusion_apply/fusion_apply_rules.module, line 73

Code

function fusion_apply_rule_save($rule) {

  // Make sure we're getting valid data.
  if (!fusion_apply_rule_validate($rule)) {
    return FALSE;
  }
  $status = drupal_write_record('fusion_apply_rules', $rule, !empty($rule->rid) ? array(
    'rid',
  ) : array());
  return $status;
}