You are here

function pathauto_form_alter in Pathauto 5

Same name and namespace in other branches
  1. 5.2 pathauto.module \pathauto_form_alter()
  2. 6.2 pathauto.module \pathauto_form_alter()
  3. 6 pathauto.module \pathauto_form_alter()

Implementation of hook_form_alter().

File

./pathauto_node.inc, line 93

Code

function pathauto_form_alter($formid, &$form) {

  /*
   ** A helpful hint to the users with access to alias creation (pathauto
   ** will be invisible to other users). Inserted into the path module's
   ** fieldset in the node form
   */
  if (isset($form['#attributes']['id']) && $form['#attributes']['id'] == 'node-form') {
    if (user_access('create url aliases')) {
      $output .= t('An alias will be automatically generated from the title and other node attributes, in addition to any alias manually provided above.');
      if (user_access('administer pathauto')) {
        $output .= t(' To control the format of the generated aliases, see the <a href="admin/settings/pathauto">pathauto settings</a>.');
      }
    }
    if ($output) {
      $form['path']['pathauto'] = array(
        '#type' => 'item',
        '#description' => $output,
      );
    }
  }
}