You are here

function _answers_search_form_views_exposed_form_alter in Answers 6.2

Same name and namespace in other branches
  1. 7.3 includes/answers.search.inc \_answers_search_form_views_exposed_form_alter()

Pseudo implementation of _answers_search_form_views_exposed_form_alter().

See also

answers_form_views_exposed_form_alter()

1 call to _answers_search_form_views_exposed_form_alter()
answers_form_views_exposed_form_alter in ./answers.module
Implements hook_form_FORM_ID_alter() for views_exposed_form().

File

includes/answers.search.inc, line 77
Search functions for the 'Answers' module

Code

function _answers_search_form_views_exposed_form_alter(&$form, &$form_state) {
  $view = $form_state['view'];
  if ($view->name == 'all_questions' && ($view->current_display == 'page_5' || $view->current_display == 'page_4')) {

    // Delete the title from the search box
    $form['#info']['filter-keys']['label'] = '';

    // Change the length & description of the search box
    $form['keys']['#title'] = t('Question');
    $form['keys']['#size'] = 80;
    $form['keys']['#attributes']['title'] = t('Enter your question');

    // Change the title of the standard search button
    $form['submit']['#value'] = t('Search');
  }

  // If "Continue question display", add a button for posting the question
  if ($view->name == 'all_questions' && $view->current_display == 'page_5') {
    $form['submit']['#value'] = t('Search Again');
    $form['continue_ask'] = array(
      '#type' => 'submit',
      '#value' => t('Continue With Your Question'),
      '#submit' => array(
        'answers_continue_ask_submit',
      ),
    );
  }
}