You are here

function socialmedia_widgets_set_form_alter in Social media 7

File

./socialmedia.module, line 401
Demonstrate basic module socialmedia.

Code

function socialmedia_widgets_set_form_alter(&$form, $set) {
  $data = $set['data'];
  $form['socialmedia'] = array(
    '#type' => 'fieldset',
    '#title' => t('Social media'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $options = array(
    'site' => t('Use site profiles only'),
    'user' => t('Use user profiles only'),
    'usersite' => t('Try user profiles first, fallback to site profiles.'),
  );
  $form['socialmedia']['profile_context'] = array(
    '#type' => 'radios',
    '#title' => t('Profile context'),
    '#description' => t('Both site and user level social media profiles can be enabed. This option sets which types of profiles to use for the this widget set.'),
    '#options' => $options,
    '#default_value' => isset($data['socialmedia']['profile_context']) ? $data['socialmedia']['profile_context'] : 'usersite',
  );
}