You are here

public function TMGMTLocaleSourceUIController::overviewSearchFormRedirect in Translation Management Tool 7

Performs redirect with search params appended to the uri.

In case of triggering element is edit-search-submit it redirects to current location with added query string containing submitted search form values.

Parameters

array $form: Drupal form array.

$form_state: Drupal form_state array.

$type: Entity type.

1 call to TMGMTLocaleSourceUIController::overviewSearchFormRedirect()
TMGMTLocaleSourceUIController::overviewFormSubmit in sources/locale/tmgmt_locale.ui.inc
Implements TMGMTSourceUIControllerInterface::overviewFormSubmit().

File

sources/locale/tmgmt_locale.ui.inc, line 303
Provides the I18nString source controller.

Class

TMGMTLocaleSourceUIController
Class TMGMTI18nStringDefaultSourceUIController

Code

public function overviewSearchFormRedirect($form, &$form_state, $type) {
  if ($form_state['triggering_element']['#id'] == 'edit-search-submit') {
    $query = array();
    foreach ($form_state['values']['search'] as $key => $value) {
      $query[$key] = $value;
    }
    drupal_goto($_GET['q'], array(
      'query' => $query,
    ));
  }
}