You are here

function purl_form_alter in Persistent URL 7

Same name and namespace in other branches
  1. 8 purl.module \purl_form_alter()
  2. 6 purl.module \purl_form_alter()

Implements hook_form_alter().

File

./purl.module, line 96

Code

function purl_form_alter(&$form, &$form_state, $form_id) {
  switch ($form_id) {
    case 'menu_edit_menu':
    case 'menu_edit_item':
    case 'redirect_edit_form':
      module_load_include('inc', 'purl', 'purl.admin');
      _purl_form_alter($form, $form_state, $form_id);
      break;
    case 'views_exposed_form':
      foreach (purl_active()
        ->get('querystring') as $element) {
        if (!isset($form[$element->value])) {
          $form[$element->value] = array(
            '#type' => 'hidden',
            '#value' => $element->id,
          );
        }
      }
      break;
  }
}