function RulesConditionContainerUI::form

Implements RulesPluginUIInterface::form().

Overrides RulesContainerPluginUI::form

File

ui/ui.core.inc, line 1170

Class

RulesConditionContainerUI
UI for Rules condition container.

Code

public function form(&$form, &$form_state, $options = array(), $iterator = NULL) {
    parent::form($form, $form_state, $options, $iterator);
    // Add the add-* operation links.
    $form['elements']['#add'] = self::addOperations();
    $form['elements']['#attributes']['class'][] = 'rules-condition-container';
    $form['elements']['#caption'] = t('Conditions');
    // By default skip.
    if (!empty($options['init']) && !$this->element
        ->isRoot()) {
        $config = $this->element
            ->root();
        $form['init_help'] = array(
            '#type' => 'container',
            '#id' => 'rules-plugin-add-help',
            'content' => array(
                '#markup' => t('You are about to add a new @plugin to the @config-plugin %label. Use indentation to make conditions a part of this logic group. See <a href="@url">the online documentation</a> for more information on condition sets.', array(
                    '@plugin' => $this->element
                        ->plugin(),
                    '@config-plugin' => $config->plugin(),
                    '%label' => $config->label(),
                    '@url' => rules_external_help('condition-components'),
                )),
            ),
        );
    }
    $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,
    );
}