You are here

class RulesDataUIPartyHatName in Party 7

Same name and namespace in other branches
  1. 8.2 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 118
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($name, $info, $settings, $element);
    $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

Namesort descending Modifiers Type Description Overrides
RulesDataUI::getTypeInfo public static function Returns the data type and parameter information for the given arguments.
RulesDataUI::renderOptionsLabel public static function Renders the value with a label if an options list is available.
RulesDataUI::selectionForm public static function Provides the selection form for a parameter.
RulesDataUIPartyHatName::getDefaultMode public static function Specifies the default input mode per data type. Overrides RulesDataUI::getDefaultMode
RulesDataUIPartyHatName::inputForm public static function Constructs the direct input form. Overrides RulesDataDirectInputFormInterface::inputForm
RulesDataUIPartyHatName::render public static function Render the configured value. Overrides RulesDataDirectInputFormInterface::render