You are here

function _webform_conditional_rule_expand in Webform 7.4

Helper. Generate form elements for one rule.

1 call to _webform_conditional_rule_expand()
_webform_conditional_expand in includes/webform.conditionals.inc
Form API #process function to expand a webform conditional element.

File

includes/webform.conditionals.inc, line 512
Form elements and menu callbacks to provide conditional handling in Webform.

Code

function _webform_conditional_rule_expand($element, $rid, $conditional, $level, &$andor) {
  return array(
    '#level' => $level,
    'source_type' => array(
      '#type' => 'value',
      '#value' => $conditional['source_type'],
    ),
    'source' => array(
      '#type' => 'select',
      '#title' => t('Source'),
      '#options' => $element['#sources'],
      '#default_value' => $conditional['source'],
    ),
    'operator' => array(
      '#type' => 'select',
      '#title' => t('Operator'),
      '#options' => webform_conditional_operators_list(),
      '#default_value' => $conditional['operator'],
    ),
    'value' => array(
      '#type' => 'textfield',
      '#title' => t('Value'),
      '#size' => 20,
      '#default_value' => $conditional['value'],
      '#maxlength' => 1024,
    ),
    'add_subconditional' => _webform_conditional_add_expand($element, $rid, TRUE),
    'add' => _webform_conditional_add_expand($element, $rid, FALSE),
    'remove' => _webform_conditional_remove_expand($element, $rid),
    'andor' => _webform_conditional_andor_expand($andor),
  );
}