You are here

function lexicon_form_user_profile_form_alter in Lexicon 7

Implements hook_form_user_profile_form_alter().

File

./lexicon.module, line 524
The Lexicon module is used to create lists of terms and definitions to use on a website and optionally mark those terms in the content of the website.

Code

function lexicon_form_user_profile_form_alter(&$form, &$form_state, $form_id) {

  // If Lexicon is configured so that users can indicate if they want to have
  // terms marked in the content, then add the checkbox to the form.
  if (variable_get('lexicon_disable_indicator', FALSE)) {
    $account = $form['#user'];
    $form['content_lexicon'] = array(
      '#type' => 'fieldset',
      '#title' => t('Lexicon Indicators'),
    );
    $form['content_lexicon']['lexicon_disable_indicator'] = array(
      '#type' => 'checkbox',
      '#title' => t('Disable Lexicon indicators'),
      '#return_value' => 1,
      '#default_value' => isset($account->data['lexicon_disable_indicator']) ? $account->data['lexicon_disable_indicator'] : 1,
      '#description' => t('Check this box to disable the display of Lexicon indicators.'),
    );
    return $form;
  }
}