You are here

function _locale_string_seek_form in Drupal 5

Same name and namespace in other branches
  1. 4 includes/locale.inc \_locale_string_seek_form()

User interface for the string search screen

1 string reference to '_locale_string_seek_form'
locale_string_search in modules/locale/locale.module
Page handler for the string search.

File

includes/locale.inc, line 351
Admin-related functions for locale.module.

Code

function _locale_string_seek_form() {

  // Get *all* languages set up
  $languages = locale_supported_languages(FALSE, TRUE);
  unset($languages['name']['en']);

  // Sanitize the values to be used in radios.
  $languages_name = array();
  foreach ($languages['name'] as $key => $value) {
    $languages_name[check_plain($key)] = check_plain($value);
  }
  $languages['name'] = $languages_name;
  asort($languages['name']);

  // Present edit form preserving previous user settings
  $query = _locale_string_seek_query();
  $form = array();
  $form['search'] = array(
    '#type' => 'fieldset',
    '#title' => t('Search'),
  );
  $form['search']['string'] = array(
    '#type' => 'textfield',
    '#title' => t('Strings to search for'),
    '#default_value' => $query->string,
    '#size' => 30,
    '#maxlength' => 30,
    '#description' => t('Leave blank to show all strings. The search is case sensitive.'),
  );
  $form['search']['language'] = array(
    '#type' => 'radios',
    '#title' => t('Language'),
    '#default_value' => $query->language ? $query->language : 'all',
    '#options' => array_merge(array(
      'all' => t('All languages'),
      'en' => t('English (provided by Drupal)'),
    ), $languages['name']),
  );
  $form['search']['searchin'] = array(
    '#type' => 'radios',
    '#title' => t('Search in'),
    '#default_value' => $query->searchin ? $query->searchin : 'all',
    '#options' => array(
      'all' => t('All strings in that language'),
      'translated' => t('Only translated strings'),
      'untranslated' => t('Only untranslated strings'),
    ),
  );
  $form['search']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Search'),
  );
  $form['#redirect'] = FALSE;
  return $form;
}