You are here

function theme_rules_operation in Rules 6

Themes the children of a logical operation. It put the operation in between each children. This function is invoked through the #theme property of the logical operations.

2 theme calls to theme_rules_operation()
rules_elements in rules/rules.module
Implementation of hook_elements() Defines default values for all available properties of rules's element types
theme_rules_admin_rule_render in rules_admin/rules_admin.render.inc
Adds surrounding elements like headlines for conditions and actions and renders the rule

File

rules_admin/rules_admin.render.inc, line 129
Rules Admin UI Functions for rendering a rule. If a rule is viewed, it's passed to drupal_get_form so it is rendered with drupal_render().

Code

function theme_rules_operation($element) {
  if (count(element_children($element)) == 0 && !isset($element['#_root'])) {

    //no children, so drupal_render() won't render the element itself, so we do it ourself except for the condition root (AND)
    $element['#children'] = t('Empty');
    return theme('OR', $element);
  }

  //render the children and put the operation between them
  $content = array();
  foreach (element_children($element) as $key) {
    $content[] = drupal_render($element[$key]);
  }
  $print_op = theme('rules_logical_operation_label', drupal_strtolower($element['#label']), $element['#label']);
  return implode($print_op, $content);
}