function hook_social_content_settings_alter in Social Content 7.2
Same name and namespace in other branches
- 7 social_content.api.php \hook_social_content_settings_alter()
Attach fields to the settings form so that they can be stored.
You have the original record so you can grab fields from it and attach it to the wrapper.
Parameters
string $type: The type of form this is, either instance or global.
array $form: The form to alter.
object $settings: The settings array with the current values.
1 invocation of hook_social_content_settings_alter()
- SocialContent::getForm in ./
social_content.class.inc - Get an internal form of the gievn type.
File
- ./
social_content.api.php, line 57 - Hooks provided by Social Content module
Code
function hook_social_content_settings_alter(&$type, &$form, &$settings) {
$options = array(
NULL => 'None',
) + mymodule_get_content_list();
switch ($type) {
case 'instance':
$form['contest'] = array(
'#type' => 'select',
'#title' => 'Contest',
'#options' => $options,
'#default_value' => isset($settings['contest']) ? $settings['contest'] : NULL,
);
break;
}
}