You are here

class RulesDataUIPartyHatName in Party 8.2

Same name and namespace in other branches
  1. 7 modules/party_hat/party_hat.rules.inc \RulesDataUIPartyHatName

Adds a hat chooser form to the enabling action.

Hierarchy

Expanded class hierarchy of RulesDataUIPartyHatName

1 string reference to 'RulesDataUIPartyHatName'
party_hat_rules_data_info in modules/party_hat/party_hat.rules.inc
Implements hook_rules_data_info() {

File

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

View source
class RulesDataUIPartyHatName extends RulesDataUI implements RulesDataDirectInputFormInterface {
  public static function getDefaultMode() {
    return 'input';
  }
  public static function inputForm($name, $info, $settings, RulesPlugin $element) {

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

}

Members