You are here

function theme_OR in Rules 6

Themes the OR condition group

2 theme calls to theme_OR()
theme_AND in rules_admin/rules_admin.render.inc
Themes the AND condition group
theme_rules_operation in rules_admin/rules_admin.render.inc
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.

File

rules_admin/rules_admin.render.inc, line 147
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_OR($element) {
  $attributes = isset($element['#attributes']) ? $element['#attributes'] : array();
  $element['#attributes'] = _rules_attributes_add_class($attributes, 'rules_' . $element['#type']);
  $element['#collapsible'] = FALSE;
  $print_op = $element['#negate'] ? t('NOT') . ' ' : '';
  $element['#title'] = t("!not%label group", array(
    '!not' => $print_op,
    '%label' => $element['#label'],
  ));
  $element['#children'] .= '<p class="logical-op-add">' . theme('rules_icon', 'add') . l(t('Add another condition to this group'), RULES_ADMIN_RULE_PATH . '/' . $element['#rule'] . '/add/condition/' . $element['#id']) . '</p>';
  $element['#children'] .= '<p class="logical-op-edit">' . theme('rules_icon', 'edit') . l(t('Edit this condition group'), RULES_ADMIN_RULE_PATH . '/' . $element['#rule'] . '/edit/' . $element['#id']) . '</p>';
  return theme('fieldset', $element);
}