<?php

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

use Drupal\Core\Form\FormStateInterface;

/**
 * Implements hook_form_system_theme_settings_alter().
 */
function toc_sr_form_system_theme_settings_alter(&$form, FormStateInterface $form_state, $form_id = NULL) {
  // Work-around for a core bug affecting admin themes. See issue #943212.
  if (isset($form_id)) {
    return;
  }
  $theme_settings = theme_get_setting('toc_master_theme_settings');
  $form['toc_sr_theme_settings'] = [
    '#type' => 'details',
    '#title' => 'SR Theme settings',
    '#tree' => TRUE,
  ];
  $form['toc_sr_theme_settings']['tourism_hub_fares_bg'] = [
    '#type'          => 'textfield',
    '#title'         => t('Tourism Hub fares background image'),
    '#default_value' => $theme_settings['tourism_hub_fares_bg'] ?? '',
    '#description'   => t("The ID of the image media for the default image to use for Tourism Hub background image."),
  ];
}
