I'm trying to create custom Drupal 7 module. In the form setting for the module I have checkboxes where the admin can select multiple content types:
After installing the module I need to automatically create two fields (Price of type decimal (4,2), and currency of type text) only in the 'content types' the admin has selected from the list above.
And this is how I set the content type to the checkboxes list in the mymodule_payment_admin_settings_form
hook in mymodule.module
:
$form['test_content_types'] = array(
'#type' => 'checkboxes',
'#options' => drupal_map_assoc(node_type_get_names()),
'#default_value' => variable_get('test_content_types'),
'#required' => TRUE
);