Error message

Warning: count(): Parameter must be an array or an object that implements Countable in _api_make_match_member_link() (line 1230 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).

function tmgmt_color_review_legend

Provides color legends for job item review form.

Return value

array Color legend render array.

1 call to tmgmt_color_review_legend()

File

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

Code

function tmgmt_color_review_legend() {
  $items = [
    [
      'icon' => \Drupal::service('file_url_generator')
        ->generateAbsoluteString(\Drupal::service('extension.list.module')
        ->getPath('tmgmt') . '/icons/hourglass.svg'),
      'legend' => t('Pending'),
    ],
    [
      'icon' => \Drupal::service('file_url_generator')
        ->generateAbsoluteString(\Drupal::service('extension.list.module')
        ->getPath('tmgmt') . '/icons/ready.svg'),
      'legend' => t('Translated'),
    ],
    [
      'icon' => \Drupal::service('file_url_generator')
        ->generateAbsoluteString(\Drupal::service('extension.list.module')
        ->getPath('tmgmt') . '/icons/gray-check.svg'),
      'legend' => t('Reviewed'),
    ],
    [
      'icon' => \Drupal::service('file_url_generator')
        ->generateAbsoluteString('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;
}