You are here

class RulesConditionalWhileUI in Conditional Rules 8

Same name and namespace in other branches
  1. 7 includes/rules_conditional.ui.inc \RulesConditionalWhileUI

UI for while loops to add extra description.

Hierarchy

Expanded class hierarchy of RulesConditionalWhileUI

1 string reference to 'RulesConditionalWhileUI'
rules_conditional_rules_plugin_info in ./rules_conditional.rules.inc
Implements hook_rules_plugin_info().

File

includes/rules_conditional.ui.inc, line 198
Plugin UI implementation.

View source
class RulesConditionalWhileUI extends RulesConditionalPredicateUI {
  public function form(&$form, &$form_state, $options = array(), $iterator = NULL) {
    parent::form($form, $form_state, $options);

    // Display help for while loop.
    $form['while_help'] = array(
      '#weight' => -5,
    );
    $form['while_help']['text'] = array(
      '#prefix' => '<p>',
      '#markup' => t('Configure the condition for this while loop to continue. This loop will not end until the condition evaluates to false, or the maximum limit on the number of iterations has been reached.'),
      '#suffix' => '</p>',
    );

    // Display help to change iteration limit.
    $maxIterations = variable_get('rules_conditional_max_iterations', RULES_CONDITIONAL_MAX_ITERATIONS);
    $form['while_help']['description'] = array(
      '#prefix' => '<div class="description"><p>',
      '#markup' => t('The current limit is @limit. Note that this cannot be changed in the user interface. Although it can be changed by setting the %variable variable to another value, raising this limit must be done with care since Rules evaluation can be resource-intensive.', array(
        '@limit' => $maxIterations,
        '%variable' => 'rules_conditional_max_iterations',
      )),
      '#suffix' => '</p></div>',
    );
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RulesConditionalPredicateUI::$predicate protected property
RulesConditionalPredicateUI::buildContent public function
RulesConditionalPredicateUI::form_submit public function Delegates the form submit handler to the predicate.
RulesConditionalPredicateUI::form_validate public function Delegates the form validator to the predicate.
RulesConditionalPredicateUI::__construct public function
RulesConditionalWhileUI::form public function Delegates the form to the predicate. Overrides RulesConditionalPredicateUI::form