You are here

function pathauto_entity_form_alter in Pathauto Entity 7

Implements hook_form_alter().

File

./pathauto_entity.module, line 376
Implements custom entity type support for Pathauto module.

Code

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

  // Show only on entities that have Pathauto activated.
  $available = pathauto_entity_available_entity_types();
  if (!empty($available)) {
    foreach ($available as $entity_type => $status) {
      if ($status != '0') {
        $entity_forms = (array) pathauto_entity_alias_settings($entity_type);
        if ($entity_forms && in_array($form_id, $entity_forms)) {
          $form_elements = pathauto_entity_alias_form($form, $form_state, $form_id, $entity_type);
          foreach ($form_elements as $id => $value) {
            $form[$id] = $value;
          }
        }
      }
    }
  }
}