You are here

function socialmedia_setup_1_form in Social media 7

Select social media profiles

_state

Parameters

$form:

File

./socialmedia.setup.inc, line 57
Setup wizard

Code

function socialmedia_setup_1_form($form, $form_state) {
  require_once drupal_get_path('module', 'socialmedia') . '/socialmedia.admin.inc';
  drupal_set_title(t('Social media profiles setup'));
  $instructions = <<<EOF
<p>The first step is to setup your social media profiles. The social media module supports several platforms such as Twitter, Facebook and Google+. If you already have accounts enter them below. If you have not setup any social media profiles yet or want to create additional ones, follow the homepage links below to create accounts.
</p><p>
You do not have to create an account on all platforms. Any platforms that you do not enter a profile url for will be ignored. You can add and remove profiles later on the Social Media configuration page.
EOF;
  $form['instructions'] = array(
    '#markup' => t($instructions),
  );
  $form['setup_mode'] = array(
    '#type' => 'value',
    '#value' => 1,
  );
  $platforms = socialmedia_socialmedia_platform_info();
  $fields = socialmedia_admin_profiles_form($form, $form_state, 'site', NULL, TRUE);
  unset($fields['Widget platforms']);
  $fields['submit']['#value'] = t('Save profiles');
  $form = array_merge($form, $fields);
  $form['#validate'][] = 'socialmedia_admin_profiles_form_validate';
  $form['#submit'][] = 'socialmedia_setup_1_form_submit';
  return $form;
}