class RulesDataUIBoolean in Rules 7.2
UI for boolean data.
Hierarchy
- class \RulesDataUI
- class \RulesDataUIBoolean implements RulesDataDirectInputFormInterface
Expanded class hierarchy of RulesDataUIBoolean
1 string reference to 'RulesDataUIBoolean'
- rules_rules_core_data_info in modules/
rules_core.rules.inc - Implements hook_rules_data_info() on behalf of the pseudo rules_core module.
File
- ui/
ui.data.inc, line 356 - Contains data type related forms.
View source
class RulesDataUIBoolean extends RulesDataUI implements RulesDataDirectInputFormInterface {
/**
* Overrides RulesDataUI::getDefaultMode().
*/
public static function getDefaultMode() {
return 'input';
}
/**
* Implements RulesDataDirectInputFormInterface::inputForm().
*/
public static function inputForm($name, $info, $settings, RulesPlugin $element) {
$settings += array(
$name => isset($info['default value']) ? $info['default value'] : NULL,
);
// Note: Due to the checkbox even optional parameter always receive a value.
$form[$name] = array(
'#type' => 'radios',
'#default_value' => $settings[$name],
'#options' => array(
TRUE => t('@label: True.', array(
'@label' => $info['label'],
)),
FALSE => t('@label: False.', array(
'@label' => $info['label'],
)),
),
);
return $form;
}
/**
* Implements RulesDataDirectInputFormInterface::render().
*/
public static function render($value) {
return array(
'content' => array(
'#markup' => !empty($value) ? t('true') : t('false'),
),
'#attributes' => array(
'class' => array(
'rules-parameter-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. | |
RulesDataUIBoolean:: |
public static | function |
Overrides RulesDataUI::getDefaultMode(). Overrides RulesDataUI:: |
|
RulesDataUIBoolean:: |
public static | function |
Implements RulesDataDirectInputFormInterface::inputForm(). Overrides RulesDataDirectInputFormInterface:: |
|
RulesDataUIBoolean:: |
public static | function |
Implements RulesDataDirectInputFormInterface::render(). Overrides RulesDataDirectInputFormInterface:: |