-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmorphos.theme
More file actions
40 lines (33 loc) · 1.11 KB
/
morphos.theme
File metadata and controls
40 lines (33 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* @file
* Theme file for Morphos theme.
*/
use Drupal\Core\Form\FormStateInterface;
/**
* Implements hook_form_system_theme_settings_alter().
*/
function morphos_form_system_theme_settings_alter(&$form, FormStateInterface $form_state): void {
require_once __DIR__ . '/includes/settings.inc';
_morphos_theme_settings($form, $form_state);
}
/**
* Implements hook_page_attachments_alter().
*/
function morphos_page_attachments_alter(array &$attachments): void {
$themeSettingsProvider = \Drupal::service('Drupal\Core\Extension\ThemeSettingsProvider');
// Attach Theme variables if enabled.
if ($themeSettingsProvider->getSetting("definition.enable")) {
require_once __DIR__ . '/theme_colors/theme_colors_variables.inc';
_theme_colors_variables($attachments);
}
}
/**
* Implements hook_preprocess_form_element().
*/
function morphos_preprocess_form_element(&$variables) {
$variables['label']['#__element_type'] = $variables['element']['#type'];
if (isset($variables['element']['#_required'])) {
$variables['label']['#element_is_required'] = $variables['element']['#_required'];
}
}