1 form_test.module | form_test_checkboxes_radios_select_indentations($form, &$form_state) |
Form constructor to test indentations for radios, checkboxes and select.
File
- core/
modules/ simpletest/ tests/ form_test.module, line 1717 - Helper module for the Form API tests.
Code
function form_test_checkboxes_radios_select_indentations($form, &$form_state) {
$form['checkboxes'] = array(
'#type' => 'checkboxes',
'#title' => 'Indented checkboxes',
'#options' => array(
0 => 'No indentation',
'foo' => 'One indentation',
3 => 'No indentation 2',
'bar' => 'Two indentations',
),
);
$form['checkboxes']['foo']['#indentation'] = 1;
$form['checkboxes']['bar']['#indentation'] = 2;
$form['radios'] = array(
'#type' => 'radios',
'#title' => 'Indented radios',
'#options' => array(
0 => 'No indentation',
'foo' => 'One indentation',
3 => 'No indentation 2',
'bar' => 'Two indentations',
),
);
$form['radios']['foo']['#indentation'] = 1;
$form['radios']['bar']['#indentation'] = 2;
$form['select'] = array(
'#type' => 'select',
'#title' => 'Indented select',
'#options' => array(
0 => 'No indentation',
'foo' => 'One indentation',
3 => 'No indentation 2',
'bar' => 'Two indentations',
),
);
$form['select']['foo']['#indentation'] = 1;
$form['select']['bar']['#indentation'] = 2;
return $form;
}