You are here

public function FlexiformElementUserMail::configureForm in Flexiform 7

Build the configure form for the element.

Overrides FlexiformElement::configureForm

File

includes/element/user_mail.element.inc, line 71
Contains class for the User mail element.

Class

FlexiformElementUserMail
Class to add the User mail field to a form.

Code

public function configureForm($form, &$form_state, $flexiform) {
  $form = parent::configureForm($form, $form_state, $flexiform);
  $form['default_value'] = array(
    '#tree' => TRUE,
    '#type' => 'fieldset',
    '#title' => t('Default Value'),
    '#weight' => -5,
  );
  $form['default_value']['default_value'] = array(
    '#type' => 'textfield',
    '#title' => $this
      ->label() ? $this
      ->label() : t('Default'),
    '#default_value' => !empty($this->settings['default_value']['default_value']) ? $this->settings['default_value']['default_value'] : '',
    '#maxlength' => 255,
  );
  $form['default_value']['use_tokens'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use Tokens in Default Value'),
    '#default_value' => !empty($this->settings['default_value']['use_tokens']),
  );
  $form['default_value']['contexts'] = array(
    '#title' => t('Substitutions'),
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['default_value']['contexts']['contexts'] = $this
    ->getCtoolsSubstitutionsList();
  return $form;
}