function tmgmt_color_legend_local_task

Provides color legends for local tasks.

Return value

array Color legend render array.

1 call to tmgmt_color_legend_local_task()
TaskLegend::render in translators/tmgmt_local/src/Plugin/views/area/TaskLegend.php

File

translators/tmgmt_local/tmgmt_local.module, line 743
Main module file for the local translation module.

Code

function tmgmt_color_legend_local_task() {
  $npath = \Drupal::service('extension.list.module')
    ->getPath('tmgmt');
  $items = [
    [
      'icon' => \Drupal::service('file_url_generator')
        ->generateAbsoluteString($npath . '/icons/rejected.svg'),
      'legend' => t('Unassigned'),
    ],
    [
      'icon' => \Drupal::service('file_url_generator')
        ->generateAbsoluteString($npath . '/icons/ready.svg'),
      'legend' => t('Needs action'),
    ],
    [
      'icon' => \Drupal::service('file_url_generator')
        ->generateAbsoluteString($npath . '/icons/hourglass.svg'),
      'legend' => t('In review'),
    ],
    [
      'icon' => \Drupal::service('file_url_generator')
        ->generateAbsoluteString($npath . '/icons/ex-red.svg'),
      'legend' => t('Rejected'),
    ],
    [
      'icon' => \Drupal::service('file_url_generator')
        ->generateAbsoluteString('core/misc/icons/73b355/check.svg'),
      'legend' => t('Closed'),
    ],
  ];
  $output = [
    '#attached' => array(
      'library' => [
        'tmgmt/admin.seven',
        'tmgmt/admin',
      ],
    ),
    '#theme' => 'tmgmt_local_legend',
    '#title' => t('Status:'),
    '#items' => $items,
    '#prefix' => '<div class="tmgmt-color-legend clearfix">',
    '#suffix' => '</div>',
  ];
  return $output;
}