You are here

function globallink_drupal_search_query in GlobalLink Connect for Drupal 7.6

Same name and namespace in other branches
  1. 7.7 globallink.inc \globallink_drupal_search_query()
  2. 7.5 globallink.inc \globallink_drupal_search_query()

Builds array out of search criteria specified in request variables.

Return value

array Array of filters.

2 calls to globallink_drupal_search_query()
globallink_interface_dashboard_filter_form in globallink_interface/globallink_interface_send.inc
Builds form to filter interfaces to send for translation on dashboard.
globallink_webform_dashboard_filter_form in globallink_webform/globallink_webform_send.inc
Builds form to filter webforms to send for translation on dashboard.

File

./globallink.inc, line 1030
Miscellaneous GlobalLink functions for node translations (non-entity).

Code

function globallink_drupal_search_query($type = NULL) {
  $filters = array();
  drupal_static_reset('language_list');
  $languages = locale_language_list('name');
  unset($languages['en']);
  $filters['string'] = array(
    'title' => t('String contains'),
    'description' => t('Leave blank to show all strings. The filter is case sensitive.'),
  );
  $filters['language'] = array(
    'title' => t('Language'),
    'options' => array_merge(array(
      'all' => t('All languages'),
      'en' => t('English (provided by Drupal)'),
    ), $languages),
  );
  $filters['translation'] = array(
    'title' => t('Filter in'),
    'options' => array(
      'all' => t('Both translated and untranslated strings'),
      'translated' => t('Only translated strings'),
      'untranslated' => t('Only untranslated strings'),
    ),
  );
  if ($type == 'interfaces') {
    $groups = module_invoke_all('locale', 'groups');
    $filters['group'] = array(
      'title' => t('Text Group'),
      'options' => array_merge(array(
        'all' => t('All text groups'),
      ), $groups),
    );
  }
  return $filters;
}