You are here

function page_title_form_user_profile_form_alter in Page Title 7.2

Same name and namespace in other branches
  1. 8.2 page_title.module \page_title_form_user_profile_form_alter()
  2. 6.2 page_title.module \page_title_form_user_profile_form_alter()

Implement hook_form_FORM_ID_alter().

File

./page_title.module, line 226
Enhanced control over the page title (in the head tag).

Code

function page_title_form_user_profile_form_alter(&$form, $form_state) {

  // If we dont have permission to set the title then we need to abort this alter now!
  if (!user_access('set page title')) {
    return;
  }

  // Check the user profile form has the show field enabled
  if (variable_get('page_title_user_showfield', 0)) {
    $form['account']['page_title'] = array(
      '#type' => 'textfield',
      '#title' => t('Page title'),
      '#description' => t('Provide a description of this user to appear in the <title> tag which search engines can use in search result listings (optional). It is generally accepted this field should be less than 70 characters.'),
      '#default_value' => page_title_load_title($form['#user']->uid, 'user'),
      '#size' => 60,
      '#maxlength' => 255,
      '#weight' => 20,
    );
  }
}