class RulesFormsDataValue in Rules Forms Support 7
Provides a form for the value in Condition: Element has value.
Hierarchy
- class \RulesDataUI
- class \RulesFormsDataUI implements RulesDataDirectInputFormInterface
- class \RulesFormsDataValue
- class \RulesFormsDataUI implements RulesDataDirectInputFormInterface
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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RulesDataUI:: |
public static | function | Returns the data type and parameter information for the given arguments. | |
RulesDataUI:: |
public static | function | Renders the value with a label if an options list is available. | |
RulesDataUI:: |
public static | function | Provides the selection form for a parameter. | |
RulesFormsDataUI:: |
public static | function | Provides the default form. | |
RulesFormsDataUI:: |
public static | function |
Provides the default mode. Overrides RulesDataUI:: |
|
RulesFormsDataUI:: |
public static | function |
Renders a parameter value. Overrides RulesDataDirectInputFormInterface:: |
|
RulesFormsDataValue:: |
public static | function |
Sets the input type based on the selected form element type. Overrides RulesDataDirectInputFormInterface:: |