You are here

function tmgmt_color_review_legend in Translation Management Tool 8

Provides color legends for job item review form.

Return value

array Color legend render array.

1 call to tmgmt_color_review_legend()
JobItemForm::form in src/Form/JobItemForm.php
Overrides Drupal\Core\Entity\EntityForm::form().

File

./tmgmt.module, line 1067
Main module file for the Translation Management module.

Code

function tmgmt_color_review_legend() {
  $items = [
    [
      'icon' => file_create_url(drupal_get_path('module', 'tmgmt') . '/icons/hourglass.svg'),
      'legend' => t('Pending'),
    ],
    [
      'icon' => file_create_url(drupal_get_path('module', 'tmgmt') . '/icons/ready.svg'),
      'legend' => t('Translated'),
    ],
    [
      'icon' => file_create_url(drupal_get_path('module', 'tmgmt') . '/icons/gray-check.svg'),
      'legend' => t('Reviewed'),
    ],
    [
      'icon' => file_create_url('core/misc/icons/73b355/check.svg'),
      'legend' => t('Accepted'),
    ],
  ];
  $output = [
    '#attached' => array(
      'library' => [
        'tmgmt/admin.seven',
        'tmgmt/admin',
      ],
    ),
    '#theme' => 'tmgmt_legend',
    '#title' => t('State:'),
    '#items' => $items,
    '#prefix' => '<div class="tmgmt-color-legend clearfix">',
    '#suffix' => '</div>',
  ];
  return $output;
}