You are here

function mpac_form_path_admin_form_alter in Multi-path autocomplete 8

Same name and namespace in other branches
  1. 7 mpac.module \mpac_form_path_admin_form_alter()

Implements hook_form_FORM_ID_alter().

File

./mpac.module, line 75
Find node paths on menu item creation via autocomplete.

Code

function mpac_form_path_admin_form_alter(&$form, $form_state) {
  if (empty($form['source']['#autocomplete_path'])) {
    $form['source']['#autocomplete_route_name'] = 'mpac.autocomplete';
    $form['source']['#autocomplete_route_parameters'] = array(
      'type' => 'path',
    );
    $form['source']['#description'] .= '<br />' . t('To get a list of items allowed here you may simply enter the title of previously created content or a part of the path to the content.');
  }
}