You are here

public static function RulesDataUIIPAddress::inputForm in Rules 7.2

Implements RulesDataDirectInputFormInterface::inputForm().

Overrides RulesDataUIText::inputForm

File

ui/ui.data.inc, line 340
Contains data type related forms.

Class

RulesDataUIIPAddress
UI for IP addresses.

Code

public static function inputForm($name, $info, $settings, RulesPlugin $element) {
  $form = parent::inputForm($name, $info, $settings, $element);
  if (empty($info['options list'])) {
    $form[$name]['#type'] = 'textfield';
    $form[$name]['#description'] = t('If not provided, the IP address of the current user will be used.');
  }
  $form[$name]['#element_validate'][] = 'rules_ui_element_ip_address_validate';
  $form[$name]['#rows'] = 1;
  return $form;
}