class RulesDataUINumberBoolean in Boolean Field 7
UI for boolean data.
Hierarchy
- class \RulesDataUI
- class \RulesDataUINumberBoolean implements RulesDataDirectInputFormInterface
Expanded class hierarchy of RulesDataUINumberBoolean
1 string reference to 'RulesDataUINumberBoolean'
- boolean_rules_data_info in ./
boolean.rules.inc - Implements hook_rules_data_info().
File
- ./
boolean.rules.inc, line 26 - Provides integration with Rules module.
View source
class RulesDataUINumberBoolean extends RulesDataUI implements RulesDataDirectInputFormInterface {
public static function getDefaultMode() {
return 'input';
}
public static function inputForm($name, $info, $settings, RulesPlugin $element) {
$settings += array(
$name => isset($info['default value']) ? $info['default value'] : NULL,
);
$form[$name] = array(
'#type' => 'select',
'#options' => boolean_value_info(),
'#default_value' => $settings[$name],
);
return $form;
}
public static function render($value) {
$states = boolean_value_info();
return array(
'content' => array(
'#markup' => $states[$value],
),
'#attributes' => array(
'class' => array(
'rules-parameter-number-boolean',
),
),
);
}
}
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. | |
RulesDataUINumberBoolean:: |
public static | function |
Specifies the default input mode per data type. Overrides RulesDataUI:: |
|
RulesDataUINumberBoolean:: |
public static | function |
Constructs the direct input form. Overrides RulesDataDirectInputFormInterface:: |
|
RulesDataUINumberBoolean:: |
public static | function |
Render the configured value. Overrides RulesDataDirectInputFormInterface:: |