function RulesAbstractPluginUI::form

Overrides RulesPluginUI::form().

Overridden to invoke the abstract plugins form alter callback and to add the negation checkbox for conditions.

Overrides RulesPluginUI::form

File

ui/ui.core.inc, line 956

Class

RulesAbstractPluginUI
UI for abstract plugins (conditions & actions).

Code

public function form(&$form, &$form_state, $options = array()) {
  parent::form($form, $form_state, $options);
  if ($this->element instanceof RulesCondition) {
    $form['negate'] = array(
      '#title' => t('Negate'),
      '#type' => 'checkbox',
      '#description' => t('If checked, the condition result is negated such that it returns TRUE if it evaluates to FALSE.'),
      '#default_value' => $this->element
        ->isNegated(),
      '#weight' => 5,
    );
  }
  $this->element
    ->call('form_alter', array(
    &$form,
    &$form_state,
    $options,
  ));
}