You are here

class RulesConditionContainerUI in Rules 7.2

UI for Rules condition container.

Hierarchy

Expanded class hierarchy of RulesConditionContainerUI

2 string references to 'RulesConditionContainerUI'
hook_rules_plugin_info in ./rules.api.php
Defines rules plugins.
rules_rules_plugin_info in ./rules.module
Implements hook_rules_plugin_info().

File

ui/ui.core.inc, line 1165
Contains core Rules UI functions.

View source
class RulesConditionContainerUI extends RulesContainerPluginUI {

  /**
   * Implements RulesPluginUIInterface::form().
   */
  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,
    );
  }

  /**
   * @param array $form
   *   The form array where to add the form.
   * @param array $form_state
   *   The current form state.
   */
  public function form_extract_values($form, &$form_state) {
    parent::form_extract_values($form, $form_state);
    $form_values = RulesPluginUI::getFormStateValues($form, $form_state);
    if (isset($form_values['negate'])) {
      $this->element
        ->negate($form_values['negate']);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RulesConditionContainerUI::form public function Implements RulesPluginUIInterface::form(). Overrides RulesContainerPluginUI::form
RulesConditionContainerUI::form_extract_values public function Overrides RulesContainerPluginUI::form_extract_values
RulesContainerPluginUI::addOperations public function Gets the Add-* operations for the given element.
RulesContainerPluginUI::buildContent public function Implements RulesPluginUIInterface. Overrides RulesPluginUI::buildContent 1
RulesContainerPluginUI::operations public function Implements RulesPluginUIInterface. Overrides RulesPluginUI::operations 1
RulesPluginUI::$basePath public static property The base path determines where a Rules overview UI lives.
RulesPluginUI::$element protected property
RulesPluginUI::defaultRedirect public static function Determines the default redirect target for an edited/deleted element.
RulesPluginUI::formDefaults public static function
RulesPluginUI::form_submit public function Implements RulesPluginUIInterface. Overrides RulesPluginUIInterface::form_submit
RulesPluginUI::form_validate public function Implements RulesPluginUIInterface. Overrides RulesPluginUIInterface::form_validate 2
RulesPluginUI::getDataTypeClass public function Returns the name of class for the given data type.
RulesPluginUI::getFormStateValues public static function Returns the state values for $form, possibly only a part of the whole form.
RulesPluginUI::getOptions public static function
RulesPluginUI::getParameterForm protected function Actually generates the parameter form for the given data type.
RulesPluginUI::getTags public static function
RulesPluginUI::getVariableForm public function Returns the form for configuring the info of a single variable.
RulesPluginUI::help public function Implements RulesPluginUIInterface. Overrides RulesPluginUIInterface::help
RulesPluginUI::overviewTable public static function Deprecated by the controllers overviewTable() method.
RulesPluginUI::path public static function Generates an operation path.
RulesPluginUI::settingsForm public function Adds the configuration settings form (label, tags, description, ...). 1
RulesPluginUI::settingsFormExtractValues public function 1
RulesPluginUI::settingsFormPermissionMatrix protected function Provides a matrix permission for the component based in the existing roles.
RulesPluginUI::settingsFormSubmit public function
RulesPluginUI::settingsFormValidate public function
RulesPluginUI::__construct public function Provide $this->element to make the code more meaningful. 1