You are here

public static function RulesDataUIPartyHatName::inputForm in Party 7

Same name and namespace in other branches
  1. 8.2 modules/party_hat/party_hat.rules.inc \RulesDataUIPartyHatName::inputForm()

Constructs the direct input form.

Return value

array The direct input form.

Overrides RulesDataDirectInputFormInterface::inputForm

File

modules/party_hat/party_hat.rules.inc, line 123
Rules integration with party hats.

Class

RulesDataUIPartyHatName
Adds a hat chooser form to the enabling action.

Code

public static function inputForm($name, $info, $settings, RulesPlugin $element) {

  // Get a list of all the hats.
  $options = party_hat_options_list($name, $info, $settings, $element);
  $form[$name] = array(
    '#type' => 'select',
    '#options' => $options,
    '#default_value' => $settings[$name],
    '#required' => empty($info['optional']),
  );
  return $form;
}