You are here

class RulesFormsDataValue in Rules Forms Support 7

Provides a form for the value in Condition: Element has value.

Hierarchy

Expanded class hierarchy of RulesFormsDataValue

1 string reference to 'RulesFormsDataValue'
rules_forms_rules_data_info in ./rules_forms.rules.inc
Implements hook_rules_data_type_info().

File

includes/rules_forms.ui.inc, line 182
Defines data type classes for forms and form elements.

View source
class RulesFormsDataValue extends RulesFormsDataUI {

  /**
   * Sets the input type based on the selected form element type.
   */
  public static function inputForm($name, $info, $settings, RulesPlugin $element) {
    $form = parent::defaultForm($name, $info, $settings, 'Value');
    if (!empty($element->settings['element'])) {
      $type = substr($element->settings['element'], 0, strpos($element->settings['element'], ':'));
      if (in_array($type, array(
        'checkboxes',
        'radios',
        'select',
        'textfield',
      ))) {
        $form[$name]['#type'] = 'textarea';
        $form[$name]['#title'] = 'Value(s)';
      }
      else {
        $form[$name]['#type'] = $type;
      }
    }
    return $form;
  }

}

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.
RulesFormsDataUI::defaultForm public static function Provides the default form.
RulesFormsDataUI::getDefaultMode public static function Provides the default mode. Overrides RulesDataUI::getDefaultMode
RulesFormsDataUI::render public static function Renders a parameter value. Overrides RulesDataDirectInputFormInterface::render
RulesFormsDataValue::inputForm public static function Sets the input type based on the selected form element type. Overrides RulesDataDirectInputFormInterface::inputForm