function flag_rules_data_type::get_default_input_form in Flag 6.2
Same name and namespace in other branches
- 6 includes/flag.rules.inc \flag_rules_data_type::get_default_input_form()
Returns radios for selecting a flag of the type given in $info['flag_type'].
Overrides rules_data_type::get_default_input_form
File
- includes/
flag.rules.inc, line 50 - Rules integration for the Flag module.
Class
- flag_rules_data_type
- Defines the flag rule data type.
Code
function get_default_input_form($info, $value, &$form_state) {
$options = _flag_rules_flags_options(isset($info['flag_type']) ? $info['flag_type'] : NULL);
$form = array(
'#type' => 'radios',
'#title' => $info['label'],
'#options' => $options,
'#required' => TRUE,
'#disabled' => !$options,
'#default_value' => isset($value) ? $value : NULL,
'#theme' => 'flag_rules_radios',
'#printed' => TRUE,
);
if (!$options) {
$form['#description'] = t('Error: There is no suiting flag available.');
}
return $form;
}