You are here

function _sarnia_get_rule_text in Sarnia 7

2 calls to _sarnia_get_rule_text()
sarnia_schema_rule_list in ./sarnia.rules.inc
theme_sarnia_schema_rule_form in ./sarnia.rules.inc
Transforms the rules administration form into a table.

File

./sarnia.rules.inc, line 394

Code

function _sarnia_get_rule_text($rule) {
  $replacements = array(
    '@effect' => $rule->effect,
    '@behavior' => _sarnia_get_behavior_label($rule->behavior),
    '@match_type' => $rule->match_type,
    '@match_value' => $rule->match_value,
    '@replacement' => $rule->replacement,
  );
  if ($rule->effect == 'disable') {
    return t("@effect @behavior when property @match_type = @match_value", $replacements);
  }
  elseif ($rule->effect == 'replace') {
    return t("use properties where @match_type = @match_value to @behavior properties where @match_type = @replacement", $replacements);
  }
}