You are here

function fonts_com_setup_form in @font-your-face 7.2

Provides account settings form.

1 string reference to 'fonts_com_setup_form'
fonts_com_menu in modules/fonts_com/fonts_com.module
Implements hook_menu().

File

modules/fonts_com/fonts_com.module, line 316

Code

function fonts_com_setup_form($form, &$form_state) {
  drupal_add_js(drupal_get_path('module', 'fonts_com') . '/js/settings.js', array(
    'weight' => 10,
  ));
  drupal_add_css(drupal_get_path('module', 'fonts_com') . '/css/settings.css');
  $form = array();
  $auth_collapsed = FALSE;
  $pass_collapsed = TRUE;
  $create_collapsed = TRUE;
  $form['auth'] = array(
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#collapsed' => $auth_collapsed,
    '#title' => t('Enter Fonts.com authentication key'),
    '#weight' => 1,
    'fonts_com_token' => array(
      '#type' => 'textfield',
      '#description' => t('This is available at !url', array(
        '!url' => l('https://webfonts.fonts.com/en-US/Account/AccountInformation', 'https://webfonts.fonts.com/en-US/Account/AccountInformation'),
      )),
      '#default_value' => variable_get('fonts_com_token', ''),
    ),
    'fonts_com_key_save' => array(
      '#type' => 'submit',
      '#value' => t('Save'),
    ),
  );
  $form['pass'] = array(
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#collapsed' => $pass_collapsed,
    '#weight' => 2,
    '#prefix' => '<div class="or">' . t('OR') . '</div>',
    '#title' => t('Enter Fonts.com account information'),
    'fonts_com_pass_email' => array(
      '#type' => 'textfield',
      '#title' => t('Email address'),
    ),
    'fonts_com_pass_pass' => array(
      '#type' => 'password',
      '#title' => t('Password'),
    ),
    'fonts_com_pass_save' => array(
      '#type' => 'submit',
      '#value' => t('Get Key'),
    ),
  );
  $form['create'] = array(
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#collapsed' => $create_collapsed,
    '#title' => t('Create new Fonts.com account'),
    '#weight' => 3,
    '#prefix' => '<div class="or">' . t('OR') . '</div>',
    'fonts_com_first_name' => array(
      '#type' => 'textfield',
      '#title' => t('First name'),
    ),
    'fonts_com_last_name' => array(
      '#type' => 'textfield',
      '#title' => t('Last name'),
    ),
    'fonts_com_email' => array(
      '#type' => 'textfield',
      '#title' => t('Email address'),
    ),
    'fonts_com_create' => array(
      '#type' => 'submit',
      '#value' => t('Create Account'),
    ),
  );
  return $form;
}