You are here

function advanced_help_search_form_submit in Advanced Help 7

Same name and namespace in other branches
  1. 5 advanced_help.module \advanced_help_search_form_submit()
  2. 6 advanced_help.module \advanced_help_search_form_submit()

Process a search form submission.

1 string reference to 'advanced_help_search_form_submit'
advanced_help_search_form in ./advanced_help.module
Form builder callback to build the search form.

File

./advanced_help.module, line 437
Pluggable system to provide advanced help facilities for Drupal and modules.

Code

function advanced_help_search_form_submit($form, &$form_state) {
  $keys = empty($form_state['values']['processed_keys']) ? $form_state['values']['keys'] : $form_state['values']['processed_keys'];
  if ($keys == '') {
    form_set_error('keys', t('Please enter some keywords.'));
    return;
  }
  $popup = !empty($_GET['popup']) && user_access('view advanced help popup');
  if ($popup) {
    $form_state['redirect'] = array(
      'help/ah/search/' . $keys,
      array(
        'query' => array(
          'popup' => 'true',
        ),
      ),
    );
  }
  else {
    $form_state['redirect'] = 'help/ah/search/' . $keys;
  }
}