You are here

function fontdeck_form_alter in @font-your-face 7.2

Same name and namespace in other branches
  1. 6.2 modules/fontdeck/fontdeck.module \fontdeck_form_alter()
  2. 7 modules/fontdeck/fontdeck.module \fontdeck_form_alter()

Implements hook_form_alter().

File

modules/fontdeck/fontdeck.module, line 92

Code

function fontdeck_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'fontyourface_ui_settings_form') {
    $form['fontdeck'] = array(
      '#type' => 'fieldset',
      '#title' => 'Fontdeck',
      '#weight' => -1,
      'fontdeck_project' => array(
        '#type' => 'textfield',
        '#title' => t('Fontdeck project number'),
        '#description' => t('Only paste the project number part in the URL.'),
        '#default_value' => variable_get('fontdeck_project', ''),
        '#field_prefix' => t('http://fontdeck.com/project/'),
        '#size' => 10,
      ),
      'fontdeck_project_save' => array(
        '#type' => 'submit',
        '#value' => t('Save project number'),
      ),
    );

    // Move the default update/import button to the Fontdeck fieldset
    if (isset($form['providers']['fontdeck_import'])) {
      $form['fontdeck']['fontdeck_import'] = $form['providers']['fontdeck_import'];
      unset($form['providers']['fontdeck_import']);
    }
    $form['#submit'][] = 'fontdeck_project_submit';
  }

  // if
}