<?php

/**
 * @file
 * Functions to support theming blocks in the Toc Master theme.
 */

use Drupal\block\Entity\Block;
use Drupal\Core\Template\Attribute;

/**
 * Implements hook_preprocess_HOOK().
 *
 * Pass block region value to content so this can be used in
 * MYTHEME_theme_suggestions_menu_alter.
 */
function toc_lnr_preprocess_block(&$vars) {

  // Hide contextual links from all blocks in the list.
  $blocks_hide_context_links = [
    'footerlogo',
  ];
  $id = $vars['elements']['#id'] ?? '';
  if (in_array($id, $blocks_hide_context_links)) {
    if (!empty($vars['title_suffix']) && !empty($vars['title_suffix']['contextual_links'])) {
      unset($vars['title_suffix']['contextual_links']);
    }
  }
}

function toc_lnr_preprocess_journey_smart_live_times_block(&$vars) {
  $vars['#attached']['library'][] = 'toc_lnr/feature_block__journey_smart_live_times';
}
