public function FlexiformElementUserName::configureForm in Flexiform 7
Build the configure form for the element.
Overrides FlexiformElement::configureForm
File
- includes/
element/ user_name.element.inc, line 85 - Contains class for the User name element.
Class
- FlexiformElementUserName
- Class to add the node title field to a form.
Code
public function configureForm($form, &$form_state, $flexiform) {
$form = parent::configureForm($form, $form_state, $flexiform);
// Add option to turn email registration behaviour on and off for a given
// form.
if (module_exists('email_registration')) {
$form['email_registration'] = array(
'#type' => 'checkbox',
'#title' => t('Use email registration default name behavior'),
'#description' => t('Let email registration automatically create a username and hide this element.'),
'#default_value' => isset($this->settings['email_registration']) ? $this->settings['email_registration'] : TRUE,
);
}
$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;
}