You are here

function tmgmt_color_legend_local_task in Translation Management Tool 8

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
Render the area.

File

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

Code

function tmgmt_color_legend_local_task() {
  $items = [
    [
      'icon' => file_create_url(drupal_get_path('module', 'tmgmt') . '/icons/rejected.svg'),
      'legend' => t('Unassigned'),
    ],
    [
      'icon' => file_create_url(drupal_get_path('module', 'tmgmt') . '/icons/ready.svg'),
      'legend' => t('Needs action'),
    ],
    [
      'icon' => file_create_url(drupal_get_path('module', 'tmgmt') . '/icons/hourglass.svg'),
      'legend' => t('In review'),
    ],
    [
      'icon' => file_create_url(drupal_get_path('module', 'tmgmt') . '/icons/ex-red.svg'),
      'legend' => t('Rejected'),
    ],
    [
      'icon' => file_create_url('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;
}