Created
April 28, 2014 17:20
-
-
Save msupko/11378384 to your computer and use it in GitHub Desktop.
Separate module to add fields to Bakery settings form
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name = Bakery Override | |
description = Appends User Fields to the Bakery setting form | |
core = 7.x | |
dependencies[] = bakery |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_form_FORM_ID_alter() | |
* | |
* Add user fields to Bakery settings form | |
*/ | |
function bakery_override_form_bakery_settings_alter(&$form, &$form_state, $form_id) { | |
$options = array(); | |
$result = field_info_instances('user'); | |
foreach ($result['user'] as $field => $data) { | |
$options[$field] = check_plain($data['label']); | |
} | |
$form['bakery_supported_fields']['#options'] = array_merge($form['bakery_supported_fields']['#options'], $options); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment