public function TMGMTLocaleSourceUIController::overviewSearchFormPart in Translation Management Tool 7
Builds search form for entity sources overview.
Parameters
array $form: Drupal form array.
$form_state: Drupal form_state array.
$type: Entity type.
Return value
array Drupal form array.
1 call to TMGMTLocaleSourceUIController::overviewSearchFormPart()
- TMGMTLocaleSourceUIController::overviewForm in sources/
locale/ tmgmt_locale.ui.inc - Implements TMGMTSourceUIControllerInterface::overviewForm().
File
- sources/
locale/ tmgmt_locale.ui.inc, line 173 - Provides the I18nString source controller.
Class
- TMGMTLocaleSourceUIController
- Class TMGMTI18nStringDefaultSourceUIController
Code
public function overviewSearchFormPart($form, &$form_state, $type) {
$options = array();
foreach (language_list() as $langcode => $language) {
$options[$langcode] = $language->name;
}
$default_values = $this
->getSearchFormSubmittedParams();
$form['search_wrapper'] = array(
'#prefix' => '<div class="tmgmt-sources-wrapper tmgmt-i18n_string-sources-wrapper">',
'#suffix' => '</div>',
'#weight' => -15,
);
$form['search_wrapper']['search'] = array(
'#tree' => TRUE,
);
$form['search_wrapper']['search']['label'] = array(
'#type' => 'textfield',
'#title' => t('Source text'),
'#default_value' => isset($default_values['label']) ? $default_values['label'] : NULL,
);
// Unset English as it is the source language for all locale strings.
unset($options['en']);
$form['search_wrapper']['search']['missing_target_language'] = array(
'#type' => 'select',
'#title' => t('Not translated to'),
'#options' => $options,
'#empty_option' => '--',
'#default_value' => isset($default_values['missing_target_language']) ? $default_values['missing_target_language'] : NULL,
);
$form['search_wrapper']['search_submit'] = array(
'#type' => 'submit',
'#value' => t('Search'),
);
return $form;
}