public function LocaleSourcePluginUi::overviewForm

Builds the overview form for the source entities.

Parameters

array $form: Drupal form array.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

string $type: Entity type.

Return value

array Drupal form array.

Overrides SourcePluginUiBase::overviewForm

File

sources/locale/src/LocaleSourcePluginUi.php, line 99

Class

LocaleSourcePluginUi
Locale source plugin UI.

Namespace

Drupal\tmgmt_locale

Code

public function overviewForm(array $form, FormStateInterface $form_state, $type) {
  $form = parent::overviewForm($form, $form_state, $type);
  $search_data = $this
    ->getSearchFormSubmittedParams();
  $form['items']['#empty'] = $this
    ->t('No strings matching given criteria have been found.');
  $strings = $this
    ->getStrings($search_data['label'], $search_data['missing_target_language'], $search_data['context']);
  foreach ($this
    ->getTranslationData($strings, $type) as $id => $data) {
    $form['items']['#options'][$id] = $this
      ->overviewRow($type, $data);
  }
  $form['pager'] = array(
    '#type' => 'pager',
  );
  return $form;
}