You are here

public function FlexiformElementNodeAuthor::configureForm in Flexiform 7

Build the configure form for the element.

Overrides FlexiformElement::configureForm

File

includes/element/node_author.element.inc, line 103
Contains class for the Node author element.

Class

FlexiformElementNodeAuthor
Class to add the node author 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']['use_current'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use the logged in user'),
    '#default_value' => !empty($this->settings['default_value']['use_current']),
  );
  $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' => 60,
  );
  $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;
}