You are here

private function JobItemForm::getTranslatableFields in Translation Management Tool 8

Gets the translatable fields of a given job item.

Parameters

array $form: The form array.

Return value

array $fields Returns the translatable fields of the job item.

1 call to JobItemForm::getTranslatableFields()
JobItemForm::validateJobItem in src/Form/JobItemForm.php
Form validate callback to validate the job item.

File

src/Form/JobItemForm.php, line 242

Class

JobItemForm
Form controller for the job item edit forms.

Namespace

Drupal\tmgmt\Form

Code

private function getTranslatableFields(array $form) {
  $fields = [];
  foreach (Element::children($form['review']) as $group_key) {
    foreach (Element::children($form['review'][$group_key]) as $parent_key) {
      foreach ($form['review'][$group_key][$parent_key] as $key => $data) {
        if (isset($data['translation'])) {
          $fields[$key] = [
            'parent_key' => $parent_key,
            'group_key' => $group_key,
            'data' => $data,
          ];
        }
      }
    }
  }
  return $fields;
}